我找到了答案。它在抱怨
value
属性。
我已经改变了
userN
userNameT
成为
String
然后把他们转移到
所有物我还将两个新命名的组件添加到
binding
<f:facet name="body">
<ice:panelGrid columns="3">
<ice:outputText value="User Id"></ice:outputText>
<ice:inputText id="CreateNewUserPopUp-UserId" binding="#{menuBean.userPanel.userInputN}" action="#{menuBean.userPanel.checkUserId}"
disabled="#{menuBean.userPanel.validUserId and !menuBean.userPanel.userIdExists}" maxlength="30"
value="#{menuBean.userPanel.userN}">
</ice:inputText>
<ice:message for="CreateNewUserPopUp-UserId" id="CreateNewUserPopUp-UserIdMessage" style="color: Red; font-style: italic; font-size: 12px;"/>
<ice:outputText value="User Name"></ice:outputText>
<ice:inputText id="CreateNewUserPopUp-UserName" binding="#{menuBean.userPanel.userNameInputT}"
disabled="#{!menuBean.userPanel.validUserId or (menuBean.userPanel.validUserId and menuBean.userPanel.userIdExists)}"
style="width:300px" maxlength="30"
value="#{menuBean.userPanel.userNameT}">
</ice:inputText>
<ice:message for="CreateNewUserPopUp-UserName" id="CreateNewUserPopUp-UserNameMessage" style="color: Red; font-style: italic; font-size: 12px;"/>
...
...
</ice:panelGrid>
</f:facet>
我在Java类中添加了2个新的HtmlInputText组件
private HtmlInputText userNameInputT;
private HtmlInputText updateUserNameInputT;
private String userN;
private String userNameT;
更新了初始化字段的方法
public void clearNewUser()
{
setValidUserId(false);
setUserIdExists(false);
setUserN("");
setUserNameT("");
...
...
getUserInputN().requestFocus();
}
更新了请求焦点的验证代码,并更改了用于
.getValue().toString()
在输入字段上。因为它们现在是字符串,所以不需要这样做。
public void checkUserId()
{
...
...
if (getUserN().trim().length() < 1)
{
setMessage("User Id required");
}
else
{
...
...
else
{
setValidUserId(true);
setUserIdExists(false);
getUserNameInputT().requestFocus();
setMessage("Please Enter User Details");
}
}
}