Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Setter not getting called for a JSF inputText rendered component upon Ajax reRendered  RSS feed

 
monica singh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<h:column></h:column>
<h:column>
<h:panelGroup id="fieldId">
<h:selectBooleanCheckbox
id="autofieldCheckbox"
binding="#{someHandler.someBean.selectedOptionField}"
onclick="onFieldClick();"
rendered="#{someHandler.renderField}">
</h:selectBooleanCheckbox>
<h:outputText value="#{bundle.fieldDefault}"
rendered="#{someHandler.renderField}"/>
<rich:spacer width="10" />
<h:inputText
id="fieldVal"
maxlength="4"
style="width:70px"
title="#{bundle.fieldTitle}"
onchange = "onChangeOfField();"
value="#{someHandler.someBean.selectedStartField}"
rendered="#{someHandler.renderField}"/>
<f:verbatim><BR></f:verbatim>
<rich:spacer width="10"></rich:spacer>
</h:panelGroup>
</h:column>
<h:column>
<h:inputText id="fieldErrorMessage" value=""
onfocus="this.blur();" style="width:100%;border:0;color=red" />
</h:column>

I have the above code containing check box,ouput text and input text rendered based on the value "renderField"
in the handler.Also,I am re-rendering the above code when I change the value in the following menuList.


<h:column>
<h:outputText
styleClass="fields"
value="#{bundle.listWithColon}" />
</h:column>
<h:column>
<h:selectOneMenu
id="menu"
style="text-align:left"
value="#{someHandler.someBean.selectedMenu}"
valueChangeListener="#{someHandler.handleField}">
<f:selectItems value="#{someHandler.menuList}"/>
<a4j:support event="onchange" reRender="fieldId"></a4j:support>
</h:selectOneMenu>
</h:column>
<h:column></h:column>

Say,my menuList is having values 0 and 1 .
For value 0 in the menu, the "renderField" is false.So the first block of code will not appear on the UI.
Now I change the value from 0 to 1 in the menu.There by ajax call of "reRender="fieldId" would happen.
For value 1 in the menu, the "renderField" is true.So the first block of code will appear on the UI.
Now,I input value in the inputText field.After clicking on the button to navigate to the next page,the setter of the
inputText is not getting called.There by , I am not able to see the input given in the next page.

Let us take the other case.
For value 0 in the menu, the "renderField" is TRUE.So the first block of code will not appear on the UI.
Now I change the value from 0 to 1 in the menu.There by ajax call of "reRender="fieldId" would happen.
For value 1 in the menu, the "renderField" is FALSE.So the first block of code will appear on the UI.
Now,I input value in the inputText field.After clicking on the button to navigate to the next page,the setter of the
inputText is getting called.There by , I am able to see the input given in the next page.

Can anyone please let me know the reason why the setter is not getting called in the first case.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!