• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic