Resetting a Form with Cascading LOVs (Apex 4)

A standard reset button cannot reset cascading LOVs properly. Let's assume we have a parent LOV and a child LOV. When one changes the selection in the child LOV, reset can undo this. But when he changes the selection in the parent LOV, reset will undo only the parent LOV but not the child LOV. The child LOV remains unchanged (however the selection is lost) and therefore shows a list that does not correspond to the entry now shown in the parent LOV.
Has anybody found a solution for this, a reset action that can reset cascading LOVs completely and properly?
Regards
Roland

Roland,
i didn't try this myself but maybe you succeed with triggering the onchange-event of your parent-select-list (this should cause the child select-list to be refreshed).
Or you could try if a form region has a apex "refresh" event (i know that refresh works on reports).
brgds,
Peter
Blog: http://www.oracle-and-apex.com
ApexLib: http://apexlib.oracleapex.info
BuilderPlugin: http://builderplugin.oracleapex.info
Work: http://www.click-click.at

Similar Messages

  • New Blog Post: Saving Current Values with Cascading LOVs

    All,
    Just blogged on Saving Current Values with Cascading LOVs: http://bit.ly/hQPUPi
    Enjoy!
    Regards,
    Dan

    Monty,
    Glad to hear it's working for you.
    Oh, you just had to go there ;) Popup LOVs are a bit more difficult because the values are not automatically brought back to the page for you. I've already worked out how this could be implemented in my head - but writing it up, of course, is more of an effort. I've added it to my list of blog articles to write on. Since it's not a requirement right now, I'll cover another topic first and come back to that one afterward.
    Regards,
    Dan
    Blog: http://DanielMcGhan.us/
    Work: http://SkillBuilders.com/apex/

  • Cascading LOVs (APEX 4.1) problem, using in report does not set values

    Hi,
    i am using APEX 4.1.0.00.32 and i have a simple report as
    SQL:*
    SELECT * from region
    WHERE region like '%'||P3_REGION||'%'
    and country like '%'||P3_COUNTRY||'%'
    and city like '%'||P3_CITY||'%'
    Items:*
    P3_REGION:
    select distinct region as d, region as r from region
    Display Null value: YES
    Null display value: - select -
    Null return value: +0+
    P3_COUNTRY:
    select distinct country as d, country as r from region where region = :P3_REGION
    Display Null value: YES
    Null display value: - select -
    Null return value: +0+
    Cascading LOV Parent Item(s): P3_REGION
    P3_CITY:
    +select distinct city as d, city as r from region where country = :P3_COUNTRY
    Display Null value: YES
    Null display value: - select -
    Null return value: +0+
    Cascading LOV Parent Item(s): P3_COUNTRY
    The LOVs work fine and the correct values are displayed if cascading through them
    So in the last step i want to filter the report with the values that were selected in the lovs. And this i get not working.
    I tried to add a button with SUBMIT of the page. After choosing values in all LOVs and clicking the SUBMIT button the page submits, alle LOVs are cleared (with value - select -) and the report shows all rows.
    I tried to change the button to "redirect to Page 3" and setting the values P3_REGION, P3_COUNTRY, P3_CITY to &P3_REGION., &P3_COUNTRY., &P3_CITY. but without success.
    I tried to use the setting "Page Action when Value Changed" to "Submit" and/or "Redirect and set value" for all Item LOVs and/or only the last item LOV, but then the cascade of the LOVs does not work properly and the report does not change too.
    I am confused as i don´t know what i can do until now. I think this should be an easy requirement to limit/filter the report with values in the LOVs.
    Furthermore it should be possible to choose only the region LOV and then limit the report with that region (without choosing country and city)
    Thanks in advance!

    Hi Dan,
    thank you for your answer. I have the solution now from Kleber_M, this works.
    Dan McGhan wrote:
    1. Use bind variables in my query. It would look something like:
    SELECT *
    FROM region
    WHERE region LIKE '%'|| :P3_REGION ||'%'
    AND country LIKE '%'|| :P3_COUNTRY ||'%'
    AND city LIKE '%'|| :P3_CITY ||'%'
    This was only a mistake when writing the post, i forgot the colon. I use bind variables of course.
    2. Make sure you have a comma separated list of item names that the report depends on beneath the SQL Query where it says Page Items to Submit. This will make sure that the value of those items on the page are bound into session state prior to the query executing.I tried this, too, but without success...
    3. Use Dynamic Actions to perform the refresh action when any of the three items changes. This would be both more performant and a better experience for the end user than a full page refresh.How can i do this. This sounds good, because when refreshing the page often some items oder actions are done that i don´t want to.
    Regards,
    Matze

  • Af:query component with cascading Lov's

    Hi All,
    I have Cascading LOV's model setup in Business Components and they work fine in a form or table
    but they are not working inside af:query component as there is no autoSubmit attribute on the query component itself
    can someone help me to resolve this
    Thanks in Advance

    I have found a way
    using bindings attribute of the query component it was able to go to backing bean on any LOV change in there we need to manually refresh the bindings then it works

  • Tabular form with Popuv LOV doesn't work with onchange event

    Hi all.
    I have a problem with tabular forms, Popuv LOVs and javascript.
    I have created one tabular form, I want to put a value in "my_field" field when a user selects a new value from other field called "my_list", I have this code:
    <script type="text/javascript">
    function putValue(pThis)
        var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
        html_GetElement('f06_'+vRow).value = '0000';
    </script>and this for Element Attributes:
    onchange="putValue(this);"Everything works well when I choose "Display as Text Field", but if I change this option to "Display as Popup KEY LOV" or "Popup LOV" it doesn't work, I mean "my_field" stays without any value.
    I'm using Oracle Application Express Release 4.0 and Oracle 11g
    Please help.
    Regards.

    Hi Peter.
    Thanks, yes, in fact the position of my column changes, but it doesn't work even with the correct element, I have made a lot of proves and it seems that APEX constructs POPUPS LOVS in a different way and that's why "onchange" does not work.
    With this thread: Re: onchange not work on popup lov for a field on collection I have a half solution, It works for existing rows, but it doesn't for added rows.
    I have solved this problem calling a function that set the onchange event to every row when "ADD ROW" button is pressed, now it works without problems.
    Regards.
    Oscar.

  • How to refresh Portal form with dependent LOVs ?

    I have a portal form which has dependent LOVs, the first LOV is
    a Site LOV and the next LOV is a Teacher LOV. Once a Site is
    selected, the form refreshes to load the Teacher's LOV with
    teachers belonging to the selected Site.
    In some cases the Site is assigned internally (using Javascript)
    in such cases the form does not refresh automatically; which
    causes the problem, as all the Teachers of all the Sites are
    loaded in the LOV.
    Any suggestions are welcome.
    Thanks,
    Hilal

    Put this code into the javascript onChange event of the list box
    that you want to automatically refresh the screen with:
    do_event(this.form,this.name,1,'CUSTOM','');
    that should cause the screen to refresh when an item is chosen.
    at that point, the 2nd list box (if you used the :paremter in
    the LOV and bound it to the right field in the form) should come
    up with the proper set of values Thanks Michael,
    But my problem is not with that part of refreshing; that is
    refreshing, when a value is picked from the first LOV to re-load
    the second LOV works fine.
    My problem is only when the value of the first LOV is internally
    set, the form does not refresh to re-load the second LOV. The
    value of the first LOV is loaded(internally) using one of the
    fields in "wwsec_api.person_info", eventhough this value is set,
    it does not trigger a refresh to re-load the dependent second
    LOV.
    I guess a solution to this problem would be to explicitly
    refresh the form (I am not able to figure out how).
    Hope I have clarified myself.
    Thanks.

  • Dynamic Change event getting error with cascading LOV's

    Hi all,
    In my application (v4.0.0), I have two sets of cascading drop-down select lists, these each make up a date (year, month, day) plus a time value (not cascading).
    I also have a dynamic action that gets the hours difference between the two dates set above. This fires on the change event.
    When I change, say the month drop-down, the day list is refreshed. But before it is refreshed, it looks to be emptied and the change event fires. I then get an error from the dynamic action because the day value passed to the query is empty (confirmed when looking at POST data).
    Can anyone think of a workaround idea for this? e.g. a way to set the dynamic action to conditional?
    Thanks!

    Hi Peter
    Thanks for the tip, I have tried this and it has helped, although not solved the problem. I was originally getting two errors appear ("AJAX call returned server error ORA-01843: not a valid month for Set Value.") and this has removed one of them...
    When looking in Firebug, it seems to me that although the dynamic actions (cascading update + set value) are running one before the other, the values aren't updated in order. e.g. the cascading update is not applied before the set value action is run.
    Could this be a bug with dynamic actions?

  • Is there a problem using popup LOVs in a portal form with a bind variable?

    I have a portal form with 2 LOVs. The second LOV is a dependent LOV whose bind variable can be NULL. I have read Note 263923.1, "How To Create Dependent Lovs In Forms", and my form works as long as I use combo boxes to display the LOVs. I need to use popups so the user can search the LOVs as they are quite lengthy. Plus I want to be able to pick a value from my second LOV without selecting a value from the first LOV -- hence, my bind variable can be null and that is where my problem lies. As long as I select a value from the first LOV, the second LOV popup will work. If I click on the icon to display the second LOV without pre-selected a value from the first LOV, I get the following error:
    POPUP LOV ERROR:
    LOV: "9A17692880B6B8509F514F5B9CA9EC808DD403218B3CF19A33C04CD1FAB0ADE17ADC33E6B67998A933357CE5264D204E"
    Parse Message: Parse as pre-set global: "TORE".
    Find Message: LOV is of type DYNAMIC (LOV based on SQL query).
    Query: "SELECT ...."
    wwv_bind.prepare_bind: ORA-01403: no data found
    My form is based on a table with a custom layout. The sql for the second LOV is similar to: SELECT ENAME, EMPNO FROM SCOTT.EMP WHERE (DEPTNO = :DEPT AND :DEPT IS NOT NULL) OR :DEPT IS NULL.
    Thanks in advance for any help,
    Carol

    Don't use EPS any more! It does not support transparency nor color management.
    If you save vector files from Illustrator, use AI with PDF compatiblity.
    If you save image files from Photoshop, use PSD.
    If you save image files combined with vector forms and/or text from Photoshop, use PDP which is a Photoshop PDF.
    For vectors from Illustrator use CMYK files.
    For images use RGB, conversion to CMYK should never done before PDF export, better, if the printer allows it, is to export a PDF with live transparency as it is PDF/X-4
    If the printer requires a PDF with CMYK only export a PDF/X-1a.

  • Cascading lovs in Jdeveloper  R2

    on Jdev R2.
    I was doing several different Test with Jdev R2 regarding to cascading Lov and lovs components.
    here are results.
    lets split them in two flavors.
    I. Forms.
    a) cascading lovs works fine only if you use : input text item with lovs. (this one works fine even if you do not set autosubmit on the master and partial trigger on dependent lovs, .......cool)
    b) if you choose selectOneChoise, "what is really nice for short list" it does not work. not even if you set autosubmit and partial trigger.
    II. af:table
    a) on editing mode: editAll
    * using input text with lov works (you do not need to set autosubmit/partial triggers) but every time when you select a value from a list, an ugly error araise saying : field1 is required. field2 is required...to all require attributes (you can work after click)
    * using selectOneChoise did not work. after you select the first lov the next lov is surrounded by red square and never get refreshed.
    b) on editing mode: clickToEdit :
    this is really cool and fast, but cascading lovs does not work at all. not even input text with lovs
    has anybody any feedback/workaround/idea on this one, or should we wait until these bug get fixed, hopefully in the new release.
    also I was wondering what is the best approuch to execute some java code on load/unload.?
    thank you for any help.
    Luis

    to call java on load use af:clientlistener along with af:serverlistener.. use the type as load
    http://blogs.oracle.com/jdevotnharvest/entry/how-to_call_server_side_java_from_javascript
    or use the beforephase and afterphase property of f:view, refer navaneeth code here
    popup on page load using managed bean, using jdev-11.4
    use af:document's onunload property for unloading event and java calls

  • Session State Protection breaks Cascading LOV.

    Hi,
    Whenever I turn Session State Protection on my application , with option 'Arguments Must Have Checksum' on the page level,
    Items defined with a cascading LOV will not work. Once session state protection is on for the page, and I change the value of a parent
    LOV, the Child Item LOV (defined with Cascading LOV) will not show any value and the 'round working icon' will just keep on going
    and does not end, The Child/Cascading LOV seems to be just hanging and not return any values. This happens consistently (APEX 4.1.1.).
    There are no threads existing for this behavior, would like to know if this is a known issue and if there is a fix.
    Thanks,
    Ramon

    The documentation says, "If you need to set this item's value in session state using Ajax, then an Unrestricted protection level must be used for the item (for example in Dynamic Actions, Set Value, Page Items to Submit or Cascading LOVs, Page Items to Submit)." In practice, what this means (among other things) is that items that are identified as "Cascading LOV Parent Item(s)" must have "Session State Protection" set to "Unrestricted".

  • Mandatory fields on the same page with dependent LOVs

    Hi,
    I am working on an ADF-BC application using JDeveloper 10.1.3.4
    I have an ADF Creation form with dependent LOVs and while implementing dependent LOVs we set the autoSubmit property of the selectOneChoiceListBox as true.
    If I have some mandatory fields on the same page then because of the autoSubmit property set as true whenever I select a value in the list the page gets submitted and the mandatory fields give an error that the values are required therefore I had to remove the mandatory fields.
    I tried using f:subview but even that dint serve the purpose because what I want is something like partialSubmit so that my mandatory fields do no give an error when I select a value in the list.
    Can somebody help me on this, how to have a dependent list and mandatory fields on the same page.
    P.S: It is very crucial for my application
    Thanks,
    Raksha

    Hello,
    This bug has been around since 10.1.3, its even still present in Trinidad and now in 11.
    One of the ways to avoid is to make your fields use:
    showRequired="true"instead of
    required="true"I have not found a decent way to avoid this in general.
    My idea was that this shiould be possible with a phaselistener and determine if this is a partial page event instead of a normal submit, but this didnt work.
    -Anton

  • Cascade lov in a "form with a report"

    I am fairly new to HTMLDB and struggling with this one. Can anyone help?
    I have built a test application that uses a form with report, created using the wizard.On the form I have cascaded LOVs( SITEOWNER and SITE) . The second LOV should depend on the first in that only the sites belonging to the siteowner in the first LOV should be available for selection. I cannot get this to work. I have tried to use "select list" on bothe LOVs but in this case the second LOV is blank. I have also tried "select list with submit" and trap the submit with REQUEST != expression1 as described in some of the posts in this forum, but cannot stop the form from branching.
    Any help will be welcome !. My test application is at the Oracle HTMLDB site.
    MISTST1/[email protected]/bitotu

    Hi,
    If you edit your report region there in the report attributes you will be finding the "Link Column" Section.
    Under the link column section you will be referring the pencil icon image and target page number in the application.
    Brgds,
    Mini
    Mark Answers Promptly

  • How to prevent apex 4.0 shuttle cleared by cascading LOV setting?

    I have a shuttle control for choosing a list of database users populated from a child table by an On Load - After Header process, which then repopulates the child table in an On Submit - After Computations and Validations process. Work fine.
    I then set the shuttle's Cascading LOV Parent Item(s) to a text item that could be used for filtering the shuttle's LOV, and revised the LOV SQL to a) use the filter and b) include items stored in the child table, i.e.:
    select username as dv, username as rv
    from all_users
    where username like upper(:P5_USERSFILTER) || '%'
    union
    select username, username
    from user_grouping_users
    where groupid = :P5_GROUPID
    order by 1
    Unfortunately, when the filter value changes (P5_USERSFILTER), the state of shuttle (as set in my On Load - After Header process) is cleared. The values from the child table are properly included in the LOV, but they are no longer selected -- so the appear in the left-hand list as candidate values but not in the right-hand list as selected values. Additionally, any items selected in the shuttle before changing the value of the LOV Parent (:P5_USERSFILTER) are no longer selected.
    Is there a way to prevent the selections of a Cascading LOV item from being cleared when the parent item is reset?
    Note, I've specified 'No' for Optimize Refresh, and 'P5_USERS' for Page Items to Submit and 'Yes' for Display Extra Values (which in general does not seem to have any affect on a shuttle LOV)

    Hallo all!
    I got a similar situation: a text item that filters the left side of an shuttle item (P11_IAG_ENUM), but the right side should stay the same - independet from the text item, where search-phrases are entered.
    So I tired with your example - thanks for that - but I changed the code that I only have one collection 'P11_IAG_VALUES' ... but right side seems to be still dependend from the search item. I also deleted the "set value" action of the "save current selection"-dynamic-action, because I supposed it's not needed.
    Here is my "save current selection"-dynamic-action:
    DECLARE
    c_collection CONSTANT VARCHAR2(30) := 'P11_IAG_VALUES';
    l_seq_id NUMBER;
    BEGIN
    IF NOT apex_collection.collection_exists(c_collection) THEN
    apex_collection.create_collection(c_collection);
    END IF;
    SELECT MIN(seq_id)
    INTO l_seq_id
    FROM apex_collections
    WHERE collection_name = c_collection
    IF l_seq_id IS NULL THEN
    apex_collection.add_member (
    p_collection_name => c_collection,
    p_c001 => :P11_IAG_ENUM );
    ELSE
    apex_collection.update_member (
    p_collection_name => c_collection,
    p_seq => l_seq_id,
    p_c001 => :P11_IAG_ENUM );
    END IF;
    COMMIT;
    END;
    ... and the "restore old selection"-dynamic-action:
    DECLARE
    l_selected_iag VARCHAR2(32767);
    BEGIN
    SELECT c001
    INTO l_selected_iag
    FROM apex_collections
    WHERE collection_name='P11_IAG_VALUES'
    RETURN l_selected_iag;
    EXCEPTION
         WHEN NO_DATA_FOUND THEN
    RETURN NULL;
    END;
    Where is my error in reasoning?
    (Meanwhile I try to create an example application...)
    [Edit: I got problems to acces my workspace, try to reset my password --> error, even try to find my workspace -->error .... everytime the same; I'll try it later again, but hoping that anyone can help me without example application]
    Edited by: kc7 on 10.09.2010 09:20
    [Edit II: I finally created a example-application: *http://apex.oracle.com/pls/apex/f?p=30216*
    workspace: kc7
    user: dummy
    pwd: doll
    Edited by: kc7 on 10.09.2010 12:28

  • Cascading LOV in a Tab Form Help

    version 4.0.2.00.07
    Hello,
    I've aquired an application that was written by someone else. I have a Tab Form that needs a Cascading LOV. There is code already in place, but I have questions about it that I'm hoping someone can help.
    There's a LOV called Product Group that has an onChange in the Element Attributes:
    onchange="f_load_platform(this.value,#ROWNUM#);"In the HTML Header is a javascript function:
    function f_load_platform(p_pg_id, p_rownum){
       if (p_pg_id) {
          v_new_list = html_GetElement('f04_'+ f_zero_pad(p_rownum,4));
          v_curr_value = v_new_list.value;
          var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=Get_Platform_From_Product_Group',0);
          get.add('P21_PRODUCT_GROUP_ID_PARAM',p_pg_id);
          gReturn = get.get();
          if (gReturn) {
             // Separate each combination set of values
             var NameArray = gReturn.split(",");
             // Reset dropdown list by making its length to a needed value
             v_new_list.length = NameArray.length-1;
             for(i=0; i < NameArray.length; i++){
               NameArrayList = NameArray.split("~");
    if(NameArrayList[0] != "") {
    v_new_list[i].value = NameArrayList[0];
    v_new_list[i].text = NameArrayList[1];
    if(NameArrayList[0] == v_curr_value) {
    v_new_list.selectedIndex = i;
    else {
    v_new_list.length = 0;
    function f_zero_pad(num,count)
    var numZeropad = num + '';
    while(numZeropad.length < count) {
    numZeropad = "0" + numZeropad;
    return numZeropad;
    The Add Row button is set to:
    Action: Redirect to URL
    Execute Validations: Yes
    URL Target: javascript:addRow();
    When I debug the javascript the variable v_new_list shows as false. I can also see that p_rownum variable in the javascript function contains 0.  I don't know if that's correct.
    Can someone help me with why this function does not return the values into the select list for the f04 item?
    What other information can I provide?
    Thanks,
    Joe                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Scott,
    Thank you for replying.
    While debugging the javascript, I can see that gReturn does contain a string of the Platforms for that Product Group ID.
    What I don't know if it's correct is the call to: v_new_list = html_GetElement('f04_'+ f_zero_pad(p_rownum,4));
    When I view source I see that f04_0000 is the Platform select list item.
    <td headers="PLATFORM_ID" class="t13data"><label for="f04_0000" class="hideMe508">PLATFORM_ID</label><select name="f04"  id="f04_0000">...I don't know why the previous developer wrote a function to append the four zero's to the item, but I get the same result when I take out the padding call and replace it with the four zero's so the statement looks like this: v_new_list = html_GetElement('f04_0000');
    I still can see that v_new_list is undefined in the debugger. Any other ideas?
    Thanks,
    Joe

  • Apex 4.2.1 - mobile theme display bugs and Cascading LOV bug

    I've setup a test at http://apex.oracle.com/pls/apex/f?p=35331 - username/password is test/test
    Simple page to show some issues I'm running into. Wondering if work-arounds exist or if a patch would be available before we'd go live.
    First and second issue are the same I believe. So - a normal text box (label1) looks fine. But, Label2 is a Display only item and Label3 is a read-only select list item. As you can see - both of the values appear smack dab right beside the label and not in line with the other fields. It's totally ugly and not usable as is. I've tried to move this over, but the label goes with it. I can see no way of doing it, but wondering if there's some hack I can put in to solve it...
    The last issues is with a cascading LOV. Simple table setup. Static on the first, the second a simple query that filters on the first. If you set the select list to Value Required and not to display null values - then when you click on the Second List button - it just hangs. The page is unusable. I suspect this has to do with the null or something. But - doesn't appear to matter if anything is chosen. Note - if the list is large - which I think then uses a different UI control, this is fine. Only when one of the lists is small does the issue reproduce.
    Any workarounds or fixes? Any ideas?
    Thanks

    Hi,
    I would suggest to not mix different questions and a thread for each of them. Makes it easier for others to follow.
    About your problem with the cascading LOVs, it appears that this is/was a bug in jQuery Mobile which we use under the hood. I was able to reproduce the problem with APEX 4.2.1 using jQM 1.2.0, but was not able to reproduce it with APEX 5.0 which will use jQM 1.3.0RC1 or higher. The problem occurs if a select list is empty.
    There are different workarounds available:
    1) set the attribute "HTML Form Element Attributes" of P1_CLOV_2 to data-native-menu="false"or
    2) set the attribute "Display Null Value" of P1_CLOV_2 to Yes and "Null Display Value" to - select - (or something similar). The "Value Required" = Yes will still guarantee that a value has to be picked. Having the extra null entry will guarantee that the select list always contains an entry, that seems to workaround the bug in jQuery Mobile.
    I have filed bug 16355963 - jquery mobile: empty select list causes javascript error
    to track that this is definitely fixed in APEX 5.0.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

Maybe you are looking for