,이 코드를 시도했지만 작동하지 않았다 :렌더링 된을 사용하여 PrimeFaces에서 LayoutUnit을 업데이트하는 방법은 무엇입니까? 내가 <code>rendered</code>를 사용하여 왼쪽에있는 <code>p:commandButton</code>에서 클릭 <code>layoutUnit center</code>에서 양식을 보여주고 싶은
test.xhtml
<h:body>
<p:layout fullPage="true" >
<p:layoutUnit position="west" size="175" header="Tableau de bord">
<h:form>
<p:commandButton actionListener="#{userBean.formClient}" value="Client" />
</h:form>
</p:layoutUnit>
<p:layoutUnit position="center" >
<p:panel id="panelClient" rendered="#{userBean.showFormClt}">
<h1>Testing</h1>
</p:panel>
</p:layoutUnit>
</p:layout>
</h:body>
UserBean.java
private boolean showFormClt;
public boolean isShowFormClt() {
return showFormClt;
}
public void setShowFormClt(boolean showFormClt) {
this.showFormClt = showFormClt;
}
public void formClient(ActionEvent e){
showFormClt = true;
}
센터 레이아웃 유닛 내부의 내용을 업데이트하려고하지 않으므로 작동하지 않는 것이 당연합니다. – Kukeltje
답장을 보내 주셔서 감사합니다. 해결책이 있습니까? –
네, 아약스를 배워 봅시다. (그리고 받아 들인 대답에는 몇 가지 나쁜 것들이 있습니다. 비록 작동하고 있지만 좋은 예제가 아닙니다. – Kukeltje