Hi
Demo is here https://apex.oracle.com/pls/apex/js_fun/r/javascript-fun/home - front end / back end login is demo / apexdemo . Workspace is js_fun . Please feel free to experiment.
I have a categories checkbox group based on a query from a table. These can either be selected / unselected by a user, or are set automatically as required categories when the user chooses a value from a select list.
Each checkbox has a pop lov linked to them. The idea is that if the user selects/deselects a checkbox the relevant pop up lov will be shown / hidden. I wrote some JavaScript (dynamic action "Show/Hide LOVS" to do this and it was working as expected, however things are now slightly more complex in that each checkbox has multiple pop up lovs linked to them, in the form of lovs.
So flow would be:
Users selects item "Another Value" from select list, this checks categories "Location" and "Product". Parent location and product lovs are now shown. If the user selects e.g. United States in Location lvl 1, then location lvl 2 is shown with each state, they can then filter down to major city etc.
This all works fine for new entries, however due to the way the "Show/Hide LOVs" dynamic action is written, it hides all lovs on change then brings back the required lovs after. There are some times it doesn't work properly, such as if check a category, fill in say level 1, then check another category - level 2 will be hidden as it has no value in it. I need to improve this DA to handle all cases.
Can anyone offer any tips / example of
a) how to fix this problem
b) how to improve this process? It feels quite clunky at the moment and there are a few steps required every time a new category is added. I feel that the "Enable" x dynamic actions could probably be improved as well.
c) my plan was to clear all hidden lovs on page submit, rather than every time a checkbox is checked / unchecked. Does this seem reasonable?
Additional info:
The next level of an lov should only be shown if there are any entries in it. E.g. Country United States, State Florida has some Major Cities listed so level 3 should be shown, however State Hawai does not, so level 3 should not be shown. This is controlled by hidden item :P1_SHOW_NEXT_LEVEL.
Each of the parent lovs has a parent_category class.
Every lov has a category class
Every lov has a data tag associated with it, which relates to the category type. e.g. data-name=location or data-name=product
Thanks