I've added a new screencast to my screencasts page to illustrate the steps involved in Creating a Drop-Down List Based on a View Object with a Named Bind Variable.
As illustrated in the screencast, the crux of the technique -- after creating a view object that accepts a named bind parameter (e.g. :CurrentEmpno) is to:
- In the binding section of the page definition, add an action binding for the "ExecuteWithParams" built-in action for the iterator driving the set of choices in the list.
- In the action binding editor, provide an EL expression that you want to supply the value of the CurrentEmpno named bind variable. In the screencast, we use the EL picker to select the expression ${bindings.Empno.inputValue} which represents the value of the Empno attribute in the current row.
- In the executables section of the page definition, add an "invokeAction" after the iterator for the main EmpView but before the iterator for the list, and binding the invokeAction to the "ExecuteWithParams" binding we created above. This forces the query on which the drop-down list is based to be re-executed each time the page is rendered, taking into account the current row's empno value as the value of the named bind variable in the view object driving the list.
Using this new threesome of:
- ViewObject with named bind parameters
- Action binding for ExecuteWithParams against an iterator for that view object, and
- InvokeAction in the executables section to automatically invoke an action binding during the JSF page lifecycle
many things that required writing code in JDeveloper 10.1.2 can now be done declaratively in the 10.1.3 release.
11:26:08 AM
|
|