Cascading LOVs: Ensuring the Master LOV is AutoSubmitted in a Search Form

A user wonders why his cascading LOV is not working properly in an <af:query> search form. This posting explains two ways to ensure that the master (or "driving") LOV will work correctly in this scenario. 

I'm assuming you are working with the 11.1.1.1.0 release. For the sake of an example, let's say your "master"/"driving" LOV is for attribute AutoMaker (e.g. "VW", "Audi", "Ford", etc.) and the "detail" LOV is for attribute AutoModel (e.g. "Fox","Polo", "New Golf", "Tiguan","Touareg", etc.)

In addition to the model-layer step required to setup the cascading list -- defining a view accessor to be used by the "AutoModel" LOV that accepts a bind variable whose value you will configure to be from the current row's AutoMaker attribute value -- there is also a view-layer consideration to make.

In order for the cascading LOVs to work in the search form, the "master"/"driving" list component needs to have its autoSubmit property set to true so its value change is immediately communicated to the web tier. However, since the <af:query> component renders its UI components based on metadata, there is no place in your page where you can specifically set the autoSubmit property of the LOV component used by the search form.

So, we support two model-layer, metadata-driven ways that you can get the LOV component of the search field to autoSubmit:

  1. You can configure the AutoModel attribute's "Dependencies" attribute list to include the "AutoMaker" attribute as attribute on which it depends, or
  2. You can set the UI Hint named "AutoSubmit" on the AutoMaker view object attribute to true
Either of these will make the AutoMaker LOV in the search form have its autoSubmit property set to true and give you the desired result.

I recommend doing #1 because in addition to controlling the autoSubmit property of the driving LOV, properly configuring the attribute dependencies ensures that when your user changes the value of the AutoMaker that the dependent AutoModel attribute's value will be set to null, awaiting the user to pick a correct value from the cascading list that's appropriate for the new AutoMaker value.

Option #2 can be useful to force the UI component for an arbitrary view object attribute (perhaps not even related to cascading LOVs) to have its corresponding search form UI component behave in an autoSubmit=true mode.
Comments:

Post a Comment:
Comments are closed for this entry.
About
Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today