X

Shay Shmeltzer's Oracle Development Tools Tips

  • October 21, 2010

Got to Love Cascading LOVs in ADF

Shay Shmeltzer
Director of Product Management - Oracle

"You've got to love our cascading LOVs" was the title of an email from Maiko that pointed to a long and complex tutorial that shows how non-trivial implementing cascading lists is when you use ExtJS, Hibernate and Spring. You basically end up writing over 300 lines of code in a mixture of languages including java, javascript and json.

This is indeed one of many areas where you can clearly see the advantages that ADF gives you with a declarative development approach.

Check out this little demo that shows how you build this type of cascading lists with JDeveloper and ADF. The interesting point to note is that a single SQL statement is the only manual line of code you end up writing.

This is why we believe that visual and declarative is good.

By the way, if you prefer written instructions for this, you can use either Steve's Article or this part of the ADF BC tutorial.

Join the discussion

Comments ( 10 )
  • Abbas Thursday, October 28, 2010
    good effort
  • nikos Monday, November 8, 2010
    Great video, very helpful.
    What is not described is how you can manage the return values of the list boxes. How do we overcome the (known?) problem that the selectItems returns an index of the selected option and not the value of the option itself?
  • shay.shmeltzer Monday, November 8, 2010
    One way to get the value of the selectOneChoice is explained in this how-to:
    http://www.oracle.com/technetwork/developer-tools/jdev/listbindingvalue-088449.html
  • nikos Monday, November 8, 2010
    Thanks a lot! I've been trying days to make this work. Perhaps this would be obvious to more experienced ADF developers but i am mentioning it just in case: you need to set all the cascading lists (and not just the parent one) to autoSubmit="true" to get their values in the way described in the link above.
  • Sameer Monday, November 15, 2010
    Hi
    I tried this and it is working. Thank you very much.
    I just have one question.
    If I do not select the country in the poplist, how to display all states from all countries.
    This might not make sense in case of countries and states, but what I tried is for Organization and Items.
    If the organization is not selected, I have to display all the items for all organizations.
    If one organization is selected, I have to display items only for that organization.
    Thanks and Regards
    Sameer
  • shay.shmeltzer Monday, November 15, 2010
    I think you'll need to change the SQL for your LOV to something like:
    where country_id=nvl(:p_country,country_id)
    This will bring all the values when p_country is null.
  • sandy Tuesday, November 16, 2010
    Good post.. very helpful.. thank you
  • guest Tuesday, August 30, 2011

    Hi Shay,

    Is there any way to create cascade LOV with multiselect in View Criteria.

    Ex. If a select multiple Countries from the parent LOV, the child LOV would display the list of States for the selected Countries.

    Regards,

    Koushik


  • guest Monday, April 16, 2012

    Hi Shay. I was not able to get this to work in 11.1.2.1. The model tester worked flawlessly. However, on the JSF page, I get the following exception when switching between countries with states and countries with fewer states after selecting a state:

    ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase RENDER_RESPONSE 6

    java.lang.ArrayIndexOutOfBoundsException: 3


  • guest Friday, January 17, 2014

    Here you explained dependent LOV only for 2 values. please anybody tell how to get LOV's for 4 dependent

    values i.e four selectonechoice feilds.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.