I try to update a part of the page on button click. Right now, I have the following :
template.xhtml
<h:form prependId="false">
<h:commandButton value="NEWS" action="news">
<f:ajax render="newsContent"></f:ajax>
</h:commandButton>
<h:panelGroup layout="block" id="newsContent">
<ui:insert name="newsContent">
<ui:include src="/WEB-INF/partials/news/news.xhtml"/>
</ui:insert>
</h:panelGroup>
</h:form>
/WEB-INF/partials/news/news.xhtml
<h:commandLink action="newsdetails">
<f:ajax render="newsContent" />
</h:commandLlink>
newsdetails.xhtml
<h:commandButton value="INDEX" action="index">
<f:ajax render="newsContent" />
</h:commandButton>
Right now its working fine, but if I replace the <h:commandbutton>
with something like
<p:commandButton value="INDEX" action="index" update="newsContent"/>
Then the content is updated but the page is refreshed. Any thoughts what I am doing wrong here?