JSF页面逻辑处理出错

ladofwind ladofwind 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我有个用户编辑页面,editUser.xhtml,

因为编辑用户和新增用户共用这个页面,所以用户ID需要在编辑状态设置成只读.

<h:inputText styleClass="midInput" disabled="true" value="#{userBean.user.userId}" rendered="#{userBean.type == 'update'}" id="userId" required="true" requiredMessage="用户ID不能为空" maxlength="8">
<f:validateLength minimum="1" maximum="8" />
</h:inputText>

<h:inputText styleClass="midInput" value="#{userBean.user.userId}" rendered="#{userBean.type == 'add'}" id="userId" required="true" requiredMessage="用户ID不能为空" maxlength="8">
<f:validateLength minimum="1" maximum="8" />


得到异常:

java.lang.IllegalStateException: component with duplicate id "editForm:userId" found

Caused by:
java.lang.IllegalStateException - component with duplicate id "editForm:userId" found


说userId重复 ,这种情况如何处理呢?

...全文
评论 14
收藏 已收藏
分享
返回顶部
ladofwind
Java EE 67,535 成员 225,843 内容