Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Primefaces面板_Primefaces - Fatal编程技术网

Primefaces面板

Primefaces面板,primefaces,Primefaces,是否有一种方法可以使其在我单击p:按钮时显示一个隐藏的p:面板,并在下次渲染时再次隐藏 <h:commandButton id="saveButton" value="save" oncomplete="cartComplete.show();"> </h:commandButton> <p:panel widgetVar="cartComplete">

是否有一种方法可以使其在我单击p:按钮时显示一个隐藏的p:面板,并在下次渲染时再次隐藏

            <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;
}