我必须在 primefaces 对话框中实现搜索功能。提交搜索命令按钮后,搜索旁边的表格需要更新。但是每次我点击搜索按钮时,弹出窗口都会关闭。请指导。以下是我的代码片段供参考:
......
<p:commandButton id="search" value="Search" actionListener="#{createTicketBaseBean.searchUserFromList}" update="@form" onclick="dlg.show()"></p:commandButton>
</h:panelGrid>
</h:panelGroup>
<h:panelGroup style="float:right" >
<p:dataTable id="table" var="user" value="#{createTicketBaseBean.userList}" selection="#{createTicketBaseBean.selectedUser}" selectionMode="single" rowKey="#{user.email}" >
<p:column headerText="Name" >
<p:commandLink id="nameselect" value="#{user.name}" onclick="dlg.hide()"/>
</p:column>
<p:column headerText="Email">
<h:outputText value="#{user.email}" />
</p:column>
<p:column headerText="Department">
<h:outputText value="#{user.department}" />
</p:column>
</p:dataTable>