我有简单的用户搜索应用程序。首次点击时,数据未加载或表单未提交。
<p:inputText id="search" value="#{userview.search}" label="search"
style="margin-right:30px;font: 13px verdana,helvetica,arial,sans-serif;line-height: 21px;color: #000;
text-decoration: none;width:320px;height:20px;" />
<p:watermark for="search"
value="Enterprise Username/ Firstname/ Lastname" id="watermark" />
<p:commandButton value="Search" id="ajax1"
action="#{userview.searchResult}" update="formId"
style="font-size: 16px;background-color: #007a67; color: initial;text-shadow: none;
font-weight: 600;" />
<p:dataTable var="user" value="#{userview.users}" id="searchData"
rendered="#{userview.users!=null}" style="margin-top:20px"
filteredValue="#{userview.users}"
paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
rows="10" paginator="true" rowsPerPageTemplate="5,10,15">
<p:column headerText="Enterprise Username"
style="width:150px">
<h:outputText value="#{user.userid}" />
</p:column>
答案 0 :(得分:-2)
我的建议:设置p:commandButton属性ajax = false,删除更新属性,在页面中放置h:messages,单击该按钮,您将看到错误