当我使用layoutUnit center
点击左侧的p:commandButton
时,我想在rendered
中显示一个表单,我尝试使用此代码,但它不起作用:< / p>
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;
}
答案 0 :(得分:-1)
您可以使用ajax="false"
:
<p:commandButton actionListener="#{userBean.formClient}"
value="Client" ajax="false"/>