NEW VERSION 1.1 !!
The plugin now supports pagination and resets the "changed state" of the items. You therefore will not get an inappropriate warning concerning changed state of the items.
Inspired by a really old blog by Denes Kubicek, I decided to turn his solution into a usable plugin.
The plugin supports multiple instances on one page as seen here.
- Create a tabular form
- Set the relevant items to be a select list
- the "parent" or "master" is a regular select list, use SQL, Shared Component, or any other means to populate your select list
- the "child" column should have a query that only returns a message" ie:
select '-- please choose --' as d
, null as r
from dual
or it should not return anything
select null as d
, null as r
from dual
where 1=0
- Now you add the plugin (it is a dynamic action plugin to be used on page load)
- triggering element:
This is the "master", you need to enter the NAME attribute of the item, find it by using your browsers' inspector
- row key:
This is the element that holds the primary key of your tabular form. It is needed to be able to select the child's value. Find it by searching for the name attribute for the (hidden) element that holds the rows' key.
The plugin can only handle singular primary keys, use rowid if needed
- child element:
This is the "child", you need to enter the NAME attribute of the item, find it by using your browsers' inspector
- nothing selected text:
Enter the text that must be displayed when nothing is chosen. (ie: "-- please make a choice --")
- query:
Enter the query responsible for populating the child element.
The query should return two columns: d and r (for display-value and return-value) and contain a where clause that refers to the parent elements value.
That parent elements value should be preceded by a colon ("bind" parameter), as shown in the example:
select ename d
, empno r
from emp
where deptno = :deptno
order by 1
- Child query:
Enter the query that gets the current child elements value from the database. The query should return a single row and a single column and should have a bind variable in the where clause.
select empno
from emplog
where id = :l_key_val
- That should do the trick. Run your page.