Help with creating multiple events for a single button

I have a basic gui that is used to view a query. There is a JTextArea where the infromation from the query displays. Now i also have JTextAFields that correspond to each column from the table that i am querying from. I have an edit button that will take the current query (which i have a reference to) and put in each JTextField the correct information (it re exectutes the query given the id of the current result in the query, and sets the text in each field).
All this works fine.. Now the text fields have been filled in, and the user can change them accordingly. I set the text of the edit button to say update, and i add an action listener within the current listener for that button.. When the update button is pressed, everything is fine.. However, after that, the listener has changed and i get exceptions everytime i press edit.. Below i have made it so that i create a new action when the edit button (named update that after they press it, it then displays update.. and the insert button changes to insert.. now an insert query is different than an update so i can't just enable only insert or anything like that).
is there any way to have 1 button that can do different things depending on the context? I can't figure out how to do it..
here is what i have as far as listeners for my buttons
          ButtonHandler buttonHandler = new ButtonHandler();
         exit.addActionListener(buttonHandler);
         first.addActionListener(buttonHandler);
         prev.addActionListener(buttonHandler);
         next.addActionListener(buttonHandler);
         last.addActionListener(buttonHandler);
          insert.addActionListener(new insertButtonAction());
          delete.addActionListener(new deleteButtonAction());
          update.addActionListener(new editButtonAction());
          rollback.addActionListener(new rollbackButtonAction());
          commit.addActionListener(new commitButtonAction());
          sendQuery.addActionListener(new sendQueryButtonAction());
     class ButtonHandler implements ActionListener {  // this is a Controller class
       public void actionPerformed (ActionEvent e) {
          JButton b = (JButton)e.getSource();
          try {
             if (b==first) {
                if (result.first())
                   updateText();
             else if (b==prev) {
                if (result.previous())
                   updateText();
                else
                   prev.setEnabled(false);
             else if (b==next) {
                if (result.next())
                      updateText();
                else
                   next.setEnabled(false);
              else if (b==last) {
                 if (result.last())
                    updateText();
              else if (b==exit) {
                 db.close();
                 f.dispose();
                 System.exit(0);
           catch(SQLException ex) {
                 System.out.println("Could not perform operation()\n" +  ex.getMessage());
     private class insertButtonAction implements ActionListener {
          public void actionPerformed( ActionEvent e ) {
               feedback = insertEntry();     
     private class editButtonAction implements ActionListener {
          public void actionPerformed( ActionEvent e ) {
               try {
                    int ID = result.getInt(1);
                    update.setText("update");
                    insert.setText("cancel");
                    delete.setEnabled(false);
                    rollback.setEnabled(false);
                    sendQuery.setEnabled(false);
                    Statement qStatement = conn.createStatement();
                    String qs = "select EMPNO, ENAME, JOB, MGR, HIREDATE, " +
                         "     SAL, COMM, emp.DEPTNO " +
                       "from emp WHERE empno = " + ID;
                  ResultSet rs = qStatement.executeQuery(qs);
                    rs.next();               
                   enoField.setText(rs.getString(1));
                    enameField.setText(rs.getString(2));
                    jobField.setText(rs.getString(3));
                    mgrField.setText(rs.getString(4));
                    hdateField.setText(rs.getString(5));
                    salField.setText(rs.getString(6));
                    commField.setText(rs.getString(7));
                    dnoField.setText(rs.getString(8));
               } catch (SQLException ex) {
                   area.setText("Could not fetch row because of " + ex.getMessage());
               update.addActionListener(new updateButtonAction());
               insert.addActionListener(new cancelButtonAction());
               /*Although this compiles and works the first time, after i've
                it no longer works after that */
          class updateButtonAction implements ActionListener {
               public void actionPerformed( ActionEvent e ) {
                    feedback = updateQuery();
                    area.setText(feedback);
                    resetButtons();
                    clearFields();
                    update.setEnabled(false);
          class cancelButtonAction implements ActionListener {
               public void actionPerformed( ActionEvent e ) {
                    resetButtons();
                    area.setText("Operation Canceled");
                    clearFields();
                    update.removeActionListener(e);
     private class deleteButtonAction implements ActionListener {
          public void actionPerformed( ActionEvent e ) {
               try {
                    feedback = deleteEntry(result.getInt(1));
                    area.setText(feedback);
               } catch (SQLException ex) {
                  area.setText("Could not fetch row because of " + ex.getMessage());
     private class rollbackButtonAction implements ActionListener {
          public void actionPerformed( ActionEvent e ) {
               try {
                    Statement rstmt = conn.createStatement();
                    rstmt.executeQuery("rollback");
                    area.setText("Rollback Successfull.");
               } catch (SQLException ex) {
                    area.setText("Could not rollback.");
     private class commitButtonAction implements ActionListener {
          public void actionPerformed( ActionEvent e ) {
               try {
                    Statement rstmt = conn.createStatement();
                    rstmt.executeQuery("commit");
               } catch (SQLException ex) {
                    area.setText("Could not commit changes.");
     private class sendQueryButtonAction implements ActionListener {
          public void actionPerformed( ActionEvent e ) {
               query(db, selectQ);
    void resetButtons(){
         insert.setText("Insert");
         update.setText("Edit");
         delete.setEnabled(true);
         rollback.setEnabled(true);
         sendQuery.setEnabled(true);
   any suggested would be appreciated

App message delivery is not retried in B2B, rather failed messages are delivered to the IP_IN_QUEUE. Please enable the logging for B2B engine in TRACE 32 mode and run a test to reproduce the behaviour. Post the log here or mail across to my id (in my profile).
Regards,
Anuj

Similar Messages

  • How to create Multiple Address for a single customer

    Respected Members,
    In tcode Xd01 we create on customer but there we can maintain only one address but sometimes a scenario can be that single customer can have different address .
    How to do that.Any exit is available to create multiple address with creation of single customer.
    This provision is given while creating a Business Partner.Tcode is BP .In this Address Overview tab is there and you maintain multiple address to single Busines partner.
    Same thing can we do for the customer.
    Any solutions or suggestions,please give me your support.
    Thanks

    Hello Manish,
    Unfortunately Customers have only one address. However you can use contact persons to store different addresses, or (in the Sales view) you can assign other partner functions with different addresses (e.g. one customer acting as the Sold-to partner may have different Ship-to partners).
    If these options do not meet your requirements, you could extend the customer master data with your own functionality and enhance transaction XD01 with your own screens for holding alternate addresses.
    Regards,
    John.

  • Need help with turning multiple rows into a single row

    Hello.
    I've come across a situation that is somewhat beyond my knowledge base. I could use a little help with figuring this out.
    My situation:
    I am attempting to do some reporting from a JIRA database. What I am doing is getting the dates and times for specific step points of a ticket. This is resulting in many rows per ticket. What I need to do is return one row per ticket with a calculation of time between each step. But one issue is that if a ticket is re-opened, I want to ignore all data beyond the first close date. Also, not all tickets are in a closed state. I am attaching code and a sample list of the results. If I am not quite clear, please ask for information and I will attempt to provide more. The database is 10.2.0.4
    select jiraissue.id, pkey, reporter, summary
    ,changegroup.created change_dt
    ,dbms_lob.substr(changeitem.newstring,15,1) change_type
    ,row_number() OVER ( PARTITION BY jiraissue.id ORDER BY changegroup.created ASC ) AS order_row
    from jiraissue
    ,changeitem, changegroup
    ,(select * from customfieldvalue where customfield = 10591 and stringvalue = 'Support') phaseinfo
    where jiraissue.project = 10110
    and jiraissue.issuetype = 51
    and dbms_lob.substr(changeitem.newstring,15,1) in ('Blocked','Closed','Testing','Open')
    and phaseinfo.issue = jiraissue.id
    and changeitem.groupid = changegroup.id
    and changegroup.issueid = jiraissue.id
    order by jiraissue.id,change_dt
    Results:
    1     21191     QCS-91     Error running the Earliest-deadlines flight interface request/response message     2008-07-16 9:30:38 AM     Open     1
    2     21191     QCS-91     Error running the Earliest-deadlines flight interface request/response message     2008-07-16 11:37:02 AM     Testing     2
    3     21191     QCS-91     Error running the Earliest-deadlines flight interface request/response message     2010-06-08 9:14:52 AM     Closed     3
    4     21191     QCS-91     Error running the Earliest-deadlines flight interface request/response message     2010-09-02 11:29:37 AM     Open     4
    5     21191     QCS-91     Error running the Earliest-deadlines flight interface request/response message     2010-09-02 11:29:42 AM     Open     5
    6     21191     QCS-91     Error running the Earliest-deadlines flight interface request/response message     2010-09-02 11:29:50 AM     Testing     6
    7     21191     QCS-91     Error running the Earliest-deadlines flight interface request/response message     2010-09-02 11:29:53 AM     Closed     7
    8     23234     QCS-208     System Baseline - OK button does not show up in the Defer Faults page for the System Engineer role      2008-10-03 10:26:21 AM     Open     1
    9     23234     QCS-208     System Baseline - OK button does not show up in the Defer Faults page for the System Engineer role      2008-11-17 9:39:39 AM     Testing     2
    10     23234     QCS-208     System Baseline - OK button does not show up in the Defer Faults page for the System Engineer role      2011-02-02 6:18:02 AM     Closed     3
    11     23977     QCS-311     Tally Sheet - Reason Not Done fails to provide reason for unassigned tasks     2008-09-29 2:44:54 PM     Open     1
    12     23977     QCS-311     Tally Sheet - Reason Not Done fails to provide reason for unassigned tasks     2010-05-29 4:47:37 PM     Blocked     2
    13     23977     QCS-311     Tally Sheet - Reason Not Done fails to provide reason for unassigned tasks     2011-02-02 6:14:57 AM     Open     3
    14     23977     QCS-311     Tally Sheet - Reason Not Done fails to provide reason for unassigned tasks     2011-02-02 6:15:32 AM     Testing     4
    15     23977     QCS-311     Tally Sheet - Reason Not Done fails to provide reason for unassigned tasks     2011-02-02 6:15:47 AM     Closed     5

    Hi,
    Welcome to the forum!
    StblJmpr wrote:
    ... I am attempting to do some reporting from a JIRA database. What is a JIRA database?
    I am attaching code and a sample list of the results. If I am not quite clear, please ask for information and I will attempt to provide more. Whenever you have a question, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and the results you want from that data.
    Simplify the problem as much as possible. For example, if the part you don't know how to do only involves 2 tables, then jsut post a question involving those 2 tables. So you might just post this much data:
    CREATE TABLE     changegroup
    (      issueid          NUMBER
    ,      created          DATE
    ,      id          NUMBER
    INSERT INTO changegroup (issueid, created, id) VALUES (21191,  TO_DATE ('2008-07-16 09:30:38 AM', 'YYYY-MM-DD HH:MI:SS AM'),  10);
    INSERT INTO changegroup (issueid, created, id) VALUES (21191,  TO_DATE ('2008-07-16 11:37:02 AM', 'YYYY-MM-DD HH:MI:SS AM'),  20);
    INSERT INTO changegroup (issueid, created, id) VALUES (21191,  TO_DATE ('2010-06-08 09:14:52 AM', 'YYYY-MM-DD HH:MI:SS AM'),  90);
    INSERT INTO changegroup (issueid, created, id) VALUES (21191,  TO_DATE ('2010-09-02 11:29:37 AM', 'YYYY-MM-DD HH:MI:SS AM'),  10);
    INSERT INTO changegroup (issueid, created, id) VALUES (21191,  TO_DATE ('2010-09-02 11:29:42 AM', 'YYYY-MM-DD HH:MI:SS AM'),  10);
    INSERT INTO changegroup (issueid, created, id) VALUES (21191,  TO_DATE ('2010-09-02 11:29:50 AM', 'YYYY-MM-DD HH:MI:SS AM'),  20);
    INSERT INTO changegroup (issueid, created, id) VALUES (21191,  TO_DATE ('2010-09-02 11:29:53 AM', 'YYYY-MM-DD HH:MI:SS AM'),  90);
    INSERT INTO changegroup (issueid, created, id) VALUES (23234,  TO_DATE ('2008-10-03 10:26:21 AM', 'YYYY-MM-DD HH:MI:SS AM'),  10);
    INSERT INTO changegroup (issueid, created, id) VALUES (23234,  TO_DATE ('2008-11-17 09:39:39 AM', 'YYYY-MM-DD HH:MI:SS AM'),  20);
    INSERT INTO changegroup (issueid, created, id) VALUES (23234,  TO_DATE ('2011-02-02 06:18:02 AM', 'YYYY-MM-DD HH:MI:SS AM'),  90);
    INSERT INTO changegroup (issueid, created, id) VALUES (23977,  TO_DATE ('2008-09-29 02:44:54 PM', 'YYYY-MM-DD HH:MI:SS AM'),  10);
    INSERT INTO changegroup (issueid, created, id) VALUES (23977,  TO_DATE ('2010-05-29 04:47:37 PM', 'YYYY-MM-DD HH:MI:SS AM'),  30);
    INSERT INTO changegroup (issueid, created, id) VALUES (23977,  TO_DATE ('2011-02-02 06:14:57 AM', 'YYYY-MM-DD HH:MI:SS AM'),  10);
    INSERT INTO changegroup (issueid, created, id) VALUES (23977,  TO_DATE ('2011-02-02 06:15:32 AM', 'YYYY-MM-DD HH:MI:SS AM'),  20);
    INSERT INTO changegroup (issueid, created, id) VALUES (23977,  TO_DATE ('2011-02-02 06:15:47 AM', 'YYYY-MM-DD HH:MI:SS AM'),  90);
    CREATE TABLE     changeitem
    (      groupid          NUMBER
    ,      newstring     VARCHAR2 (10)
    INSERT INTO changeitem (groupid, newstring) VALUES (10, 'Open');
    INSERT INTO changeitem (groupid, newstring) VALUES (20, 'Testing');
    INSERT INTO changeitem (groupid, newstring) VALUES (30, 'Blocked');
    INSERT INTO changeitem (groupid, newstring) VALUES (90, 'Closed');Then post the results you want to get from that data, like this:
    ISSUEID HISTORY
      21191 Open (0) >> Testing (692) >> Closed
      23234 Open (45) >> Testing (807) >> Closed
      23977 Open (607) >> Blocked (249) >> Open (0) >> Testing (0) >> ClosedExplain how you get those results from that data. For example:
    "The output contains one row per issueid. The HISTORY coloumn shows the different states that the issue went through, in order by created, starting with the earliest one and continuing up until the first 'Closed' state, if there is one. Take the first row, issueid=21191, for example. It started as 'Open' on July 16, 2008, then, on the same day (that is, 0 days later) changed to 'Testing', and then, on June 8, 2010, (692 days later), it became 'Closed'. That same issue opened again later, on September 2, 2010, but I don't want to see any activity after the first 'Closed'."
    The database is 10.2.0.4That's very important. Always post your version, like you did.
    Here's one way to get those results from that data:
    WITH     got_order_row     AS
         SELECT     cg.issueid
         ,     LEAD (cg.created) OVER ( PARTITION BY  cg.issueid
                                          ORDER BY      cg.created
                  - cg.created            AS days_in_stage
         ,       ROW_NUMBER ()     OVER ( PARTITION BY  cg.issueid
                                          ORDER BY      cg.created
                               )    AS order_row
         ,     ci.newstring                     AS change_type
         FROM    changegroup     cg
         JOIN     changeitem     ci  ON   cg.id     = ci.groupid
         WHERE     ci.newstring     IN ( 'Blocked'
                           , 'Closed'
                           , 'Testing'
                           , 'Open'
    --     AND     ...          -- any other filtering goes here
    SELECT       issueid
    ,       SUBSTR ( SYS_CONNECT_BY_PATH ( change_type || CASE
                                                             WHEN  CONNECT_BY_ISLEAF = 0
                                           THEN  ' ('
                                              || ROUND (days_in_stage)
                                              || ')'
                                                         END
                                    , ' >> '
               , 5
               )     AS history
    FROM       got_order_row
    WHERE       CONNECT_BY_ISLEAF     = 1
    START WITH     order_row          = 1
    CONNECT BY     order_row          = PRIOR order_row + 1
         AND     issueid               = PRIOR issueid
         AND     PRIOR change_type     != 'Closed'
    ORDER BY  issueid
    ;Combining data from several rows into one big delimited VARCHAR2 column on one row is call String Aggregation .
    I hope this answers your question, but I guessed at so many things, I won't be surprised if it doesn't. If that's the case, point out where this is wrong, post what the results should be in those places, and explain how you get those results. Post new data, if necessary.

  • Creating multiple instances for a single file in B2B

    Hi,
    I have a requirement to read the camt.053 file from the remote partner using Oracle B2B and send the file to oracle AIA and insert the data in the ERP database tables. I am able to read the file successfully through B2B using listening channel and send the data to AIA and insert the data in ERP tables but, if there is any error occured while inserting the data in the ERP tables it is creating multiple instances(6 message count) for the same file in B2B reports. where as it is creating only one entry in reports in case of successful insertion. I have not given any retry count in listening channel nor in the database adapter in SOA/AIA composite. I am confused from where B2B is retrying the message ? Do i need to set any system properties? Could you please guide me to resolve this issue?
    Regards,
    Nishanth.

    App message delivery is not retried in B2B, rather failed messages are delivered to the IP_IN_QUEUE. Please enable the logging for B2B engine in TRACE 32 mode and run a test to reproduce the behaviour. Post the log here or mail across to my id (in my profile).
    Regards,
    Anuj

  • Need help with creating a formula for percentages

    I am creating a fillable form for subcontractors to submit change requests. One of the sections on the form is for materials. Most subs will charge a markup which is a small percentage of the actual cost. Obviously, both amounts are variables. I want the subs to be able to enter the material cost in field 1, the markup percentage in field two, and then have field three calculate the dollar amount for them. Is this possible? Btw, I'm clueless on this, it's my first attempt at an adobe form. Thanks!!!

    A more standard way is to use something like the following as the third field's custom Calculate script:
    // Custom calculate script
    (function () {
        // Get the field values, as numbers
        var v1 = +getField("price").value;
        var v2 = +getField("markup_percentage").value;
        // Calculate the value of this field
        event.value = v1 * (1 + v2 / 100);
    This is assuming that a percentage of 20% is entered by the user as 20, as opposed to 0.2 or something else. Change the field values to match the actual fields in your form.
    If the markup field is blank or zero, the total will simply be the same as the price value.

  • SQL Help with change multiple columns into a single column

    I am wanting to create either a new View or a new Table based on the following original table:
    Original Table:
    Fiscal Year
    Account
    Budget_Amt_January
    Budget_Amt_February
    Budget_Amt_March
    Budget_Amt_April
    <etc. for each of the 12 months)
    I want the new View or Table to instead be:
    New:
    Fiscal_Year
    Month
    Account
    Budget_Amount
    I can't simply drop the original table, it will have to always exist since it is part of the Finance package, but for ease of reporting against I am wanting to create this new View.
    Any ideas on how to go about this?
    Thanks!

    I had to do something very similar just this week - in my case a record read from a csv into a table, then needs loading into a destination table, and the rows are columns in the csv. I went for INSERT ALL as I also had some conditions.
      INSERT ALL
        WHEN low1 != -998 OR high1 != -998 THEN
        INTO partial_profile_temp (search_id, locus_id, low_allele, high_allele)
        VALUES ( search_id, 1, low1, high1 )
        WHEN low2 != -998 OR high2 != -998 THEN
        INTO partial_profile_temp (search_id, locus_id, low_allele, high_allele)
        VALUES ( search_id, 2, low2, high2 )
        WHEN low5 != -998 OR high5 != -998 THEN
        INTO partial_profile_temp (search_id, locus_id, low_allele, high_allele)
        VALUES ( search_id, 5, low5, high5 )
        WHEN low6 != -998 OR high6 != -998 THEN
        INTO partial_profile_temp (search_id, locus_id, low_allele, high_allele)
        VALUES ( search_id, 6, low6, high6 )
        WHEN low7 != -998 OR high7 != -998 THEN
        INTO partial_profile_temp (search_id, locus_id, low_allele, high_allele)
        VALUES ( search_id, 7, low7, high7 )
        WHEN low8 != -998 OR high8 != -998 THEN
        INTO partial_profile_temp (search_id, locus_id, low_allele, high_allele)
        VALUES ( search_id, 8, low8, high8 )
        WHEN low9 != -998 OR high9 != -998 THEN
        INTO partial_profile_temp (search_id, locus_id, low_allele, high_allele)
        VALUES ( search_id, 9, low9, high9 )
        WHEN low10 != -998 OR high10 != -998 THEN
        INTO partial_profile_temp (search_id, locus_id, low_allele, high_allele)
        VALUES ( search_id, 10, low10, high10 )
        WHEN low11 != -998 OR high11 != -998 THEN
        INTO partial_profile_temp (search_id, locus_id, low_allele, high_allele)
        VALUES ( search_id, 11, low11, high11 )
        WHEN low12 != -998 OR high12 != -998 THEN
        INTO partial_profile_temp (search_id, locus_id, low_allele, high_allele)
        VALUES ( search_id, 12, low12, high12 )
        WHEN low13 != -998 OR high13 != -998 THEN
        INTO partial_profile_temp (search_id, locus_id, low_allele, high_allele)
        VALUES ( search_id, 13, low13, high13 )
        SELECT * FROM bulk_search_load bst, partial_details_temp pdt
        WHERE id = case_number -- only retrieves details for those records that are found in bulk_search_load
        AND filename like 'NETH\_%' escape '\'
        AND processed = 'N'; 

  • Is creating multiple FileInputStream for one file OK?

    Are there any issue with creating multiple FileInputStream for a single file? I have code that reads from a same file in multiple threads. Presumably, it should be ok since the file is being opened as read-only with FileInputStream. I have not seen any problem with it, but I want to be sure that there are no issues with doing this.
    Jae

    i think that is no problem,becase when you complete creating a FileInputStream,
    the FileInputStream is autocephaly and have't relation with File,but Class File is differ in this ,if you create much new File() from one file ,System will report a err.

  • I want to create a mail merge for address labels into a table, but when I fill a table with merge fields, it ends up creating multiple entries for the same address, rather than one table full of each address.

    ...but when I fill a table with merge fields, it ends up creating multiple entries for the same address, rather than one table full of each address. Please help.
    Thanks!

    That is a quirk of Pagesthat  it applies only one record per page.
    There is a way around this:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=245&highlight=labels &mforum=iworktipsntrick
    Peter

  • Syncing ical creates multiple entries for same event

    I'm sure this is common. I cal sync creates multiple enties for the same event. Any way to work around this?
    Also, duplicate calendars are on the Iphone (2 for inbox)  can one be deleted? 

    I think I know what can help. I also support Mac users in a mixed environment, and find that being able to access a Windows machine to test settings for my iCal users is very very helpful. If you do not have one, I could also fix this one by adding the user's account to my one Mac that runs Entourage.
    On a PC: set up one of the problem accounts in Outlook, then go to Tools->Options & click on the Delegates tab. Click on a Delegate name (if they all have the same permission level, you can select all), then click the Permissions button. If the delegate have "Editor" permissions, there will be a little checked box that sends the delegate copies of all those meetings. De-select it.
    Lemme know if you want Entourage instructions or if that does it for you.
    The real question, of course, is why are there so many Exchange functions that iCal can't touch. Grrrr....

  • Why do we create multiple aliases to a single table?

    <h4>{color:#0000ff}Hi,{color}</h4>
    <h4></h4>
    <h4></h4>
    <h4>{color:#0000ff} Why do we create multiple aliases to a single table in the same query?{color}</h4>
    <h4></h4>
    <h4></h4>
    <h4>{color:#0000ff}{color:#000000}For Ex: {color}{color}</h4>
    <h4>
    {color:#000000}select name,address,phone, from emp e, emp e1{color}</h4>
    <h4></h4>
    <h4>{color:#000000}where e.empid = e1.empid;{color}</h4>
    <h4>
    {color:#0000ff}ofcourse the above query's where condition is not correct, but i am giving as an example only{color}</h4>
    <h4>{color:#0000ff}I have seen similar kind of queries where a single table name is aliased 10 times in the same query{color}</h4>
    <h4>{color:#0000ff}can someone help me to understand the logic behind it?{color}</h4>
    <h4>{color:#0000ff}Thanks in advance{color}</h4>
    <h4>{color:#0000ff}greddy.{color}</h4>
    Edited by: greddy on Oct 24, 2008 2:46 AM

    Hi,
    When you say
    FROM    emp  e
    ,       emp  e1you are using two copies of the same table.
    Can you imagine using two copies of the same book at the same time?
    Say you see a word (like "hyrax") that you don't know. You might look up that word in the dictionary.
    The English sentence "Open the dictionary to the page containing the new word." is like this SQL query:
    FROM    dictionary
    WHERE   :unknown_word  BETWEEN low_guide_word and high_guide_wordWhat if you saw that word while reading a book (let's call it book_a).
    You might want to leave book_a open, and place the dictionary beside book_a, so you can easily compare how the word is used in book_a with the definition in the dictionary.
    This corresponds to joining two tables in SQL:
    FROM    book_a     
    JOIN    dictionary  ON unknown_word BETWEEN low_guide_word AND high_guide_word
    WHERE   book_a.page  = whatever  -- NOTE: both tables have a column called pageor you can use aliases for one or both of the tables
    FROM    book_a      a
    JOIN    dictionary  d  ON a.unknown_word BETWEEN d.low_guide_word AND d.high_guide_word
    WHERE   a.page  = whatever  -- NOTE: both tables have a column called pageNow, imagine that book_a is itself the dictionary. Say you saw the word "hyrax" while you were looking up another word, "ibex".
    You can do a side-by-side comparison, as above, if you have two copies of the dictionary. Leave one copy open to "ibex", and open the other copy to "hyrax".
    This corresponds to a self-join in SQL:
    FROM    dictionary  a
    JOIN    dictionary  d  ON a.unknown_word BETWEEN d.low_guide_word AND d.high_guide_word
    WHERE   a.page  = whatever  -- NOTE: both tables have a column called pageNotice that this last bit of code is identical to the previous one, except that book_a is replaced with dictionary.
    In this case, you must you a table alias, at least for one copy. It wouldn't make any sense to say "Leave the dictionary open to "ibex" and open the dictionary to "hyrax". You have to have some unique way of referring to each copy, such as "Leave the dictionary on my left open to "ibex" and open the dictionary on my right to "hyrax"."

  • How can i add multiple validations for a single input box in adf?

    hi,
    i want to add multiple validation for a single input text control in adf like number validation and its existence in database.
    MY JDEV VERSION IS 11.1.1.5.0
    pls help !!!!

    Hi,
    1.I want to validate if the value entered is pure integer
    Option 1-
    select the component and in the Property Inspector, in the "Core" category select a "Converter" format, select javax.faces.Number, if the user put a string, adf show a dialog error or message error...
    Option 2-
    or use the Regular expression:-
    http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_validateRegExp.html
    https://blogs.oracle.com/shay/entry/regular_expression_validation
    Also check this:-
    http://docs.oracle.com/cd/E15523_01/web.1111/b31973/af_validate.htm#BABHAHEI
    Option 3-
    Frank in his great book 'Oracle Fusion Developer Guide' shows a example using a javascript for input which is allowed only for numbers. You can manipulate for your requirement.
    Here is the code:
    function filterForNumbers(evt) {
        //get ADF Faces event source, InputText.js
        var inputField = evt.getSource();
        var oldValue = inputField.getValue();
        var ignoredControlKeys = new Array(AdfKeyStroke.BACKSPACE_KEY, AdfKeyStroke.TAB_KEY, AdfKeyStroke.ARROWLEFT_KEY, AdfKeyStroke.ARROWRIGHT_KEY, AdfKeyStroke.ESC_KEY, AdfKeyStroke.ENTER_KEY, AdfKeyStroke.DELETE_KEY);
        //define the key range to exclude from field input
        var minNumberKeyCode = 48;
        var maxNumberKeyCode = 57;
        var minNumberPadKeyCode = 96;
        var maxNumberPadKeyCode = 105;
        //key pressed by the user
        var keyCodePressed = evt.getKeyCode();
        //if it is a control key, don't suppress it
        var ignoreKey = false;
        for (keyPos in ignoredControlKeys) {
            if (keyCodePressed == ignoredControlKeys[keyPos]) {
                ignoreKey = true;
                break;
        //return if key should be ignored
        if (ignoreKey == true) {
            return true;
        //filter keyboard input
        if (keyCodePressed < minNumberKeyCode || keyCodePressed > maxNumberPadKeyCode) {
            //set value back to previous value
            inputField.setValue(oldValue);
            //no need for the event to propagate to the server, so cancel
            //it
            evt.cancel();
            return true;
        if (keyCodePressed > maxNumberKeyCode && keyCodePressed < minNumberPadKeyCode) {
            //set value back to previous value
            inputField.setValue(oldValue);
            evt.cancel();
            return true;
    2.I want to check if the value exists in my respective DB You must be having EO or VO if you want to validate with database in that case use the solution suggested by Timo.
    Thanks
    --NavinK                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Any way to pass Multiple Values for a single Label in the Parameter?

    I have a Report that Contains 2 Parameters, @Customer & @Area. When trying to set up the Available Values for @Area, I'm having issues using multiple values for one Label, i.e. = "4006" Or "4610"
    One of the Filters in the Report is an Operation number, which is the [OPERATION] field, which is setup as a filter on the Tablix referencing the @Area parameter. 
    PROBLEM: I cannot retrieve any data when trying to use the ‘Or’ Operator here. If I simply put “4006” or “4610” I retrieve data, but when trying to combine it returns no data.
    Example, I need to allow a user to select ‘Chassis Incoming’, which would include data from Operations 4006 & 4610.
    QUESTION:
    Any way to pass Multiple Values for a single Label in the Parameter?
    I realize the typical solution may be to use ‘Multi-Value’ selection, but in this case we want the User to select the Area and the multiple values for Filtering will be automatically determined for them. Otherwise, they are subject to not getting
    it correct.
    I have tried several different ways, such as =”4006” Or “4610”, =(“4006”, “4610”), = In(“4006”, “4610”), etc….
    Note: We are using Report Builder 3.0

    Based on my experience, there's no way to 'intercept' the query that gets passed back to SQL Server, so a Split wouldn't work.
    Try creating either a function or stored procedure using the code below (compliments to
    http://www.dotnetspider.com/resources/4680-Parse-comma-separated-string-SQL.aspx) to parse the string: 
    CREATE FUNCTION dbo.Parse(@Array VARCHAR(1000), @Separator VARCHAR(10))
    RETURNS @ResultTable TABLE (ParseValue VARCHAR(100))AS
    BEGIN
    DECLARE @SeparatorPosition INT
    DECLARE @ArrayValue VARCHAR(1000)
    SET @Array = @Array + @Separator
    WHILE PATINDEX('%' + @Separator + '%' , @Array) <> 0
    BEGIN
    SELECT @SeparatorPosition = PATINDEX('%' + @Separator + '%', @Array)
    SELECT @ArrayValue = LEFT(@Array, @SeparatorPosition - 1)
    INSERT @ResultTable VALUES (CAST(@ArrayValue AS VARCHAR))
    SELECT @Array = STUFF(@Array, 1, @SeparatorPosition, '')
    END
    RETURN
    END
    Once created you can do things like this:
    SELECT * FROM Parse('John,Bill,David,Thomas', ',')
    SELECT * FROM (SELECT 'John' AS TestName union select 'David' AS TestName) AS Main
    WHERE TestName IN (SELECT ParseValue FROM dbo.Parse('John,Bill,David,Thomas', ','))
    This is what your SQL query would probably look like:
    SELECT OperationID, OperationName FROM dbo.Operations
    WHERE AreaID IN (SELECT ParseValue FROM dbo.Parse(@Area, ','))
    You may need to fiddle around with the Separator depending on whether SQL Server inserts a space between the comma and next value.

  • How to show multiple messages for a single exception

    hi
    Please consider this example application created using JDeveloper 11.1.1.3.0
    at http://www.consideringred.com/files/oracle/2010/MultipleMessagesExceptionApp-v0.01.zip
    It has a class extending DCErrorHandlerImpl configured as ErrorHandlerClass in DataBindings.cpx .
    Running the page and entering a value starting with "err" will result in an exception being thrown and multiple messages shown.
    See the screencast at http://screencast.com/t/zOmEOzP4jmQ
    To get multiple messages for a single exception the MyDCErrorHandler class is implemented like
    public class MyDCErrorHandler
      extends DCErrorHandlerImpl
      public MyDCErrorHandler()
        super(true);
      @Override
      public void reportException(DCBindingContainer pDCBindingContainer,
        Exception pException)
        if (pException instanceof JboException)
          Throwable vCause = pException.getCause();
          if (vCause instanceof MyMultiMessageException)
            reportMyMultiMessageException(pDCBindingContainer,
              (MyMultiMessageException)vCause);
            return;
        super.reportException(pDCBindingContainer, pException);
      public void reportMyMultiMessageException(DCBindingContainer pDCBindingContainer,
        MyMultiMessageException pException)
        String vMessage = pException.getMessage();
        reportException(pDCBindingContainer, new Exception(vMessage));
        List<String> vMessages = pException.getMessages();
        for (String vOneMessage : vMessages)
          reportException(pDCBindingContainer, new Exception(vOneMessage));
    }I wonder if calling reportException() multiple times is really the way to go here?
    question:
    - (q1) What would be the preferred use of the DCErrorHandlerImpl API to show multiple messages for a single exception?
    many thanks
    Jan Vervecken

    fyi
    Looks like using MultipleMessagesExceptionApp-v0.01.zip in JDeveloper 11.1.1.2.0 (11.1.1.2.36.55.36) results in a different behaviour compared to when used in JDeveloper 11.1.1.3.0 (11.1.1.3.37.56.60)
    see http://www.consideringred.com/files/oracle/img/2010/MultipleMessages-111130versus111120.png
    When using JDeveloper 11.1.1.2.0 each exception seems to result in two messages where there is only one message (as intended/expected) per exception when using JDeveloper 11.1.1.3.0 .
    (Could be somehow related to the question in forum thread "multiple callbacks to DCErrorHandlerImpl".)
    But, question (q1) remains and is still about JDeveloper 11.1.1.3.0 .
    regards
    Jan

  • What is the best way to create the layout for a single page website in Adobe Muse?

    I was wondering the best way to create the layout for a single page website in Adobe Muse. Does anyone have any suggestions?

    I know how to create a website but will that help me create a single page website? Below I will leave a demo of what I want. I want it to only have one page but multiple sections. What is the easiest way to create a single page website like the demo below?
    Demo Website

  • I think I need help with driver (software) settings for D110a

    I think I need help with driver (software) settings for D110a all-in-one
    Product: D110a all-in-one
    OS: Windows XP Professional
    Error messages: None
    Changes before problem appeared: None--new installation
    The quality of photo images (mostly JPG files) in printouts is awful even though the files display beautifully on the PC screen. I am using
    IrfanView software for displaying/printing. As far as I can tell, IrfanView is not the problem.
    When I print the same images on a Deskjet 5150 attached to a different PC also running XP Pro and IrfanView, the quality of the printouts is at
    least acceptable, Some would probably say good or very good.
    It's dificult to explain in words the problem with the printouts. A picture of really pretty vegetables (squashes, tomatoes, watermelon, etc) comes
    out much too red. Moreover, the red, which appears shaded on the screen, seems to be all one shade in the D110a printouts.
    Something similar happens to a view of a huge tree in full leaf. On screen, there are subtle variations in the "greenness" of the leaves. In the
    printout, all green is the same shade. In the same printout, the trunk of the tree is all a single shade of grey. It isn;t even obvious that the
    trunk is a round, solid object.
    I liken the effect to audio that disappears entirely when you lower the volume and gets clipped into square waves in even moderately loud passages.
    I don't know whether the D110a driver software permits adjusting the parameters that appear to be set incorrectly, and if adjustments are possible,
    how I would identify which parameters to adjust, how I would access them, or how I would adjust them. I'm hoping that someone can help. Thanks.
    I forgot to mention that I have used the diagnostic application and it tells me that there are no problems.
    e-mail me at [email protected]

    brazzmonkey wrote:
    Hi everyone,
    I noticed the following message when network starts on my gateway
    Warning: This functionality is deprecated.
    Please refer to /etc/rc.conf on how to define a single wired
    connection, or use a utility such as netcfg.
    Then I realized the way network settings should be written in rc.conf has changed. But I can't figure out how this should be done.
    Currently, my set up is the following (old way):
    INTERFACES=(eth0 eth1)
    eth0="dhcp"
    eth1="eth1 192.168.0.10 netmask 255.255.255.0 broadcast 192.168.0.255"
    ROUTES=(!gateway)
    eth0 is on DHCP because the IP is dynamically assigned my ISP.
    eth1 has a fix IP because it's on the LAN side.
    No problem to use DHCP on eth0 with the new settings.
    But for eth1, I don't know what I am supposed to write for gateway.
    Wiki isn't clear on that one either, and it looks like many articles still refer to the old way.
    Any guidance appreciated, thanks.
    brazzmonkey,
    you can't define 2 interfaces the old way (even though I saw some tricky workaround somewhere in the forums).
    Use, f.e., netcfg:
    Comment your old lines.
    In /etc/rc.conf insert:
    NETWORKS=(Eth0-dhcp Eth1-static)
    DAEMONS=(..... !network @net-profiles ....)
    In /etc/network.d create 2 files:
    First one is named  Eth0-dhcp.
    Contents:
    CONNECTION="ethernet"
    DESCRIPTION="Whatever text"
    INTERFACE=eth0
    HOSTNAME="your hostname"
    IP="dhcp"
    DHCP_TIMEOUT=15
    Second one is named Eth1-static.
    Contents:
    CONNECTION='ethernet'
    DESCRIPTION='whatver'
    INTERFACE='eth1'
    HOSTNAME='hname'
    IP='static'
    ADDR='192.168.0.10'
    GATEWAY='192.168.0.1' # your gateway IP
    DNS=('192.168.0.1') # your DNS server
    The names Eth0-dhcp and Eth1-static are not magic. They just must be the same in rc.conf and in /etc/network.d.
    Hope it helps.
    mektub
    PS: netcfg must be installed.
    Last edited by Mektub (2011-07-20 14:07:05)

Maybe you are looking for