我在我的应用程序中使用了icefaces。 页面中有一个表单,它有几个输入字段。只有在所有其他组件都无错时启用JSF commandbutton
我想使命令按钮只有在字段有效(对其他组件没有错误)
是否有可能做到这一点?
示例代码
<ice:form>
<ice:panelGrid columns="2">
<ice:outputLabel>Enter Date</ice:outputLabel>
<ice:panelGroup>
<ice:selectInputDate renderAsPopup="true" id="InputDate" value="#{Bean.FormDate}" partialSubmit="true" ></ice:selectInputDate>
<ice:message for="InputDate" />
</ice:panelGroup>
<ice:outputLabel>Days</ice:outputLabel>
<ice:panelGroup>
<ice:inputText value="#{Bean.days}"partialSubmit="true" id="inputDays">
<f:validateLongRange minimum="1" maximum="10"/>
</ice:inputText>
<ice:message for="inputDays"/>
</ice:panelGroup>
<ice:commandButton value="Submit" action="#{Bean.SomeAction}"></ice:commandButton>
</ice:panelGrid>
在上面的代码,我想启用提交命令按钮只有在天,日期是有效的(不要有任何错误排队。
我明白你要去哪里,但你知道IceFaces已经内置ajax支持吗? – BalusC 2011-02-17 03:10:59
我以前从来没有用过icefaces。 f:ajax可以被替换为冰面ajax函数。只是想说明这个概念。 – 2011-02-17 14:38:35