JSF + PrimeFaces: `update` attribute does not update component
- by Harry Pham
Here is my layout
<div id="mainPanel">
<div id="padding">
<h:outputText id="text" value="Personal Feed" rendered="#{Profile.renderComment}"/>
</div>
<div id="right">
<h:form>
<p:commandButton value="Update" actionListener="#{bean.toggleComment}" update="text" />
</h:form>
</div>
</div>
When I click the link Update, which suppose to toggle the renderComment boolean on and off, but it does not toggle the display of the text Personal Feed. Now if I put a form around the h:outputText, and instead update the form instead, then it work. Why is that?