How to realize WHEN-RADIO-CHANGED- Trigger in ADF

Hy@ all,
I try to redevelop the Summit Forms Demo in ADF.
One of the existing modules is called "ORDER" and contains, among other things, radio buttons based on a database column(VARCHAR2) named PAYMENT_TYPE which contains the values CASH and CREDIT.
Based on this Item a WHEN-RADIO-CHANGED- Trigger is called which shows an alert and reset the changes to a default value when the payment type is changed but the credit rating(database column from another table) is not equal to an according value.
The code of the trigger is the following one:
DECLARE
     n NUMBER;
     v_credit S_CUSTOMER.CREDIT_RATING%TYPE;
BEGIN
     IF :S_ORD.payment_type = 'CREDIT' THEN
          SELECT credit_rating
          INTO v_credit
          FROM S_CUSTOMER
          WHERE :S_ORD.CUSTOMER_ID = ID;
     IF v_credit NOT IN ('GOOD', 'EXCELLENT') THEN
          :S_ORD.payment_type := 'CASH';
          n := SHOW_ALERT('PAYMENT_TYPE_ALERT');
     END IF;
     END IF;
END;
Now my questions are where to place the equivalent code(EO, VO, etc.?) and how to realize this.
Further, is it possible to roll out the trigger code to the database and then call this stored unit from "the right place"?
I´m using JDeveloper v10.1.3.1.0 and I´m pleased about any reply or solution.
Best regards
Chris

The answer will depend on how you are storing the parameter in your ADF application and when do you actually need it to be set and based on what.
This can be for example a property of a managed bean in your JSF application and you can initialize it either in the bean itself or in the faces-config.xml file as a managed property.
http://www.oracle.com/technology/tech/java/newsletter/articles/jsf_pojo/index.html

