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.
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.
there is no way in JSF to execute a value change listener multiple times and I spare myself the full life cycle explanation here. Because you use this in a table, how likely is it that the Value Change Listener is invoked for other rows of the table? Can you try setting the selectOneChoice valuePassThru property to true? My assumption is that upon rendering of the select lists you do change the underlying component value