Forum Stats

  • 3,780,675 Users
  • 2,254,423 Discussions
  • 7,879,411 Comments

Discussions

Pre-populate Cascading LOV

lkakarla1-Oracle
lkakarla1-Oracle Member Posts: 25
edited May 12, 2016 2:48PM in JDeveloper and ADF

JDeveloper 12.1.3

I'm stuck and would appreciate any help available.

Here is the page code where cascading LOV's implemented and it's working as expected i.e. child LOV refreshes when Parent LOV changes.

                                <af:inputComboboxListOfValues id="countryId"

                                                              popupTitle="Search and Select: #{bindings.Country.hints.label}"

                                                              value="#{bindings.Country.inputValue}"

                                                              label="#{bindings.Country.hints.label}"

                                                              model="#{bindings.Country.listOfValuesModel}"

                                                              columns="#{bindings.Country.hints.displayWidth}"

                                                              autoSubmit="true" searchDialog="none">

                                    <f:validator binding="#{bindings.Country.validator}"/>

                                    <af:autoSuggestBehavior suggestedItems="#{bindings.Country.suggestedItems}"/>

                                </af:inputComboboxListOfValues>

                                <af:inputComboboxListOfValues id="stateId"

                                                              popupTitle="Search and Select: #{bindings.State.hints.label}"

                                                              value="#{bindings.State.inputValue}"

                                                              label="#{bindings.State.hints.label}"

                                                              model="#{bindings.State.listOfValuesModel}"

                                                              columns="#{bindings.State.hints.displayWidth}"

                                                              autoSubmit="true" partialTriggers="countryId"

                                                              editMode="select">

                                    <f:validator binding="#{bindings.State.validator}"/>

                                    <af:convertNumber groupingUsed="false" pattern="#{bindings.State.format}"/>

                                    <af:autoSuggestBehavior suggestedItems="#{bindings.State.suggestedItems}"/>

                                </af:inputComboboxListOfValues>

I have a scenario where I need to pre-populate both Parent LOV and Child LOV with some values selected by user previously when page loads. I tried to handle it through application module method by creating dynamic view criteria.

            ViewObjectImpl countryVO = this.getCountryVO1();

            ViewCriteria countryVC = countryVO.createViewCriteria();

            ViewCriteriaRow countryVCR = countryVC.createViewCriteriaRow();

            countryVCR.setAttribute("Country", obj_ProvReq.getCountry());

            countryVCR.setAttribute("State", obj_ProvReq.getState());

            countryVC.add(countryVCR);

            countryVO.applyViewCriteria(countryVC);

            countryVO.executeQuery();

            countryVO.clearViewCriterias();

The LOV values are getting pre-populated with this approach. But Child LOV not getting refreshed, if I change Parent LOV value other than pre-populated value. Please advise if we can deal this scenario any other way.

Thanks.

Tagged:
This discussion has been closed.