1

In below code, I click the Submit button. That change boolean result value to true in backing_home bean via a ajax call.

If I remove the rendered rendered="#{backing_home.result}", I see the updated output properly. But with the below code it is false. I think it doesn't render the new value

<h:commandButton id="MySubmit" value="Submit" action="#{backing_home.toggleRenderResult}">
   <f:ajax render=":AjaxGuess:result2"/>
</h:commandButton>
<h:outputText id="result2" value="#{backing_home.result}" rendered="#{backing_home.result}" />

What could be the reason?

user2771655
  • 1,052
  • 3
  • 20
  • 38

1 Answers1

1

I update the code as below based on Hatem Alimam's comment.

<h:commandButton id="MySubmit" value="Submit" action="#{backing_home.toggleRenderResult}">
   <f:ajax render=":AjaxGuess:result2"/>
</h:commandButton>
<h:panelGroup id="result2">
  <h:outputText value="#{backing_home.result}" rendered="#{backing_home.result}" />
</h:panelGroup>
user2771655
  • 1,052
  • 3
  • 20
  • 38