JSF页面逻辑处理出错
我有个用户编辑页面,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重复 ,这种情况如何处理呢?
因为编辑用户和新增用户共用这个页面,所以用户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重复 ,这种情况如何处理呢?
...全文
相关推荐
CSS、JavaScript 和 JSF 精心打造 Ajax 应用
CSS、JavaScript 和 JSF 精心打造 Ajax 应用,需要的朋友可以去下载。
jsf-api-2.0.3.jar.zip_jsf api_jsf jar包_jsf-api-2.0.3.jar_jsf-api
tomcat里的jar 包,在项目启动时缺少包
jsf2(primefaces3)+spring+hibernate案例下载
NULL 博文链接:https://klxwcx.iteye.com/blog/1006360
prettyfaces-2.0.4-reference.pdf
prettyfaces-2.0.4-reference.pdf
JSP程序设计从入门到精通 word版
本书主要关注的是JSP动态网页技术标准及其应用,详细介绍了JSP技术的内置对象、文件使用、基础数据库应用,JSP与JavaBean组件和Servlet技术,JSP技术的MVC模式中常用的Struts框架与JSF框架;并且以实例的方式介绍了Web联机查询系统的实现,网络购物系统的实现,Struts技术在IT虚拟社区中的实现。 本书结构合理、内容翔实,适合有一定基础的网络开发人员和网络爱好者以及大中专院校的师生阅读与参考。


