Query by example - how can I display VCRow in JTable?

I would like to provide the user with a searchable table.
Actually I would like to use two tables: one, displaying one row where the user can specify the search criteria. And the second table should display the data found.
I could store the entered criteria locally in a hashmap in TableModel, for example, then create a WHERE clause. This solution is quite messy, since the user can add, remove and rearrange the columns of both tables.
Or I could use -I hope- the query-by-example feature, like this:
am = app.getApplicationModule();
ViewObject vo = am.createViewObject( "MyVO", "mypackage1.PatView" );
ViewCriteria vc = vo.createViewCriteria();
ViewCriteriaRow vcr = vc.createViewCriteriaRow();
Now I can set attributes and use vo.applyViewCriteria() to find my data.
But how can I bring the first JTable to display this single ViewCriteriaRow, so that the user can do the editing?
The JUNavigationBar does it, if I am not mistaken. It switches the PanelBinding to find mode, and then a JTable displays a ViewCriteriaRow (?) instead of the ViewObject's data. But I don't want to use the bar. How do I create this behaviour manually?
The javadoc of JUPanelBinding says:
"Sets this panel and all its associated iterators into find mode."
So I guess that setting iterators into find mode is what I need. But I cannot figure out how to do that. Who can?

You cannot set the iterators in a panelBinding to separate find/data modes individually.
However you can create two JUPanelBinding objects one for the findMode form and one that displays Data.
here's what I did to modify a generated SingleForm, to display two panels of the same type one in find mode and other in data mode.
I changed the jbInit method of the "LayoutPanel" class to be like:
//declare this as a member of the class.
JButton findBtn;
public void jbInit() throws Exception
// Panel layout
masterViewPanel = new PanelDeptView(panelBinding);
//create another instance of PanelBinding for a second (findform) DeptView panel.
JUPanelBinding binding = new JUPanelBinding("Project3.Mypackage1Module", this);
binding.setApplication(panelBinding.getApplication());
masterViewPanel1 = new PanelDeptView(binding); //create second instance
findBtn = masterViewPanel1.navBar.getButton(JUNavigationBar.BUTTON_FIND);
findBtn.doClick(); //set the second instance in find mode.
//add a listener on the second instance's execute button so that it resets the form into find mode
//this forces the second instance to be in find mode when execute button is pressed.
masterViewPanel1.navBar.getButton(JUNavigationBar.BUTTON_EXECUTE).addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ev)
SwingUtilities.invokeLater(new Runnable() {
public void run()
findBtn.doClick();
this.setLayout(panelLayout);
add(masterViewPanel, BorderLayout.WEST);
//add the second instance.
add(masterViewPanel1, BorderLayout.EAST);
I also had to call findBtn.doClick() again in the "constructor" that takes (JUApplication, boolean) after the panelBinding is executed,
to force the initial startup of this panel in findmode

Similar Messages

  • How can i display all the query items to a table?

    how can i display all the query items to a table in a jsp file?
    i always have an out of memory error..

    any body??any idea?
    is it possible thru configuration or i have to write a program by the abaper??
    Biswa

  • How can I display XSLT transformer errors on a web page ?

    Hi,
    I have some JSP pages that access DB, create an XML based on DB data and then transform it into HTML through an XSLT stylesheet. Developing the XSL code it's easy to make mistakes and generate errors on trasformation, but what I receive on the web page is only a "Could not compile stylesheet" TransformerConfigurationException, while the real cause of the error is displayed only on tomcat logs. This is the code for transformation:
    static public void applyXSLT(Document docXML, InputStream isXSL, PrintWriter pw) throws TransformerException, Exception {
            // instantiate the TransformerFactory.
            TransformerFactory tFactory = TransformerFactory.newInstance();
            // creates an error listener
            XslErrorListener xel = new XslErrorListener();
            // sets the error listener for the factory
            tFactory.setErrorListener(xel);
            // generate the transformer
            Transformer transformer = tFactory.newTransformer(new SAXSource(new InputSource(isXSL)));
            // transforms the XML Source and sends the output to the HTTP response
            transformer.transform(new DOMSource(docXML), new StreamResult(pw));
    }If an exception is thrown during the execution of this code, its error message is displayed on the web page.
    This is the listener class:
    public class XslErrorListener implements ErrorListener {
        public XslErrorListener() {
        public void warning(TransformerException ex) {
            // logs on error log
            System.err.println("\n\nWarning on XEL: " + ex.getMessage());
        public void error(TransformerException ex) throws TransformerException {
            // logs on error log
            System.err.println("\n\nError on XEL: " + ex.getMessage());
            // and throws it
            throw ex;
        public void fatalError(TransformerException ex) throws TransformerException {
            // logs on error log
            System.err.println("\n\nFatal Error on XEL: " + ex.getMessage());
            // and throws it
            throw ex;
    }When I have an error in the XSL stylesheet (for examples a missing closing tag), I can find on tomcat logs the real cause of the error:
    [Fatal Error] :59:10: The element type "table" must be terminated by the matching end-tag "</table>".
    Error on XEL: The element type "table" must be terminated by the matching end-tag "</table>".but on my web page is reported just the TransformerConfigurationException message that is:
    "Could not compile stylesheet".
    How can I display the real cause of the error directly on the web page?
    Thanks,
    Andrea

    This code is part of a bigger project that let developers edit XSL stylesheets through a file upload on the system and we can't impose the use of any tool for checking the xsl. So, I need to display the transformer error on the web page.I see. This code is part of an editorial/developmental tool for developers to create and edit XSL stylesheets.
    As part of the editorial process, XSL errors during editing can be considered a normal condition. In other words, it is normal to expect that the developers will generate XSL errors as they are developing stylesheets.
    In this light, handling the XSL transformation errors is a business requirement that you need to handle. Using the Java Exceptions mechanisms, e.g. try / catch are inappropriate to handle business requirements, in my opinion.
    I suggest that you look at how you handle the occurence of XSL errors differently than what you currently have. You need to:
    (1) capture the Transformation exception on the server;
    (2) extract the message from the exception and put it into a message that can be easily understood by the user;
    The current error message that you have going to the web browser is not useful.
    And you should not have the Transformation exception sent to the web browser either.
    What you are attempting to do with the exception is not appropriate.
    Handle the Transformation exception on the Business tier and use it to create a useful message that is then sent to the Presentation tier. In other words, do not send Java exceptions to web browser.
    />

  • How can i display data in the table?

    i have a vi that reading the data 1 by 1 (according on what you have chosen)data is displaying in the the table, also 1 by 1 in 1 column only.
    I want them to look like this:
    apple | epol | apol
    mango | manga| maga
    (if it is Ok, can i have an example how can i do this?)
    Thank You

    In LabView 6 or 7, you can use a table control. You can control the displayed size programmaitcally with a property node or by editing the front panel control.
    Look at the table examples that ship with LabView. From any LabView window, goto Help >> Find Examples >> Search, then enter TABLE ins the box labeled Type a keyword to find.

  • How can I display more than one value in Calendar ?

    Hi,
    the standard (example) script allows for the display of one value only (as I understood). How can I display two or three values, from the very same table ? Students of mine during an HTMLDB workshop in Leipzig did ask that question.
    Do we have a more detailed docum. on the use of the calendar ?
    pls kindly advise. TIA.
    Bernhard

    my solution:
    Source fo the calendar starts:
    snip>
    declare
    q varchar(32767) := null;
    begin
    q := 'select "ETA", <--- Date Field and concatination of fields as follows:
    "SCHIFFSNAME"|| "ETA_TIME"|| "TERMINAL"||''(br*)'',
    null,
    null,
    null,
    null
    from "#OWNER#"."SCHEDULE"'; . . . . . . .
    snip>
    comment on (br*) - you have to use "<" and ">" instead of "( " and ")" to have the "break/new line effect"
    brgds
    Bernhard

  • How can I display the data in table in separate column?

    I have a vi reading data one by one in the same column.
    How can I display the data with separate column?
    like this:
    data 1 | read | read
    data 2 | read | read
    data 3 | read | read
    (would you mind if I will ask for an example
    because it is much easier for me to work
    with an example)
    THANK YOU.

    If you're reading your data in as a 1D array, this is as simple as using the Reshape Array to make a 2D array. I've attached an example in LabVIEW 6.1 format. The example rearranges a single column of data fill several columns horizontally, but you can easily modify this code to fill the columns downward instead.
    Attachments:
    Data_Column_Example.vi ‏18 KB

  • How can i display recent update/delete/insert records in form

    Hai !!!!
    i am new for forms,.......any body tell me, how can i display recent no of records updated or no of records deleted or no of records are inserted in a form. these records count are display in display items....give me detail explination......
    Subbu.....

    the easiest way is copy and paste the oracle-forms example from the OU.
    You need form-level-trigger ON-ERROR + ON-MESSAGE, POST-INSERT, POST-UPDATE, POST-DELETE, three global variables and a procedure:
    ON-ERROR
    handle_message( error_code, 'ERROR: ' || ERROR_TYPE || '-' || TO_CHAR(ERROR_CODE) ||': '|| ERROR_TEXT );
    ON-MESSAGE
    handle_message( message_code, MESSAGE_TYPE || '-' || TO_CHAR(MESSAGE_CODE) || ': ' || MESSAGE_TEXT );
    PROCEDURE handle_message( message_number IN NUMBER, message_line IN VARCHAR2 ) IS
    BEGIN
        IF message_number IN ( 40400, 40406, 40407 )
        THEN
          DEFAULT_VALUE( '0', 'GLOBAL.insert' );
          DEFAULT_VALUE( '0', 'GLOBAL.update' );
          DEFAULT_VALUE( '0', 'GLOBAL.delete' );
          MESSAGE('Save Ok: ' ||
            :GLOBAL.insert || ' records inserted, ' ||
           :GLOBAL.update || ' records updated, ' ||
           :GLOBAL.delete || ' records deleted !!!' );
          ERASE('GLOBAL.insert'); 
          ERASE('GLOBAL.update');
          ERASE('GLOBAL.delete');
        ELSE
             MESSAGE(message_line );
              END IF;
    END;
    POST-INSERT
    DEFAULT_VALUE('0', 'GLOBAL.insert');
    :GLOBAL.insert := TO_CHAR( TO_NUMBER( :GLOBAL.insert ) + 1 );
    POST-UPDATE
    DEFAULT_VALUE('0', 'GLOBAL.update');
    :GLOBAL.update := TO_CHAR( TO_NUMBER( :GLOBAL.update ) + 1 );
    POST-DELETE
    DEFAULT_VALUE('0', 'GLOBAL.delete');
    :GLOBAL.delete := TO_CHAR( TO_NUMBER( :GLOBAL.delete ) + 1 );try it
    Gerd

  • In a FM 11 book, how can I display filename w/o file location?

    In a FrameMaker book, how can I display filename without the file's  location on the hard drive?
    For example, The book would list:
    "MyFile.fm"
    instead of
    C:\windows\documents\Framefiles\XYZ Company\widgets\draft_2013_1111\MyFile.fm
    If this cannot be done, then how can I get the book to list a name for the added file other than the name of the first heading in the file contents?

    Check out the little toggle icon beside the magnifying glass in the book tab – you can swap back and forth between “Display Heading Text” and “Display File Names”

  • How can we display the list of Report Names in Dashboard Prompt?

    How can we display the list of Report Names in Dashboard Prompt?

    Hi,
    No its not possible to display list of reports in dashboard prompts.
    Can do this using SQl results in prompt(we write query checking out report names manualy),but its not easy thing if you are having many report names to be displayed.
    Assign points and close your threads if answered.
    Refer : http://forums.oracle.com/forums/ann.jspa?annID=939
    Regards,
    Srikanth

  • How can we display

    Hello,
    How can we display numbers in this form like 01, 03 or 09 etc...using Math.random method or any other ways.
    thank u

    The-Sue,
    thanks for the reply. What i meant was like for example in this example:
    int)(99*Math.random())+1
    I want that numbers frm 1-9 be displayed as 01, 02, ...09, the rest normal,
    so basically instead showing lets say 6 it should display 06, but if number is 45 it should display like 45 and not 045
    I hope it is more clear now
    thanks

  • How can i display the days of the month in my report, please help

    dear all
    my table name is day_close_table
    it contains these columns:
    product_code number,
    the_date date,
    sale_qty number,
    buy_qty number
    price number
    i need to make report like the fiollowing
    product : 10144 from: 1-jan-2006 to :10-jan-2006
    days | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    Sale | 50| 10| 20| 15|10|5 | 6 | 11|12|6 |
    buy |10 | 20 | 10| 0 | 0 | 0 | 10| 1 | 1| 1|
    i created two query and i decieded to join them
    the first one is to display days in horizon direction
    my query is:
    SELECT TO_CHAR(THE_DATE,'DD-MONTH')D,
    FROM HS_DAY_CLOSE;
    my question is how can i display the records in horizone direction
    please help

    i solved this problem using this query
    SELECT STOCK_CODE, COUNTRY_ID,
    SUM(DECODE(to_char(the_date,'dd') ,'01', buy_qty)) "1",
    SUM(DECODE(to_char(the_date,'dd') , '02', buy_qty)) "2",
    SUM(DECODE(to_char(the_date,'dd') , '03', buy_qty)) "3",
    SUM(DECODE(to_char(the_date,'dd') , '04', buy_qty)) "4",
    SUM(DECODE(to_char(the_date,'dd') , '05', buy_qty)) "5",
    SUM(DECODE(to_char(the_date,'dd') , '06', buy_qty)) "6",
    SUM(DECODE(to_char(the_date,'dd') , '07', buy_qty)) "7",
    SUM(DECODE(to_char(the_date,'dd') , '08', buy_qty)) "8",
    SUM(DECODE(to_char(the_date,'dd') , '09', buy_qty)) "9",
    SUM(DECODE(to_char(the_date,'dd') , '10', buy_qty)) "10",
    SUM(DECODE(to_char(the_date,'dd') , '11', buy_qty)) "11",
    SUM(DECODE(to_char(the_date,'dd') , '12', buy_qty)) "12",
    SUM(DECODE(to_char(the_date,'dd') , '13', buy_qty)) "13",
    SUM(DECODE(to_char(the_date,'dd') , '14', buy_qty)) "14",
    SUM(DECODE(to_char(the_date,'dd') , '15', buy_qty)) "15",
    SUM(DECODE(to_char(the_date,'dd') , '16', buy_qty)) "16",
    SUM(DECODE(to_char(the_date,'dd') , '17', buy_qty)) "17",
    SUM(DECODE(to_char(the_date,'dd') , '18', buy_qty)) "18",
    SUM(DECODE(to_char(the_date,'dd') , '19', buy_qty)) "19",
    SUM(DECODE(to_char(the_date,'dd') , '20', buy_qty)) "20",
    SUM(DECODE(to_char(the_date,'dd') , '21', buy_qty)) "21",
    SUM(DECODE(to_char(the_date,'dd') , '22', buy_qty)) "22",
    SUM(DECODE(to_char(the_date,'dd') , '23', buy_qty)) "23",
    SUM(DECODE(to_char(the_date,'dd') , '24', buy_qty)) "24",
    SUM(DECODE(to_char(the_date,'dd') , '25', buy_qty)) "25",
    SUM(DECODE(to_char(the_date,'dd') , '26', buy_qty)) "26",
    SUM(DECODE(to_char(the_date,'dd') , '27', buy_qty)) "27",
    SUM(DECODE(to_char(the_date,'dd') , '28', buy_qty)) "28",
    SUM(DECODE(to_char(the_date,'dd') , '29', buy_qty)) "29",
    SUM(DECODE(to_char(the_date,'dd') , '30', buy_qty)) "30",
    SUM(DECODE(to_char(the_date,'dd') , '31', buy_qty)) "31"
    FROM HS_DAY_CLOSE
    GROUP BY STOCK_CODE,COUNTRY_ID

  • How can i display special character?

    how can i display special character that come from DB.
    for example i have in field in Table that has this value <Id, r>.
    i want to print this value to the html. and replace the <,> to special character.

    "<" is "<"
    ">" is ">"

  • How can I display the rows into columns.

    How can I display the rows into columns. I mean
    Create table STYLE_M
    (Master varchar2(10), child varchar2(10));
    Insert itno style_m
    ('MASTER1','CHILD1');
    Insert itno style_m
    ('MASTER2','CHILD1');
    Insert itno style_m
    ('MASTER2','CHILD2');
    Insert itno style_m
    ('MASTER3','CHILD1');
    Insert itno style_m
    ('MASTER3','CHILD2');
    Insert itno style_m
    ('MASTER3','CHILD3');
    Note : The Master may have any number of childs.
    I want to display like this..
    Master child1, child2, child3, .......(dynamic)
    MASTER1 CHILD1
    MASTER2 CHILD1 CHILD2
    MASTER3 CHILD1 CHILD2 CHILD3
    Sorry for disturbing you. Please hlp me out if you have any slution.
    Thanks alot.
    Ram Dontineni

    Here's a straight SQL "non-dynamic" approach.
    This would be used if you knew the amount of children.
    SELECT
         master,
         MAX(DECODE(r, 1, child, NULL)) || ' ' || MAX(DECODE(r, 2, child, NULL)) || ' ' || MAX(DECODE(r, 3, child, NULL)) children
    FROM
         SELECT
              master,
              child,
              ROW_NUMBER() OVER(PARTITION BY master ORDER BY child) r
         FROM
              style_m
    GROUP BY
         master
    MASTER     CHILDREN                        
    MASTER1    CHILD1                          
    MASTER2    CHILD1 CHILD2                   
    MASTER3    CHILD1 CHILD2 CHILD3             Since you said that the number of children can vary, I incorporated the same logic into a dynamic query.
    SET AUTOPRINT ON
    VAR x REFCURSOR
    DECLARE
            v_sql           VARCHAR2(1000) := 'SELECT master, ';
            v_group_by      VARCHAR2(200)  := 'FROM (SELECT master, child,  ROW_NUMBER() OVER(PARTITION BY master ORDER BY child) r FROM style_m) GROUP BY master';
            v_count         PLS_INTEGER;
    BEGIN
            SELECT
                    MAX(COUNT(*))
            INTO    v_count
            FROM
                    style_m
            GROUP BY
                    master;
            FOR i IN 1..v_count
            LOOP
                    v_sql := v_sql || 'MAX(DECODE(r, ' || i || ', child, NULL))' || ' || '' '' || ';
            END LOOP;
                    v_sql := RTRIM(v_sql, ' || '' '' ||') ||' children ' || v_group_by;
                    OPEN :x FOR v_sql;
    END;
    PL/SQL procedure successfully completed.
    MASTER     CHILDREN
    MASTER1    CHILD1
    MASTER2    CHILD1 CHILD2
    MASTER3    CHILD1 CHILD2 CHILD3I'll point your other thread to this one.

  • How can I display True/False in my dropdownlist as "Yes" and "No"?

    Hi All,
    I want to bind a dropdownlist to a boolean value (so it's either true or false).  I'm particularly interested in using two-way binding to when the user changes from "yes" to "no" the boolean value automatically changes from "true" to "false."  But, I want the user to see "yes" and "no" as the options, rather than "true" and "false".
    How can I display "yes" and "no" and still take advantage of binding?  Or can I not use binding in this circumstance?
      -Josh

    Solution 1:
    In order to display Yes/No for True/False, you may specify labelFunction for the dropdownList.
    In MXML:
    <s:DropDownList labelFunction="myLabelFunction" />
    In actionscript:
    private var arr:ArrayCollection = new ArrayCollection(["true","false"]);
                private function mylabelFunction(item:Object):String
                    if(item.toString() == "true")
                        return "yes";
                    else return "No";
    OR
    Solution2:
    may be u can try making an array collection like
    private var arr:ArrayCollection = new ArrayCollection([{label:"yes",value:"true"},{label:"no",value:"false"}]);
    and specify labelField for the dropdownList like
    <s:DropDownList labelField="label" dataProvider="{arr}" />

  • How can I display  contacts in a relationship

    I have companies in my CRM. I have a customers/contacts in the CRM I have tied as a relationship with each companies. How can I display all the records/contacts associated with a company? I have a already created a secure zone, so the company user would have logged in. Is this possible? If not, any workaround?
    The only workaround I thought of is to use webapp to import the company data and create another web app containing the employees data. Then link both tables/webapp using datasource. But the way the client's data is structured could create a lot of problems going forward.
    Any suggestion, help will be appreciated

    The relationship feature and how companies work currently in BC is really limited. It is an association and not true relationships at the moment. You cant output a company and show all its relationships at the moment.

Maybe you are looking for