Java 如何打开属性为closable true的面板?

Java 如何打开属性为closable true的面板?,java,ajax,jsf-2,primefaces,Java,Ajax,Jsf 2,Primefaces,我把代码贴在下面。一切正常,而面板的属性 (id=“idPanemCriticas”)closable=“false” 如果将其更改为true,则不会显示更多消息,如果关闭面板,则无法打开更多消息。 我真的需要帮助,谢谢 <h:head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>JSF 2 + PrimeFaces</title> &l

我把代码贴在下面。一切正常,而面板的属性 (
id=“idPanemCriticas”
closable=“false”

如果将其更改为
true
,则不会显示更多消息,如果关闭面板,则无法打开更多消息。 我真的需要帮助,谢谢

<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>JSF 2 + PrimeFaces</title>
</h:head>
<h:body>
<h:form>
<p:panel id="idPanelCad" header="Cadastro de Usuário" style="width: 60%;">
<h:panelGrid columns="6">
<h:outputText value="Nome:" />
<p:inputText id="nome" value="#{loginMb.usuario.nome}" required="true" size="20"
requiredMessage="Informação do nome é obrigatório.">
<h:outputText value="*" />
</p:inputText>

<h:outputText value="Sobrnome:" />
<p:inputText id="idSobreNome" value="#{loginMb.usuario.sobreNome}"
required="true" size="20" requiredMessage="Informação do sobrenome é obrigatório.">
</p:inputText>
<h:outputText value="*" />
</h:panelGrid>

<h:panelGrid columns="3">
<h:outputText value="Senha:" />
<p:password id="idSenha" value="#{loginMb.usuario.senha}" feedback="true"
required="true" requiredMessage="Informação da senha é obrigatória.">
</p:password>
<h:outputText value="*" />
</h:panelGrid>

<h:panelGrid>
<p:commandButton value="Gravar" action="#{loginMb.gravar}" update="toUpdate "     
onclick="wp.show();"  process="toUpdate"/>
</h:panelGrid>

<h:panelGrid>
<h:outputText value="(*) - Campos com informação obrigatórias." />
</h:panelGrid>

<p:separator> </p:separator>

<p:outputPanel id="toUpdate">
<p:panel id="idPanemCriticas" widgetVar="wp" closable="false" header="Críticas"  
rendered="true">
<p:messages id="mss" closable="true" />
</p:panel>
</p:outputPanel>

</p:panel>
</h:form>
</h:body>
</html>

JSF2+素数面

您是否尝试在
p:outputPanel
中使用
autoUpdate=“true”
属性?p:outputPanel的目标是允许您。在您的例子中,嵌入的
p:panel
p:messages
总是会被呈现,所以我不认为使用
p:outputPanel
来实现这一点有什么意义