Code: Select all
<p:dialog
header="Enter Search"
widgetVar="user-select-dialog"
modal="true">
<h:form id="user-search-form">
<pm:field>
<p:outputLabel
value="User Name:"
for="user-name" />
<p:inputText
id="user-name"
value="#{userSelector.userName}"
label="User Name Search"
pt:autofocus="true">
</p:inputText>
<p:commandButton
icon="ui-icon-search"
styleClass="ui-nodisc-icon elis-button"
actionListener="#{userSelector.updateLazyUsers}"
process="@form"
update="@form :#{p:component('users-table')}" />
</pm:field>
</h:form>
<h:form id="user-select-form">
<p:dataTable
id="users-table"
value="#{userSelector.lazyUsers}"
var="user"
rowKey="#{user.id}"
selection="#{userCreater.user.editorUser}"
selectionMode="single"
lazy="true"
rows="10"
tableStyleClass="ui-table-columntoggle">
<p:ajax
event="rowSelect"
process="@form"
update=":#{p:component('editorUser')}"
oncomplete="PF('user-select-dialog').hide();" />
<p:column
headerText="User Name"
priority="1">
<h:outputText value="#{user.name}" />
</p:column>
<p:column
headerText="Descripton"
priority="2">
<h:outputText value="#{user.description}" />
</p:column>
</p:dataTable>
</h:form>
</p:dialog>