-
1. Values aren't dynamically updated in backing bean
vali_iva May 6, 2011 5:27 AM (in response to vali_iva)Oh, and instead of event="onchange" I used olso event="onslide". But the result is the same. Not updating.
<a4j:support event="onslide" reRender="companiesTable" />
-
2. Re: Values aren't dynamically updated in backing bean
vali_iva May 7, 2011 7:11 AM (in response to vali_iva)I still haven't solved my problem, but I come with an update.
I added a repeater binding: binding="#{testBackingBean.repeater}" to my <a4j:repeat> and added an action to the ajax support to manually change the value from my list.
This is the new code:
<a4j:outputPanel header="Selector" id="selector" > <a4j:repeat value="#{testBackingBean.targetInd}" binding="#{testBackingBean.repeater}" var="item" > <rich:inputNumberSlider value="#{item.minRange}" showInput="false" showBoundaryValues="false" minValue="#{item.min}" maxValue="#{item.max}" > <a4j:support immediate="true" action="#{testBackingBean.updateMinRangeValue}" event="onchange" reRender="companiesTable"/> </rich:inputNumberSlider> <rich:inputNumberSlider value="#{item.maxRange}" showInput="false" showBoundaryValues="false" minValue="#{item.min}" maxValue="#{item.max}" > <a4j:support immediate="true" action="#{testBackingBean.updateMaxRangeValue}" event="onchange" reRender="companiesTable" /> </rich:inputNumberSlider> </a4j:repeat> </a4j:outputPanel>
Olso added the method to the testBackingBean:
public String updateMinRangeValue(){ targetInd.get(getRepeater().getRowIndex()).setMinRange(0.0); // here I need to set to the current value of the slider getRepeater().getRowData(); // ???? return null; }
This methos is not complete because I don't know how to get current value of the slider from the current row.
Now I need to know if this is the right approch??? If yes, how do I get value of the slider? getRepeater().getRowData() ??? And then.. ??
Thanks in advanced.
Vali
-
3. <a4j:repeat> issue values aren't dynamically updated in backing bean
nbelaevski May 8, 2011 4:46 PM (in response to vali_iva)Hi Valentin,
What is the scope of testBackingBean bean?
-
4. Re: <a4j:repeat> issue values aren't dynamically updated in backing bean
vali_iva May 8, 2011 7:11 PM (in response to nbelaevski)Hi Nick, thanks for the reply.
It is in session scope.
But I made some changes from my last post.
I modified <a4j:support>, setted immediate="false" and completed my method. Now it it looks like this:
public String updateMaxRangeValue(){ SelectIndicator selectedRow = (SelectIndicator) getRepeater().getRowData(); int i = getRpeater().getRowIndex(); targetInd.get(i).setMaxRange(selectedRow.getMaxRange()); }
Bbut still not working like it shuld. Now, when I slide, the value gets changed, but with it all the other slides values inside the repeater get reseted
to the values I manually set them in testBackingBean constructor. This is weared, I'm sure that the bean is in session scope.
Thanks again.
Vali
-
5. Re: <a4j:repeat> issue values aren't dynamically updated in backing bean
ilya_shaikovsky May 9, 2011 8:50 AM (in response to vali_iva)I believe should works without any immediate and bindings used. Please replace the
rich:inputNumberSlider on the initial source with h:inputText just to check ow it will works.
Minor hints
1) please add layout=block to outputPanel. in orther case you will have non-valid htrml generated (slider consist of block elements and outputPanel renders as span by default)
2) please use phaseTracker to look through lifecycle execution. If there will be difference for just inputText and slider used?
-
6. Re: <a4j:repeat> issue values aren't dynamically updated in backing bean
vali_iva May 9, 2011 10:08 AM (in response to ilya_shaikovsky)Hi Illya,
I made all the modification you suggested. But still not working. Not even with the inputText.
This is the output of my phaseTracker both for inputText and for slider:
May 9, 2011 5:04:14 PM org.apache.catalina.core.ApplicationContext log INFO: BEFORE - RESTORE_VIEW 1 May 9, 2011 5:04:14 PM org.apache.catalina.core.ApplicationContext log INFO: AFTER - RESTORE_VIEW 1 May 9, 2011 5:04:14 PM org.apache.catalina.core.ApplicationContext log INFO: BEFORE - APPLY_REQUEST_VALUES 2 May 9, 2011 5:04:14 PM org.apache.catalina.core.ApplicationContext log INFO: AFTER - APPLY_REQUEST_VALUES 2 May 9, 2011 5:04:14 PM org.apache.catalina.core.ApplicationContext log INFO: BEFORE - PROCESS_VALIDATIONS 3 May 9, 2011 5:04:14 PM org.apache.catalina.core.ApplicationContext log INFO: AFTER - PROCESS_VALIDATIONS 3 May 9, 2011 5:04:14 PM org.apache.catalina.core.ApplicationContext log INFO: BEFORE - UPDATE_MODEL_VALUES 4 May 9, 2011 5:04:14 PM org.apache.catalina.core.ApplicationContext log INFO: AFTER - UPDATE_MODEL_VALUES 4 May 9, 2011 5:04:14 PM org.apache.catalina.core.ApplicationContext log INFO: BEFORE - INVOKE_APPLICATION 5 May 9, 2011 5:04:14 PM org.apache.catalina.core.ApplicationContext log INFO: AFTER - INVOKE_APPLICATION 5 May 9, 2011 5:04:14 PM org.apache.catalina.core.ApplicationContext log INFO: BEFORE - RENDER_RESPONSE 6 May 9, 2011 5:04:14 PM org.apache.catalina.core.ApplicationContext log INFO: AFTER - RENDER_RESPONSE 6
Thanks,
Vali