【发布时间】:2014-11-25 03:30:10
【问题描述】:
我需要跳过h:form 中的输入组件,以免其被处理/提交,因为它仅用于纯粹的演示需求,并且不会向任何 bean 字段提交值。如何在提交表单时禁用其提交以及其他表单输入?
<h:form>
<!--other input components-->
<p:selectOneListbox id="deptsSel">
<f:selectItems value="#{listRetriever.list}"
var="dept" itemLabel="#{namesDirectory.getName(dept)}" itemValue="#{dept}" />
</p:selectOneListbox>
<!--other input components-->
</h:form>
我省略了 p:selectOneListbox 的 value 属性,但在提交表单时它仍然给出验证错误:“deptsSel: Validation Error: Value is not valid”
【问题讨论】:
-
看起来像 stackoverflow.com/questions/12614882/… 的副本。
-
你为什么担心它?如果您没有在 bean 中使用该组件,请不要理会它
-
你用什么提交表单,命令按钮?
-
@BalusC:你删除了你的答案,所以我担心如果我要求一些不可行的东西,或者是吗?
-
我意识到我误解了您的评论。我会更新答案。
标签: jsf jsf-2 primefaces