Similar Messages

  • Cannot have execute_query in post-change but can have it when-radio-changed

    why is it possible to put execute_query in a when-radio-changed trigger but one cannot put it in
    a post-change or post-text-item trigger? (11.1.1.4)
    For example I want to ask for a year, and a month. I don't much feel like creating radio items for all those years. Whenever a year
    or a month is changed I want it to reconstruct the where clause and execute the query. But the year not being a radio group
    is more problematic about how to get execute_query to run. What is thinking here? I think that a text item post-change deserves as much power as a radio_group change! It's unfair.

    Over the years, I have found that the people that complain about Oracle Forms the most are the people that refuse to learn how Oracle Forms works. You can't expect to develop in a any framework unless you learn the rules of the framework. I've seen numerous complaints about the lack of documentation on Forms and yet the single most important form of documentation is the Oracle Forms Help system. The answer to virtually every question you might have can be found in the Forms help system, but it helps to understand a little about how Forms functions so you can ask the right questions in the help system.
    I also find it hard to understand how an employer will throw someone, with little or no exposure to Oracle Forms, into a Forms project and expect them to "Pick it up" along the way rather than take the time and expense to send them to an Oracle Forms class. How can the employer expect the employee to be successful if they are unwilling to give them the resources they need to be successful. If you are one of the unfortunates that are in this situation, then you could at least perform a simple Google search on "Forms Tutorials" and you will find numerous on-line "Free" tutorials. Don't worry about the Forms version used by these tutorials as you are only going through the tutorial to learn how to create a Form and how the Forms tool interacts with the database; which is doesn't matter which Forms version you are using because this part hasn't changed all that much between the Forms versions.
    There are even some really good books (however, quite old) that you can purchase that teach you all the basics of Oracle Forms. Here are just a few:
    Developing Oracle Forms Applications by Albert Lulushi
    Oracle Forms Developer's Handbook by Albert Lulushi
    Oracle Developer: Advanced Forms and Reports by Peter Koletske
    Programming with Oracle Developer by Matthew BennettThese are just a few books and yes they are all for older versions of Oracle Forms. But the concepts you will learn apply to any Forms version.
    While I admit that it is inconvenient that I can't call a Restricted built-in from certain triggers once you understand the reasons why you can't call Restricted built-ins it make sense why Oracle built their event model the way they did. By calling certain restricted built-ins in a trigger, such as the When-Validate-Item trigger, you could very easily cause an an endless loop to occur in your application. For example, if you were allowed to call the GO_BLOCK or GO_ITEM built-ins from a When-Validate-Item trigger you could cause cascading validation events to occur. While this is not a bad thing in and of itself, but what would happen if I sent the Forms Navigation cursor to go to an item before I had completed my validation logic. The item I sent the cursor too also happens to have validation logic assigned to it that just so happens to send the navigation cursor to the item I just left. Understand, the first item has not yet completed it's validation process and the second item sends the cursor right back the first item - which triggers a new validation event on the first item. Now I've got compounding events in the execution stack and I've put my application into a loop that I will never get out of because I've got validation logic that never completes successfully so the validation event never exits - it just keeps running and running.
    At first, you might say that it is the developers responsibility to ensure this does not happen and the developer should be more careful with their code to prevent this from happening and you would be right. We (developers) are responsible for writing safe code. However, after a while, software manufacturers eventually put restrictions in place because there are enough irresponsible developers out there causing problems and the only way to fix the issue is through the use of framework restrictions.
    Having said that, Oracle Forms has certain restrictions for good reasons. Because you don't understand what those reasons are is not a good reason to complain about the restrictions. Rather, I would hope, that your lack of understanding of a particular framework/methodology would encourage you discover the "Why's" and "How come's" of the framework.
    The simple fact of the matter is you cannot be successful with Oracle Forms unless you learn how to program within the Forms Framework. You can't take C++, Java or any other programming language and apply the rules of programming these languages to Forms. You absolutely must learn how Oracle Forms operates and what the rules are for developing successful Forms applications.
    That's my two cents on the topic. I'm trying to start a flame war; I'm just tired of hearing people complain about Forms just because they don't understand or haven't taken the time to understand how Forms operations and what the rules are for developing within Oracle Forms.
    Sincerely,
    Craig...
    Edited by: CraigB on Aug 2, 2011 12:38 PM

  • Why Module level trigger contains "WHEN-CHECKBOX-CHANGED" trigger in Forms 6i?

    Hi,
    Why Module level trigger contains triggers like "WHEN-CHECKBOX-CHANGED", "WHEN-BUTTON-PRESSED" etc.? "WHEN-CHECKBOX-CHANGED" trigger is present in CheckBox & "WHEN-BUTTON-PRESSED" trigger in Button. Then why these triggers are also presnt in Module?
    Can anyone please clarify my doubt?

    There's a lot of triggers that are present at different "scopes". Like they exist at the item level, the block level,
    the module level...
    The idea is if you have an action that should only occur at that one single item it can do in the item trigger. If
    it's for all of them on the block, in the block level trigger. If for all of them ever, at the module level.
    For example suppose you wanted it to do a next_item after the trigger executed you can put that logic in the module
    level trigger. A key thing to notice here is the trigger hierarchy. That is essential to know about.
    Right click on one of these triggers in the object navigator. The execution hierarchy is override, before and after.
    since each of these levels of the same trigger has this execution hierarchy this is, well, potentially not easy to
    understand what is going to happen. I would typically have a per-item trigger be before and a higher level trigger
    be after.
    And this execution hierarchy thing is something I'd love to see enhanced in the gui. I wish it was a lot easier to see
    what the execution hierarchy is when editing a trigger text. I wish one could see and modify the execution hierarchy on the
    same screen as the trigger text and what would be really great is some way to tell how the trigger hierarchy will sort out
    at run time. For example if one is looking at an item level trigger it would be fabulous to know that as is, that trigger will be
    overridden by a higher level trigger and so on. Or vice versa if one is looking at a block level or form level trigger that it is
    overridden by a lower level trigger, or it will execute before or after some other trigger. I don't know what is defined to happen
    with various levels of triggers that have the same execution hierarchy. Like suppose they are all override,before,after.. then
    what happens? It'd be good to know.

  • WHEN-RADIO-CHANGED

    Hi Everyone,
         I'm utilizing Oracle Forms 10g and i have created a radio group called "current_tier".  Within the group there are 4 radio buttons.  Each button is sequentially assigned a number from 0 to 3, so if you pick Tier 0, then the database field is populated with a Zero (0), and so on.  This aspect works.  Now, i created a WHEN-RADIO-CHANGED with the following code, and it just doesn't seem to do anything... no errors, nothing.  Can you take a look and point me in the right direction?  basically, if they pick Tier 2 or 3, I want a specific column in the database to be updated with a Date that they upgraded from say zero or 1 or even from 2 to 3.  Below is my code.
    declare
         v_current_tier number;
    begin
         select current_tier into v_current_tier from TABLE where tracking_nbr = :global.track_nbr;
    if v_current_tier <= 1 and :current_tier (name of radio group) <= 1 then
         update TABLE
         set date_modified = sysdate
         where tracking_nbr = :tracking_nbr;
    if v_current_tier <= 1 and :current_tier >= 2 then
         update TABLE
         set date_upgraded_tier_2_3 = sysdate
         where tracking_nbr = :tracking_nbr;
    end if;
    end if;
    end;
    thank you,
    Steven

    declare
         v_current_tier number;
    begin
         select current_tier into v_current_tier from TABLE where tracking_nbr = :global.track_nbr;
    if v_current_tier <= 1 and :current_tier (name of radio group) <= 1 then
         update TABLE
         set date_modified = sysdate
         where tracking_nbr = :tracking_nbr;
    else
         update TABLE
         set date_upgraded_tier_2_3 = sysdate
         where tracking_nbr = :tracking_nbr;
    end if;
    end;
    OR
    declare
         v_current_tier number;
    begin
         select current_tier into v_current_tier from TABLE where tracking_nbr = :global.track_nbr;
    if v_current_tier <= 1 and :current_tier (name of radio group) <= 1 then
         update TABLE
         set date_modified = sysdate
         where tracking_nbr = :tracking_nbr;
    elsif v_current_tier <= 1 and :current_tier >= 2 then
         update TABLE
         set date_upgraded_tier_2_3 = sysdate
         where tracking_nbr = :tracking_nbr;
    end if;
    end;

  • How to check when MPD changes track?

    I want to log every time when MPD changes song, but I can't find out how. Anyone got any ideas?

    koper wrote:
    here is the code in C that prints out name of the song when mpd changes it.
    #include <unistd.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <libmpd.h>
    #include <debug_printf.h>
    #define RED "\x1b[31;01m"
    #define DARKRED "\x1b[31;06m"
    #define RESET "\x1b[0m"
    #define GREEN "\x1b[32;06m"
    #define YELLOW "\x1b[33;06m"
    void status_changed(MpdObj *mi, ChangedStatusType what)
    if(what&MPD_CST_SONGID)
    mpd_Song *song = mpd_playlist_get_current_song(mi);
    if(song)
    printf(GREEN"Song:"RESET" %s - %s\n", song->artist, song->title);
    int main()
    int run = 1, iport = 6600;
    char *hostname = getenv("MPD_HOST");
    char *port = getenv("MPD_PORT");
    char *password = getenv("MPD_PASSWORD");
    MpdObj *obj = NULL;
    if(!hostname) {
    hostname = "localhost";
    if(port){
    iport = atoi(port);
    obj = mpd_new(hostname, iport,password);
    mpd_signal_connect_status_changed(obj,(StatusChangedCallback)status_changed, NULL);
    mpd_set_connection_timeout(obj, 10);
    if(!mpd_connect(obj))
    mpd_send_password(obj);
    do{
    mpd_status_update(obj);
    }while(!usleep(100000) && run);
    return 1;
    to compile it:
    gcc source_code -o output_file -lmpd -I/usr/include/libmpd-1.0/libmpd/
    the code it's actually a modified example from libmpd site:
    https://svn.musicpd.org/MOVED/libmpd/tr … testcase.c
    So this wakes up every 0.1 seconds....?  there goes your battery life...

  • How to verify when i change mode in form of standard?

    To All
             I want to know that how to coding if I change mode on screen Incoming Payment from "Add" mode to "OK" mode. I develop it using vb.net to catch event. This post I want to insert button into standard screen by in first time I created button but I disable it but I click "Last Data Record" in menu bar system will change to "OK" immediately. I want to know coding catch changing mode. example code as below

    Try
                If pVal.FormType = 170 And pVal.EventType <> SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD And pVal.Before_Action = False Then
                    If pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD And pVal.Before_Action = False Then
                     Then
                        oForm = SBO_Application.Forms.Item(FormUID)
                        oItem = oForm.Items.Add("btnPrint", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
                        'Set Size and Location
                        oItem.Top = 432
                        oItem.Left = 160
                        oItem.Width = 60
                        oItem.Height = 22
                        oButton = oItem.Specific
                        oButton.Caption = "Print"
                        SBO_Application.MessageBox("Button was added")
                    End If
                End If
            Catch ex As Exception
                MsgBox(Err.Description)
            End Try

  • Help in Trigger ( When-radio-changed )

    Hi,
    I have a form which represents a sales invoice and I have an item called (pay_type) It’s a radio group included  (cash , debit, cheque, .. so on )
    now for EX if the user choose ‘cash’
    It supposed the trigger takes the invoice value and ( + ) it on the Treasury table  (this is fixed)
    And on the other hand it should (–) the invoice items quantities from the ( store_item ) table
    And this is the problem I need help in, because I couldn't write the where condition to decrease the quantities from store_item table based on the ( item_code & store_code ) Which in the invoice.
    i tried this code and i know that "the where condition is wrong here" but i try to show u what i need to do
    begin
    if :pay_type = 'cash'
    then
    update cash
    set cash.balance = cash.balance + :inv_detail.net_val;
    update store_item
    set store_item.quantity = store_item.quantity - :inv_detail.quantity
    where inv_detail.item_code = store_item.item_code;
    elsif
    :pay_type = 'debit'
    then update customer
       set customer.debit_val = customer.debit_val + :inv_detail.net_val;
    end if;
    end;
    And this is the scripts for 5 tables with columns I think u just need & sample data
    2 of them are about the invoice
    3-item table         4-store table         
    5- store_item ”this is created to handle the many to many relationship between (item & store ) tables”
    --item table
    CREATE TABLE ITEM
    ( ITEM_CODE        NUMBER,
      ITEM_NAME        VARCHAR2(100 BYTE),
      COST             NUMBER(10,2),
      PRICE            NUMBER(10,2));
    ALTER TABLE ITEM ADD (CONSTRAINT ITEM_PK  PRIMARY KEY (ITEM_CODE) ENABLE VALIDATE) ;
    Insert into ITEM
       (ITEM_CODE, ITEM_NAME, COST, PRICE)
    Values
       (1, 'keyboard dell usb', 20, 25);
    --STORE TABLE
    CREATE TABLE STORE
    (STORE_CODE         NUMBER,
      STORE_NAME         VARCHAR2(100 BYTE)         NOT NULL);
    ALTER TABLE STORE ADD (CONSTRAINT STORE_PK PRIMARY KEY (STORE_CODE) ENABLE VALIDATE);
    Insert into STORE
       (STORE_CODE, STORE_NAME)
    Values (1,'aa');
    Insert into STORE
       (STORE_CODE, STORE_NAME)
    Values (2,'bb');
    --STORE_ITEM table
    CREATE TABLE STORE_ITEM
    (STORE_CODE  NUMBER,
      ITEM_CODE   NUMBER,
      QUANTITY    NUMBER(10,2));
    ALTER TABLE STORE_ITEM ADD (CONSTRAINT STORE_ITEM_PK PRIMARY KEY (STORE_CODE, ITEM_CODE) ENABLE VALIDATE);
    ALTER TABLE STORE_ITEM ADD (CONSTRAINT ITEM_STOREITEM_CODE FOREIGN KEY (ITEM_CODE) REFERENCES ITEM (ITEM_CODE) ENABLE VALIDATE,
      CONSTRAINT STORE_STOREITEM_CODE FOREIGN KEY (STORE_CODE) REFERENCES STORE (STORE_CODE) ENABLE VALIDATE);
    Insert into STORE_ITEM
       (STORE_CODE, ITEM_CODE, QUANTITY)
    Values (1, 1, 250);
    Insert into STORE_ITEM
       (STORE_CODE, ITEM_CODE, QUANTITY)
    Values (2, 1, 500);
    --INV_HEADER  table
    CREATE TABLE INV_HEADER
    (SERIAL_NO        NUMBER(10),
      INV_DATE         DATE                         NOT NULL,
      STORE_INVH_CODE  NUMBER);
    ALTER TABLE INV_HEADER ADD (CONSTRAINT INV_HEADER_PK PRIMARY KEY (SERIAL_NO) ENABLE VALIDATE);
    ALTER TABLE INV_HEADER ADD (CONSTRAINT STORE_INVH_FK FOREIGN KEY (STORE_INVH_CODE)  REFERENCES STORE (STORE_CODE) ENABLE VALIDATE);
    --INV_DETAIL table
    CREATE TABLE INV_DETAIL
    ( SEQ               NUMBER,
      ITEM_CODE         NUMBER,
      ITEM_NAME         VARCHAR2(100 BYTE),
      QUANTITY          NUMBER(10,2),
      NET_VAL           NUMBER(10,2),
      PAY_TYPE          VARCHAR2(50 BYTE),
      INVH_INVD_SERIAL  NUMBER(10));
    ALTER TABLE INV_DETAIL ADD (CONSTRAINT INV_DETAIL_PK PRIMARY KEY (ITEM_CODE) ENABLE VALIDATE);
    ALTER TABLE INV_DETAIL ADD (CONSTRAINT INVH_INVD_FK FOREIGN KEY (INVH_INVD_SERIAL) REFERENCES INV_HEADER (SERIAL_NO) ENABLE VALIDATE);
    -- i'll be grateful if anyone could help me in this
    --Thanks

    create database trigger in salesta table and
    begin
    if :pay_type = 'cash'
    then
    update cash
    set cash.balance = cash.balance + :inv_detail.net_val;
    update store_item
    set store_item.quantity = store_item.quantity - :inv_detail.quantity
    where inv_detail.item_code = store_item.item_code;
    elsif
    :pay_type = 'debit'
    then update customer
       set customer.debit_val = customer.debit_val + :inv_detail.net_val;
    end if;
    end;

  • How to realize? - By changing tabs hidden some characteristics in DP...

    Hi @ all,
    first my situation:
    I have two tabs with one dataprovider and the same query.
    Now, I want to show different characteristics in each tab. How can I realize that?
    Thanks for your answer...

    Thanks for your answer, but now I have the problem that in query views you cannot navigate. If I open the Web-Template with the two tabs, I want to see the first one with a aprt of the characteristics from Data Provider. Then I navigate in this tab. Now, when I'm changing to the second tab, I want the navigation status from the first tab will shown in second tab and show some other characteristics.
    I hope you understood me...

  • When radio button is enabled the block should be enable

    I have a 4 radio buttons and a four blocks in a same single canvas , and when ever i enable a radio button the related block should get enable .. pls help me with coidng

    Use the when-radio-changed trigger. There is a RADIO BUTTON VALUE property per radio item. You can place in the trigger...
    IF CONTROL.TEMP_RADIO_BUTTON = 1 THEN
    SET_BLOCK_PROPERTY ('BLOCK1', ENABLED, PROPERTY_TRUE);
    ELSIF...
    END IF;
    Hope this helps...

  • When-validate-record trigger only if  a non database item is changed

    Hi,
    I am trying a code in the when-vaidate-record trigger in the BLOCK level.
    The trigger should fire only if a checkbox item value is ticked(Value ='Y) for the present record(i.e, if already existing other records have a value ticked (='Y), it doesnt matter and trigger shouldnt fire)
    Please help me achieve this :
    The code I have tried in when-vaidate-trigger, which does not work as what I want :
    DECLARE
    X NUMBER;
    BEGIN
    if
      nvl ( :DEFLOC.to_be_defaulted, 'N' ) = 'Y' and :DEFLOC.COMMENTS is NULL
      and :SYSTEM.RECORD_STATUS ='CHANGED'
         then
        set_alert_property(
             'err_alert',
             alert_message_text,
             'You must enter a comment when defaulting localities.');
              x := show_alert('err_alert');
              RAISE FORM_TRIGGER_FAILURE;
              end if;
    END;The above code does not fire at all..
    If I remove the part,
    and :SYSTEM.RECORD_STATUS ='CHANGED'
    it fires for "all records"(not just the currently changed records) where nvl ( :DEFLOC.to_be_defaulted, 'N' ) = 'Y' and :DEFLOC.COMMENTS is NULL
    Please help !!
    Note: :DEFLOC.to_be_defaulted is a non database item ; :DEFLOC.COMMENTS is a database item

    Hi kriti,
    There is one more way,
    In the when-checkbox-changed trigger,
    if :your_chk_box = 'Y' then
    set_Record_property(:system.cursor_Record, 'your_blk',status,changed_Status);
    else
    set_Record_property(:system.cursor_Record, 'your_blk',status,Query_Status);
    end if;
    Then it is easy for you to find out the changed records using get_Record_property((:system.cursor_Record, 'your_blk',status)
    Hey let me ask you one Question, is that check_box item is database item ???
    If so,
    it is easier..the fol. code will work for that
    if   nvl ( :DEFLOC.to_be_defaulted, 'N' ) = 'Y' and :DEFLOC.COMMENTS is NULL
      and nvl(get_item_property('DEFLOC.to_be_defaulted',database_value),'N') = 'N'      then
                      set_alert_property(
             'err_alert',
             alert_message_text,
             'You must enter a comment when defaulting localities.');
              x := show_alert('err_alert');
              RAISE FORM_TRIGGER_FAILURE;
              end if;otherwise
    If your are creating that temp. item, it should be in the same block as non-db item.
    I will explain this... You are setting the status of to_be_defaulted check box of some queried record to Y based on some conditions, right?
    These records anyways are not updateable. Now your requirement is to find out the newly checked check boxes.
    So in the post query or the place where you set to_be_defaulted as 'Y, we will default the new item with value Y, so that in the when validate trigger, you
    know which record needs to attacked, It is those records with nvl( new item ,'N') = 'N' and to_be_defaulted = 'Y'...
    Regards
    Dora...

  • Using WHEN-LIST-CHANGED on T-list to navigate block records

    I have a form on which I use a T-List to list all of the child records in a block based on the selected parent record of the form. I am using the T-List almost strictly for navigational purposes (and eventually later for delete purposes as well). Above my T-List on the form is all of the individual fields that display the details of the record that is selected in the T-List. My POST-QUERY trigger on the block populates the T-List with all of the child records, and also uses the value of the highest (max value) child record to updated all of the detail fields for the block. I also have a program unit that updates all of the detail fields for the block that gets called from my WHEN-LIST-CHANGED trigger for the T-List. It passes the key value from the T-List to the program unit and updates all of the child record detail information.
    My problem comes when I attempt to actually update the currently selected child record. I've tried a number of different things to get this to work, but none of them have completely worked, and I'm coming to the end of my knowledge base and can't figure out how to make this update the child record correctly. Initially I was having a problem where the form actually WAS performing the update, but it was always (no matter which list item I had selected) updating the same record, which was the first record that was retrieved for the block. I've run the form in debug mode, and checked the actual values of the child record fields after I've changed the selected item in the list, and all of those fields are actually the correct values corresponding to the selected item in the list, but for some reason, it won't update the record that is currently in those fields when I do a save. From what I can tell, I need to be able to somehow actually navigate the records in that block when I click on an item in the list (i.e. perform next_record or previous record until the block gets to the record that corresponds to the item selected in the list) so that the form recognizes and attempts to update the correct record.
    Has anyone out there tried this before? Does anyone know of a solution for how to do this? Any help would be greatly appreciated. Thanks in advance.
    -::YEX::-
    <)))><

    1. WHEN-LIST-CHANGED trigger is not for items it is for List items (Pop , COMBO, Tlist)
    2. Try to write a code on WHEN-VALIDATE-ITEM at field level with code similar to this
    if :custname is not null then
    begin
          select ship_to_location into :ship_to_location
            from tablename
         where custcd = :custcd;
    exception when no_data_found then
          ----call some alert and error message.........
    end;
    else
      :ship_loc := null;
    end if;plz mark it helpful/correct if it is

  • WHEN-LIST-CHANGED Triggers Works Only Once ??

    hi
    i have a form with the 2 list ITEMS
    And i have some trigger WHEN-LIST-CHANGED For the
    first LIST item which Populates the Second List
    Based on the Value selected in First List
    Its Works Fine For the First time.
    But for second time Onward , it Does change the Value of the items in List2.
    Do i have to first clear and then repopulate, i tried this but then i get a total
    Blank , please help.
    jai

    From one of our support notes:
    List Items populated from Record Groups are extremely useful when you need to
    give your users a choice of items to choose from. This note will show you how
    to create two list items that have a "master-detail" relationship, i.e., the
    items appearing in the "detail" list item will depend on what is chosen in the
    "master" list item.
    CREATING THE LIST ITEMS
    Create two list items called DEPT_LIST and ENAME_LIST. Allow them to remain
    the default type of List Item, Poplists. For this situation we will not make
    them base table items. Go to the property pallet of each list item, click on
    the elements in list property and choose more. The cursor should be in the
    very topmost item under List_Elements. Depress CTRL+SHIFT+< to remove this
    default element and depress the OK button. Since you are going to populate the
    list item with RG values at runtime you do not need this element. This will
    avoid an "FRM-30351: No list elements defined for list item" error when
    running the form.
    CREATING THE RECORD GROUPS
    For this example, we will use the dept and emp tables. We have a choice of
    creating the Record Groups (RG) dynamically at runtime or at design
    time. In this case, the easiest option is to create them at design time.
    First create a RG called DEPT_GROUP with the following select statement:
    SELECT TO_CHAR(DEPTNO) A,TO_CHAR(DEPTNO) B
    FROM DEPT
    If you are unfamiliar with the structure of the RG required when it will be
    used to populate a list item please note the following:
    1. A list item has both a label and a value. For this reason the select
    statement brings back two fields, one which will be the label name and the other
    the label value.
    2. TO_CHAR is used to convert numeric values to character as the list item
    contains character values.
    Second, create a RG called ENAME_GROUP with the following select statement:
    SELECT ENAME A, ENAME B FROM EMP ORDER BY ENAME
    Note that depending upon your applications logic you may want to use the
    distinct operator to prevent duplicate names. But you should be aware that
    this will result in the overhead for sorting. Also, since ENAME is a VARCHAR2
    data type, the to_char function is not needed.
    POPULATING THE GROUPS AND LIST ITEMS
    You can populate the RGs and list items from a number of triggers but the most
    common is the WHEN-NEW-FORM-INSTANCE trigger. Place the following code in this
    trigger:
    DECLARE
    V_DEPT_GROUP NUMBER;
    V_ENAME_GROUP NUMBER;
    BEGIN
    V_DEPT_GROUP:=POPULATE_GROUP('DEPT_GROUP');
    V_ENAME_GROUP:=POPULATE_GROUP('ENAME_GROUP');
    POPULATE_LIST('DEPT_LIST','DEPT_GROUP');
    POPULATE_LIST('ENAME_LIST','ENAME_GROUP');
    END;
    Note that this code is needed to initially populate both RGs and both List
    Items.
    If you run the form at this time you will see that DEPT_LIST contains all the
    departments in Dept and ENAME_LIST contains ALL the enames in the emp table.
    As our original goal was to populate ENAME_LIST depending upon what was chosen
    from DEPT_LIST, we will now add the code to do this. In this situation we will
    add the code to a WHEN-LIST-CHANGED trigger on DEPT_LIST. The code should
    look as follows:
    DECLARE
    V_NUMBER NUMBER;
    V_QUERY VARCHAR2(512);
    BEGIN
    V_QUERY:='SELECT ENAME A, ENAME B FROM EMP
    WHERE DEPTNO = '||:DEPT_LIST||' ORDER BY ENAME';
    V_NUMBER:=POPULATE_GROUP_WITH_QUERY('ENAME_GROUP',V_QUERY);
    POPULATE_LIST('ENAME_LIST','ENAME_GROUP');
    END;
    First we will build a query that will contain the currently chosen department
    in DEPT_LIST. This is basically the same query we created in RG ENAME_GROUP
    but we are adding the where clause restriction. We then use the
    populate_group_with_query built-in to repopulate the RG and then populate the
    list again.
    Run the form again and test. Choose department 10 from the DEPT_LIST list item
    and then choose the ENAME_LIST item. You will note that the enames appearing
    in ENAME_LIST will be those in department 10. This should work for any
    department you choose.

  • Problem with WHEN-CHECKBOX-CHANGED and ON-POPULATE-DETAILS

    I have a detail block with a relationship set up to a second block. In my first block, if I cause an error but the next action I take is to press a checkbox on another record, my error will display and the raise form trigger failure is triggered but the checkbox changes it's value and the cursor is displayed on the record with the error. I didn't want the checkbox to change if an error occurred. I tracked this through the trace and saw the on-populate-details is fired between the error and the when-checkbox-changed trigger. I went through debug and saw because of the erorr, the system will do a 'return' back to the sending action. I beleive this return is causing the when-checkbox-changed to fire. I'm just guessing here. I tried a similar action on another form without a relationship set up. That would eliminate the on-populate-details trigger. When I did a similar error, I got exactly what I was looking for. I caused the error but pressed the checkbox on another record. The error displayed but the checkbox did not change and the cursor returned to the error record. I need the record to have this relationship. Consequently, I need the on-populate-details trigger. Can anyone think of a solution? I'm currently on Forms 6I. We are going to forms 10G in the next few months. But I really need a solution on my current set up. Thanks.

    The getNextDatabankRecord() call is at the beginning of my run code. I use one step just for this line code.
    Code :
    public void run() throws Exception {
              beginStep("CHARGEMENT DES DONNEES SUIVANTES");
                   info("Chargement des prochaines données...");
                   getDatabank("NouvellesIA").getNextDatabankRecord();
              endStep();
    Stop the user after this step and goto the finish section should not be a problem...
    If I use the "When out of records" option, does it jump directly to the finish section ?
    Thanks,
    Benoit.

  • How to hide save changes alert window when no changes made to the form

    hi,
    in my form when i close the form without making any changes it displays do you want to save the changes alert.how to hide this alert when no changes are made to the form window.
    regards
    Yesukannan

    Be advised that this solution will also exit the form without saving the changes and asking anything if the user did make changes.
    You're probably changing some field from a PL/SQL trigger (hint: post-query or when-new-record-instance are likely). If you set the value of a field from a trigger or program unit that also marks the record as changed for Forms. Forms will then ask to save the changes when exiting the form.
    If you want to prevent this, reset the record status after you change the field in the PL/SQL code.

  • Trigger java client update when table changes

    I have a Java Swing client and a C worker program. Both need to communicate with each other via events (C writes progress to Oracle table, Java Swing client displays progress to user).
    I thought I'd do this via a trigger on an oracle table. However, I couldn't figure out how to achieve that. Well, creating the trigger was the easy part, but how do I let the trigger and as a follow-up a stored procedure communicate with my Java client? All the info I found was about triggers and how to store a Java method in an Oracle DB. That's not what I need. I guess I need to register my Java client somehow to monitor the trigger / table.
    Does anyone know how to do that? I'd prefer to not use any additional libraries (Oracle AQ libraries, Oracle streams). A simple trigger would suffice.
    Thank you very much for your help!

    rp0428 wrote:
    >
    The client should poll for updates.
    Pushing from the database, which your original suggestion and the others provides no benefit in terms of the enterprise and might cause unforseen and difficult to diagnose problems.
    >
    I don't agree with either of these comments. Please explain them and provide any supporting documentation or other reliabe sources that you are basing these comments on.
    In particular clarify whether your comments are about the technology of notification in general or whether you feel that the notification solution is not appropriate for this particular use case.
    Polling is generally a terribly wasteful, inefficient and non-productive method of trying to identify changes that happen in a database. Provide supporting documentation for that.
    Naturally the actual metrics for this depend on the number, types and frequency of the DB changes in general and with their relation to the polling frequency in particular.Yep. And most of the time the specifics for that is such that one or both the following is true
    1. The requirements are wrong (for example no GUI needs to be update 100 times a second.)
    2. The requirements are loose enough that polling is perfectly adquate and appropriate solution.
    Oracle itself has gone in the opposite direction with the technology that it develops as can be inferred by the various methods provided in recent releases to support replication and the technology underlying the support of fast refresh materialized views.
    Oracle has all sorts of stuff in it. That doesn't mean that it ideal for all situations or even most situations.
    These technologies include Advanced Queuing, Change Data Capture, Advanced Replication, Standby Databases and the like.
    The only major Oracle technology that I am aware of that does not tend towards publish/subscribe is LogMiner and it does not use polling but rather uses a batch query process.
    And yet for 20 years people have managed to implement large solutions without that.
    Detection of DB changes is difficult for even small single tables without using functionality provided by Oracle specifically for that purpose. There are many, many references in these forums and on the web in general where developers have attempted to 'roll-their-own' procedures for detecting changes after the fact. Most of these attempts are flawed both in their design and execution.
    And yet you think that this new technology will provide immediate error free solutions both on Oracles sides and the implementors side?
    Polling is generally wasteful and inefficient for several reasons. First, poll queries can execute repeatedly when there haven't been any changes at all. This effort is entirely wasted and non-productive.
    I have a large volume database server whose cpu utilization is less than 3% with a projected volume this year of 3/4 billion dollars. In the mid 1980s I was more concerned with utilization. Not so much any more.
    On the other hand experience would suggest that developers have far, far more problems getting the database designs right in the first place. So I don't have great confidence in their ability to use brand new technologies to solve large volume problems.
    And if they don't have large volumes then the point is moot.
    The poll queries cannot easily determine exactly when the change occured; change meaning it was COMMITTED to the database. The common approach of updating columns such as MODIFIED_DATE within a trigger are flawed because any such date/time assigned in the trigger is virtually guaranteed to occur BEFORE the data is actually committed.
    The classic flaw manifests itself when the trigger assigns a value before midnight but the commit actually occurs after midnight. Thus two INSERT/UPDATES can have their data COMMITTED at exactly the same SCN and timestamp value but the MODIFIED_DATE values can be for two different days.
    There is no way to query this data on a nightly basis to get 'changes that happened today' with the risk of missing data the next night when the extract occurs, or worse, duplicating some data in the extracts for two different nights.
    I agree that the design you specified is flawed.
    It however is an excellent demonstration of how a developer might create a flawed design - as I a suggested. New technologies do not fix flawed designs. All they do is provide even more ways to create flawed designs. Which is exacerbated by large volume needs.
    And 'pushing from the database'? The change notification process is similar to publish/subscribe mechanisms and also similar to the way that listeners are used in Java.
    Certainly you wouldn't suggest that Java applications should 'poll' GUI objects to see if a user has taken any action would you?
    I agree your analogy is not apt for this discussion.

Maybe you are looking for

  • Creating Logical Component in Solman 7.1

    Hi, I want to create a Logical component for my SAP ECC managed system, could you please let me knowhow to create it. OR is there any standard SAP document available on how to create Logical component in Solman 7.1 SP10. Regards P Kumar

  • Where to find the logs for cronacle queues

    hi i m using redwood explorer 7.0.3 . Someboday had hold the cronacle queues . it was giving the message queues held by operator . But we don't know who held the queues. Can anbody tell where we can find the logs for these queues i.e who made changes

  • Printing of report

    Hello Friends, I am not able to export the hierarchy report from PS. The provision is greyed out. Can you help in this.

  • Count occurrences of a phrase

    Hi, what is the best way to count occurrences of a phrase (multi-gram words) in a document (corpus)? I am using String.split("regular expression here") to split the content of a document. For example to count how many times "this noun phrase" occurs

  • [X-Fi Xtreme Audio] fully functional in Vista - WHEN

    Will we get fully functional drivers for Xtreme Audio? I mean "What you here", MIC... When? Offical drivers doesn't support even this normaly