ボタンのクリック時にページの一部を更新しようとしています。p:commandButtonは部分的ではなくページ全体を更新しますが、f:ajaxは正常に動作します。
の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>
は今その作業罰金が、私は
<p:commandButton value="INDEX" action="index" update="newsContent"/>
のようなもので<h:commandbutton>
を交換する場合は、内容が更新されますが、ページが更新されます。私がここで間違っていることは何ですか?
ページが更新されたとはどういう意味ですか?リロード?または、あなたは範囲を緩めますか? – tak3shi
'prependId =" false "'を使用しないでください。使用しないでください。それはJSF 1.2からの残念な残しです。 – BalusC