开发者

richfaces 4 client side validation problem

开发者 https://www.devze.com 2023-03-09 05:17 出处:网络
I have a problem with richfaces client side validation. Here is my xhtml page sample ; <h:form id=\"deneForm\">

I have a problem with richfaces client side validation. Here is my xhtml page sample ;

<h:form id="deneForm">
<rich:panel>

<h:panelGrid columns="2"> 
<h:inputText value="#{denemeBean.name}" id="name"  required="true" req开发者_StackOverflow社区uiredMessage="Not null please">
                    <f:validateLength minimum="3" maximum="8" />
                    <f:validateRequired />
                    <rich:validator />
                </h:inputText>
                <rich:message for="name" />
                <h:outputText value="Email" />

                <h:outputText value="Age" />
                <h:inputText value="#{denemeBean.age}" id="age" required="true" requiredMessage="Not null please">
                    <f:validateLongRange minimum="18" maximum="99"/>
                    <rich:validator />
                </h:inputText>
                <rich:message for="age" />

</h:panelGrid>

<h:commandButton  value="Submit" action="#{denemeBean.success}"> </h:commandButton>
</rich:panel>
    </h:form>

when I write values to textboxes, i can see validation errors, but when i press Submit button, client side script isnt activated and form is submitted anyway. Server side validation starts and says "Not null please". How can I trigger client side validation on pressing submit button?

using : mojarra 2, richfaces 4


Client-side validation doesn't get invoked when clicking a button. This feature is not supported yet.

0

精彩评论

暂无评论...
验证码 换一张
取 消