【发布时间】:2013-03-01 08:56:42
【问题描述】:
我在p:dialog 中有一个p:pickList。
<p:dialog id="registerDialog" widgetVar="registerServiceDlg" modal="true"
minimizable="false" draggable="false" position="300,40"
style="background:#E0E0E0;" closable="true" maximizable="false"
resizable="false" visible="#{not empty facesContext.maximumSeverity}">
<p:ajax event="close" update="registerDialog" />
<h:outputLabel value="User" styleClass="label"/>
<p:pickList id="contactBean" value="#{contactBean.contacts}" var="contact"
itemLabel="#{contact}" itemValue="#{contact}" style="margin-left:20px;"
required="true" requiredMessage="one user is needed"/>
</p:dialog>
关闭对话框时,我想清除p:pickList 目标列表。我怎样才能做到这一点? bean 在会话范围内,我想将它保留在会话范围内。
【问题讨论】:
-
您要么想将选项列表的 value 属性绑定到其他东西,以便可以在不干扰会话的情况下清除它,或者清除在会话范围 bean 中找到的列表,以便值将是更新。此外,您需要在
<p:ajax>标记中添加一个侦听器,以使其在关闭时正常工作。 -
如果您在问题中添加功能要求和一般设置(会话中的内容、选择列表中的内容等),那也很棒。
-
您的具体问题是什么?在相应地实施要求时,您究竟停留在哪一步?您知道通过
<p:ajax listener>调用bean 方法的可能性吗?
标签: jsf-2 primefaces