Primefaces面板
是否有一种方法可以使其在我单击p:按钮时显示一个隐藏的p:面板,并在下次渲染时再次隐藏Primefaces面板,primefaces,Primefaces,是否有一种方法可以使其在我单击p:按钮时显示一个隐藏的p:面板,并在下次渲染时再次隐藏 <h:commandButton id="saveButton" value="save" oncomplete="cartComplete.show();"> </h:commandButton> <p:panel widgetVar="cartComplete">
<h:commandButton id="saveButton" value="save" oncomplete="cartComplete.show();">
</h:commandButton>
<p:panel widgetVar="cartComplete">
Shopping Cart Saved
</p:panel>
购物车已保存
试试这个
<p:commandButton value="Save" action="#{myBean.setPanelVisibility}" update=":myForm:myPanel"/>
<p:panel id="myPanel" rendered="#{myBean.renderPanel}"/>
在bean中,切换renderPanel属性 给你
<h:body>
<h:form prependId="false">
<p:panel id="myPanel" style="display:none">
Shopping Cart Saved
</p:panel>
<p:commandButton id="show" value="show" onclick="jQuery('#myPanel').show()">
</p:commandButton>
<p:commandButton id="hide" value="hide" update="myPanel">
</p:commandButton>
</h:form>
</h:body>
在java类中
私有字符串renderPanel=“false”<代码>
“并在下次渲染时再次隐藏”这是什么意思?页面重新加载?如果您需要一个带有面板的样式类,您将如何实现这一点?
.hide {
display:none;
}