Monday, June 1, 2015

Dependent LOV or Creating Cascading Dropdown in ADF

The purpose of this post is to document, step-by-step, how to create cascading drop-downs in an ADF form's user interface when ADF business components are used.  A cascading drop down frequently occurs in forms and occurs when a selection made in one field's drop-down automatically and dynamically changes the list of valid values in another field's drop-down.
  • Create query based view object using Region, Country & Location tables.
  • Now, we'll modify the query of the dependent VOs to include a bind variable in their WHERE clause.
  • Create bind variables i.e. regionBind & CountryBind for country & location tables respectively, as these variables are used to hold the values from the first selected LOV and will update the value on the next i.e. cascaded LOV as shown in the figures below.




  • Now,we have created a new query based VO,lets call it CombinedVO with three attribute i.e. Region_Id, Country_Id & Location_Id(to populate our LOV's) as,
  • Here we have modified the where query as: REGIONS.REGION_ID = COUNTRIES.REGION_ID AND COUNTRIES.COUNTRY_ID = LOCATIONS.COUNTRY_ID
  • Make sure that all the 3 attributes of CombinedVo are updateable.
  • Now set LOV on all these attributes as, like i have set it on Region_Id as,
  • Similarly,set LOV on Country_Id & Location_Id too.
  • Now set the value at View Accessors of CombinedVO of CountriesView1 and LocationsView1 as regionBindCountryBind respectively as,

  • Now set Partial trigger & Auto submit on the LOV's.
  • Finally,run your jspx page.

THANK YOU :)

No comments:

Post a Comment