I was reading about features in Oracle APEX 4.1 in Patrick Wolf's Blog, and I wanted to try it out to see how easy or difficult it is to implement a Select list which dynamically changes based on a different value in the page.
I created a sample application with three tables:
I created a sample application with three tables:
- Country_Master - Stores country id and name
- State_Master - Stores country id, state id, and name
- Company_Master - references country id and state id to store company record.
My intention was to implement country select list and state select list in company master page. As soon as I select a country states belonging to the country should be refreshed in state select list.
The APEX feature used: "Cascading LOV Parent Item(s)"
Using this feature Oracle APEX simplifies the way in which you perform repeated tasks such as refreshing a select list based on different item. Other ways in which you could achieve are:
- Refresh the entire page -> This is the traditional approach, but the downside to it is page refreshing time can be irritating to the end user.
- AJAX -> Write javascript/jquery to refresh the select list, but the downside is to write code in each and every page where you need this functionality.
- Cascading LOV -> This is the easiest way to achieve the refreshing functionality. The downside however is that its not possible in Tabular forms. This can not only be used for two select lists but the bind field can be any item.
Click here to download and run the sample application for yourself to see how this works. (Apex Version 4.2.2)
Note: If you are looking for simple step-by-step instruction for setting up this, see this blog or original Patrick Wolf's blog where I came across this feature.
The final result was very pleasing. APEX team has been working hard to achieve features which are intuitive. Kudos to the team for this feature. I would love to see Applications List of Values to be parameter-based so that I need not write the same query again and again for many pages.
The final result was very pleasing. APEX team has been working hard to achieve features which are intuitive. Kudos to the team for this feature. I would love to see Applications List of Values to be parameter-based so that I need not write the same query again and again for many pages.
No comments :
Post a Comment