嗨,根据我的要求,有一个 h:inputtext 来查找用户。如果找到用户,它会在相应的 h:inputtext 中填充名字、姓氏和电子邮件,这是禁用的。但如果没有发现 inputtext 应该启用并且可以填写新的详细信息。
<h:inputText value="#{countryBean.usersDetailsDTO.eid}" id="eid" required="true" requiredMessage="Enter EID">
<f:ajax></f:ajax>
</h:inputText><h:message styleClass="msgStyle4" id="msgEid" for="eid"/>
</div>
<h:commandButton styleClass="search_btn" immediate="true">
<f:ajax listener="#{countryBean.getUserDetail}" render="empFName empLName empEmail" event="click" execute="@this" />
</h:commandButton>
<div class="clear"> </div>
<div class="form-field" style="margin-left:222px;">
first Name <h:inputText value="#{countryBean.usersDetailsDTO.firstName}" id="empFName" required="true" requiredMessage="Enter First Name">
<f:validator validatorId="nameValidation" />
</h:inputText><h:message styleClass="msgStyle4" id="msgfn" for="empFName"/>
</div>
<div class="clear"></div>
<div class="form-field" style="margin-left:10px;">
last name <h:inputText value="#{countryBean.usersDetailsDTO.lastName}" id="empLName" required="true" requiredMessage="Enter Last Name">
<f:validator validatorId="nameValidation" />
</h:inputText><h:message styleClass="msgStyle4" id="msgln" for="empLName"/>
</div><div class="clear"></div>
<div class="form-field" style="margin-left:10px;">
email<h:inputText value="#{countryBean.usersDetailsDTO.email}" id="empEmail" required="true" requiredMessage="Enter Email Address">
<f:validator validatorId="emailValidation" />
</h:inputText><h:message styleClass="msgStyle4" id="msgEmail" for="empEmail"/>
</div>