1 Reply Latest reply: Mar 4, 2013 2:41 AM by Frank Nimphius-Oracle RSS

    AddPartialTarget causes valueChangeListener invoked multiple times

    Cmoster-Oracle
      Hi All,

      I am using JDev 11.1.1.6.0.

      I have a problem with programmatic ppr using addPartialTarget method.

      The scenario is as follows:

      I have an af:table in which 2 of the columns include selectOneChoice in each: ( select1 and select2 ).

      The values of select2 depends on select1. For example, select1 has countries, and select2 has cities of the selected country of select1.

      So, in valueChangeListener of select1, based on the selected value, get the respective cities, put into the list used by select2. And after everything finished, refresh the select2 using AdfFacesContext.getCurrentInstance().addPartyTarget(this.getSelect2()).

      The problem is that the valueChangeListener of select1 (countryChangeListener) is called multiple times. Then it shows NullPointerException pop-up in the ui. But I can't find the exception trace in my log. I found that it's not coming from the listener method when I debug.

      Below is the jsff content:


      +<af:column headerText="#{bindings.tableVO1.hints.Country.label}" id="c16">+
      +<af:selectOneChoice label=""+
      +value="#{row.bindings.Country.inputValue}"+
      +valueChangeListener="#{backingBeanScope.myBean.countryChangeListener}"+
      +autoSubmit="true"+
      +id="soc1">+
      +<f:selectItems value="#{pageFlowScope.countryList}"+
      +id="si2"/>+
      +</af:selectOneChoice>+
      +</af:column>+

      +<af:column headerText="#{bindings.tableVO1.hints.City.label}" id="c8">+

      +<af:selectOneChoice label="" id="soc4"+
      +value="#{row.bindings.City.inputValue}"+
      +autoSubmit="true"+
      +binding="#{backingBeanScope.myBean.socCity}">+
      +<f:selectItems value="#{row.bindings.CityList.inputValue}"+
      +id="si6"/>+
      +</af:selectOneChoice>+
      +</af:column>+

      The problem also occurs for other select boxes in that table.

      Although I solved it by using *partialTriggers=soc1* in city select box in jsff, it works (it refreshes the city select box and shows the values), I don't know why the programmatic refresh with addPartialTarget() is not working.

      Can you all please help with that issue? Because I need to use addPartialTarget for other cases.

      Thanks.

      Best Regards,

      cmoster