1
デフォルトでは、ページがロードされると、collapsed = "true"という属性があるため、パネルが閉じて表示されます。私は、パネルの更新を自動的に追加して編集すると、更新はうまくいくが、折りたたんでもtrueに設定されていても、すべてのパネルが開いているように見えるようにしたい。私はなぜこれが起こるのか知りません。なぜ知っていますか?これを解決する方法は?折りたたみがtrueに設定されているとプライムフェイスパネルが表示されます
addView.xhtml:
<body>
<h:outputStylesheet name="./../../resources/css/cssLayout.css"/>
<ui:composition template="./../../Layouts/LayoutGeneral.xhtml">
<ui:define name="content">
<h1 style="text-align: center">Adds</h1> <br/>
<h:form id="allAddsId">
<ui:repeat value="#{addBean.allAdds}" var="add" >
<p:panel id="basic" header="#{add.title}" style="margin-bottom:20px" toggleable="true" collapsed="true" styleClass="">
<p:ajax event="toggle"/>
<h:panelGrid columns="2" style="width:100%">
<p:outputLabel value="#{add.description}" />
</h:panelGrid> <br/>
<p:separator/>
<p:commandButton value="Edit" oncomplete="PF('detail').show();" update="detailAdd" action="#{addBean.setAddAux(add)}"/>
<p:growl id="growl" showDetail="true" sticky="false" />
</p:panel>
</ui:repeat>
</h:form>
<p:dialog id="detail" header="Edit Add" widgetVar="detail">
<p:outputPanel id="detailAdd">
<h:form>
<p:outputLabel value="Title"/><br/>
<p:inputTextarea id="titleEdit" value="#{addBean.addAux.title}" rows="2" cols="50" counter="displayTE" maxlength="50" counterTemplate="{0} caracteres restantes" autoResize="false" required="true" requiredMessage="Title necesaria"/> <br/>
<p:outputLabel id="displayTE"/> <br/> <br/>
<p:outputLabel value="Description"/> <br/>
<p:inputTextarea id="opcion1" value="#{addBean.addAux.description}" rows="6" cols="50" counter="displayDE" maxlength="200" counterTemplate="{0} caracteres restantes" autoResize="false" required="true" requiredMessage="Description necesaria"/> <br/>
<p:outputLabel id="displayDE"/> <br/> <br/>
<p:separator/> <br/>
<h:panelGrid columns="1">
<p:commandButton value="Save" action="#{addBean.editAdd(addBean.addAux)}" onclick="detail.hide()" update=":allAddsId"/>
</h:panelGrid>
</h:form>
</p:outputPanel>
</p:dialog>
</ui:define>
</ui:composition>
</body>
あなたのPFバージョンもご質問ください – Kukeltje