Client-side validation

Hello,
I am trying to do client-side validation using the JSF.
I would like to know if it is possible, if JSF furnishes some help to do it...
If someone have some examples, it would be a great help.
Thanks,
Marie.

Thank you very much for the link.
I read the document but it did not completely solve my problem. Indeed, all the examples are about a client-side validation at the submit phase. And I am trying to do a client-side validation on the focus lost of each field.
I know that I can do it by adding the attribute focusLost on the field and by adding the javascript corresponding to the validation of this field. But I would to make this validation automatic, and for that, I suppose that I need to make generate the javascript by a component. This step gives me some problems.
Is it possible for a UIComponent to generate Javascript code that will be written at the end of the component?
Thanks for your help
Marie.

Similar Messages

  • How to Disable client side validation for the message text input

    Hi,
    I have scenario where i need to by pass the client side validation for a message text input
    Scenario is
    I have a message text input field(say XYZ), i set the max length for the item as 20
    Now when im trying to enter the greek characters into it, it is allowing me to enter till 20 characters
    But when i try to submit the form ..my client side validation is firing..
    The Error says the XYZ is too long
    The problem is, in greek each character takes two bytes.(In english it is only 1).While entering the content it allowing 20 characters and when validating it is checking for bytes(if we enter in greek the length will be 40 bytes not 20)
    I cannot increase the max length .coz i have restrict the character length to 20 only.(english or Greek).
    Please help me in this regard.
    Regards
    Sandeep.

    Thanks for the information.But we dont have any option either declaratively or programatically to disable the client side validation for the message text input..I referred java docs ..i dint find any method which does..
    Correct me if im wrong

  • Af:query client side validation

    Hello,
    I have an application with 2 ViewObjects (based on SQL), each with its own ViewCriteria. I have 2 pages, each containing 1 of the ViewCriteria as af:query with results table. Each ViewCriteria has a number of fields, all f which are selectively required.
    Now, when I go to page A, leave all fields empty and hit 'search', my fields get marked immediately as 'you need to enter at least one of the criteria'. No server request, just pure client validation, as you'd expect. Now we go to page B, doing exactly the same (empty fields, search). I see a lot of activity now, a server request, a query executed, and then a stacktrace saying 'at least 1 attribute is required'. In the front end, I also get a popup saying I have to enter at least 1 value.
    Does anyone have any idea why the validation for both af:query components is different? Both ViewObject look the same to me, with same properties and attributes set.
    Thanks in advance,
    Stijn.

    Thanks for the reply, Vinod.
    The problem still persists, though. We're working with version 11.1.3 (where the issue should be fixed), and it doesn't happen every time. 8 out of 10 af:query-components we use go to the server before validating the input, resulting in a popup. The other 2 do client-side validation and immediately tell you to fill in the blanks (which is the behaviour we want)...

  • STRUTS: client-side validation in jsp using  DynaValidatorForm

    I am supposed to work on struts on as project and it is like learning a crash course and work the next day.
    In Struts 1.1 enviroment, I am using DynaValidatorForm to create a bean form and then perform validation.
    1. I write a DynaValidatorForm definition in struts-config.xml
    2. I write xml for action so that when /getQuotes.do in invoked by a jsp form, the form data is put into the QuoteDetailsBean.
    3. add the plugin script for ValidatorPlugIn
    xml fragment from struts-config:
    //form bean
    <form-beans>
    <form-bean name="QuoteDetailsBean" type="org.apache.struts.validator.DynaValidatorForm">
        <form-property name="forename" type="java.lang.String"/>
       <form-property name="surname" type="java.lang.String"/>
    <form-bean>
    </form-beans>
    <action
            path="/getQuotes"
            type="com.kainos.quickquotes.struts.QQGetQuotesAction"
            validate="true"
            name="QuoteDetailsBean"
            input="/userform1.do"
            parameter="save"
            scope="session">
            <forward name="success" path="/pages/jsp/result.jsp"/>
            <forward name="back" path="/userform1.do"/>
    </action>
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
         <set-property
             property="pathnames"
             value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
      </plug-in>Now I write a validation code for getQuotes.do. note that I can write the validation code with
    <form name="QuoteDetailsBean"> but this form bean is shared by many jsp, so i am using the name of the action
    (getQuotes) as the name of the form in the validation.xml.
    So far this looks okay, as I am going by some example.
    xml fragment from validation.xml:
    <formset>
              <form name="/getQuotes">
                 <field property="forename" depends="required,minlength">
                    <arg0 key="QuoteDetailsBean.forename" />
                    <arg1 name="minlength" key="${var:minlength}" resource="false"/>
                    <var>
                       <var-name>minlength</var-name>
                       <var-value>2</var-value>
                    </var>
                 </field>
                 <field property="surname" depends="required,minlength">
                <arg0 key="QuoteDetailsBean.surname" />
                <arg1 name="minlength" key="${var:minlength}" resource="false"/>
                <var>
                   <var-name>minlength</var-name>
                   <var-value>2</var-value>
                </var>
                 </field>
    </formset>Now I write the JSP. I use the <html:javascript> tag to allow front-end validation based on the xml in validation.xml.
    The jsp code:
    <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
    <%@ taglib uri="/tags/struts-html" prefix="html" %>
    <%@ taglib uri="/tags/struts-logic" prefix="logic" %>
    <html:html locale="true">
    <head>
    <title><bean:message key="welcome.title"/></title>
    <html:base/>
    <html:javascript formName="/getQuotes"
                method="validateForm"
                dynamicJavascript="true"
                staticJavascript="false"
                cdata="false" />
    </head>
    <body bgcolor="#FFCC9F">
    <html:errors />
    <html:form action="getQuotes.do" onsubmit="return validateForm(this);" >
    Forename:</td> <td>���<html:text property="forename"/></td></tr>
    <tr> <td>Surname:</td> <td>���<html:text property="surname"/></td></tr>
    <html:submit value="Quotes" /></td></tr>
    </html:form>
    </body>
    </html:html>Does this looks okay. I wrote so far based on some tutorials n help online.
    Now when I open the JSP and then do a submit, there is no validation (I tried by submitting with empty forename and surname. I mean i could invoke the action class and the invoke class
    redirects(forwards) to the appropriate path. so the code works fine except validation is not done
    Q1. So what should i do more to get client-side validation?
    What actually happens in client-side validation? does a pop up alert appears?
    nothing happens so far in my case.
    Q2. What should I do more for server side validation. Since the form is incomplete, what happens?
    I thought the same form returns and the error messages are printed in the jsp page since i have the <html:errors />
    tag just below the <body> tag.
    The action class is pretty simple so far:
    public class QQGetQuotesAction extends Action {
        public QQGetQuotesAction(){
    public ActionForward execute(ActionMapping mapping,
                 ActionForm form,
                 HttpServletRequest request,
                 HttpServletResponse response)
        throws Exception {
            DynaValidatorForm dynaform = (DynaValidatorForm)form;
            System.out.println("forename:"+dynaform.get("forename");
            System.out.println("surname:"+dynaform.get("surname");
            return forward=mapping.findForward("back");
    }Please help me out. I think I am missing something which i need to do
    thanks
    Tanveer

    I think the validations are to be declared on the form
    name and not the action path.
    Your formName is QuoteDetailsBean but your are using
    the action path(/getQuotes) both in the validation
    rules and the jsp tags. Use the formName on both the
    places.
    Also your html:javascript tag will not generate the
    static javascript to validate the fields. For this you
    will have to add code like below.
    <html:javascript dynamicJavascript="false"
    staticJavascript="true"/>
    Other options is to set the attribute
    staticJavascript="true" in your html:javascript tag.
    Hope it helps.hi
    staticJavascript="true" did the trick. :)
    I think the validations are to be declared on the form name and not the action path.It is not necessary. You can declare the validation on the action class. This is essential if a form bean is shared by several JSPs having its own action class. This is as per as I read in a tutorial and it works.

  • Client side validation in struts using validation framework

    Hi ,
    am new to struts.....
    I want to validate a simple login page using struts validation framework...
    For that i created,
    login.jsp ( contains html:errors and html:javascript and onsubmit)
    LoginForm extends ValidatorForm
    LoginAction
    resource bundles
    validation.xml ( required, minlength and maxlength rules for both fields)
    struts-config.xml ( configured action mapping and form beans)
    whats my problem is....
    i will get error messages through server side validation...
    i cant able to get the error messages using javascript i.e alert messages.
    i seen the page resource in that all javascript functins are inserted.
    on seeing the javascript error console... it shows
    formName has no properties...............
    exactly at this line
    oRequired = eval('new ' + formName.value + '_required()'); //function validateRequired(form)

    Thanks for your valuable reply.....
    Ya of course what you said was correct....
    I got error messages while submitting the form without any value....
    error messages are displayed using the <html:errors/> tag (server side validation ).
    But it fails to show the alert messages for those errors ( client side validation).
    i inserted the <html:javascript formName="form bean name" /> tag in the bottom of my login jsp.....
    on seeing the error console, it shows formName has no properties.
    Could anybody help me to sort out this problem........

  • Client side validations in web dynpro

    Hi experts,
    can anybody tell me How we perform client side validations in web dynpro ?
    Thanks,
    Prasad.

    Hi Prasad,
    Validations are generally required during some events or calls to a functions. So there are bascially two ways:
    1) You do the validation is the onActionEvent of the UI element. However this is some time time is not a right approach (depends upon your scenario).
    2) There is another method called wdDoBeforeAction(). Do all you validations for the actions in this method. read the java doc for the same functions, here:
       * Hook method called for additional validation of user input. <p>
       * @param validation Interface for reporting validation errors
    You can catch the particualr action in this emthod and then can write you validation code before the action is called.
    For gettiong the action use this code:
    if(validation.getCurrentAction().equals(IPrivate<Your_View_Name>.WDActionEventHandler.<ACTION_NAME>)){
    // write your validation code here.           
    I hope this will help you. Please revert back in case you have further issues.
    Thanks and Regards,
    Pravesh

  • Struts 2 Client side validation getting skipped.

    I am doing a simple program using struts 2. Usually in struts2 bean class will be combined with action class unlike in struts 1.2. But for enhancing readability I made a seperate bean class and I reference it in my action class. But after seperating bean from action class Client side validation using xml is not happening. It is getting skipped. But server side validation inside execute() is happening. Will anyone please help me to find a solution to make client side validation run.
    here are the different files.
    1) JSP File - SEmail.jsp
    <%@ taglib prefix="s" uri="/struts-tags"%>
    <html>
    <s:head theme="ajax" />
    <title>SEmail </title>
    <body>
    <center><font color="blue" size="5" face="bold">
    <s:label     value="Secure Email - Non Registered User" /> </font></center>
    <br>
    <font color="red" size="3"> <s:label
         value="Want to contact us?."></s:label>
    </font>
    <center><s:form action="/Semail.action" method="POST"
         validate="true">
         <s:actionerror />
         <s:select label="Topic" name="user.topic" headerKey="-1" required="true"
              list="#{'Plan Coverage':'Plan Coverage','Sales':'Sales','Others':'Others'}">
         </s:select>
         <s:textarea name="user.message" label="Message" rows="4" cols="50"
              required="true" />
         <br>
         <s:label value="Contact Information" />
         <br>
         <table align="center" width="500">
              <tr align="left">
                   <td align="left"><s:select label="Title" name="user.title"
                        headerKey="-1" required="true"
                        list="#{'-- Select One --':'-- Select One --','Mr.':'Mr.','Ms.':'Ms.','Mrs.':'Mrs.'}">
                   </s:select></td>
              </tr>
              <tr align="left">
                   <td align="left"><s:textfield label="First Name"
                        name="user.firstname" size="20" maxlength="35" required="true" /></td>
              </tr>
              <tr align="left">
                   <td align="left"><s:textfield label="Family Name"
                        name="user.familyname" size="20" maxlength="35" required="true" /></td>
              </tr>
              <tr align="left">
                   <td align="left"><s:textfield label="Profession"
                        name="user.profession" size="20" maxlength="20" /></td>
              </tr>
              <tr align="left">
                   <td align="left"><s:textfield label="Address" name="user.address"
                        size="20" maxlength="100" /></td>
              </tr>
              <tr align="left">
                   <td align="left"><s:textfield label="Telephone Number"
                        name="user.telnumber" size="20" maxlength="20" /></td>
              </tr>
              <tr align="left">
                   <td align="left"><s:textfield label="P.O. Box" name="user.pobox"
                        size="20" maxlength="8" /></td>
              </tr>
              <tr align="left">
                   <td align="left"><s:textfield label="City"
                        name="user.emirate" size="20" maxlength="35" required="true" /></td>
              </tr align="left">
              <tr>
                   <td align="left"><s:textfield label="Region and Country"
                        name="user.country" size="20" maxlength="35" /></td>
              </tr>
              <tr align="left">
                   <td align="left"><s:textfield label="E-mail Address"
                        name="user.email" size="20" maxlength="70" required="true" /></td>
              </tr>
         </table>
         <br>
         <s:file name="user.uploadFile" label="Upload Document" />
         <br>
         <br>
         <s:submit value="Submit" align="center"></s:submit>
    </s:form></center>
    <font color="red" size="3"> <s:label
         value="All fields marked (*) are mandatory."></s:label>
    </body>
    </html>
    2) struts.xml
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
    <struts>
         <package name="semail" extends="struts-default">
              <action name="Semail" class="semail.NonregUser">
                   <result name="input">/SEmail.jsp</result>
                   <result name="error">/SEmail.jsp</result>
                   <result>/SEmail.jsp</result>
              </action>          
         </package>     
    </struts>
    3) Bean Class - User.java
    package semail;
    public class User {
         private String topic;
         private String message;
         private String title;
         private String firstname;
         private String familyname;
         private String profession;
         private String address;
         private int telnumber;
         private String pobox;
         private String city;
         private String country;
         private String email;
         private String uploadFile;
         private String testing;
         public String getTopic() {
              return topic;
         public void setTopic(String topic) {
              this.topic = topic;
         public String getMessage() {
              return message;
         public void setMessage(String message) {
              this.message = message;
         public String getTitle() {
              return title;
         public void setTitle(String title) {
              this.title = title;
         public String getFirstname() {
              return firstname;
         public void setFirstname(String firstname) {
              this.firstname = firstname;
         public String getFamilyname() {
              return familyname;
         public void setFamilyname(String familyname) {
              this.familyname = familyname;
         public String getProfession() {
              return profession;
         public void setProfession(String profession) {
              this.profession = profession;
         public String getAddress() {
              return address;
         public void setAddress(String address) {
              this.address = address;
         public int getTelnumber() {
              return telnumber;
         public void setTelnumber(int telnumber) {
              this.telnumber = telnumber;
         public String getPobox() {
              return pobox;
         public void setPobox(String pobox) {
              this.pobox = pobox;
         public String getCity() {
              return city;
         public void setCity(String city) {
              this.city= city;
         public String getCountry() {
              return country;
         public void setCountry(String country) {
              this.country = country;
         public String getEmail() {
              return email;
         public void setEmail(String email) {
              this.email = email;
         public String getUploadFile() {
              return uploadFile;
         public void setUploadFile(String uploadFile) {
              this.uploadFile = uploadFile;
         public String getTesting() {
              return testing;
         public void setTesting(String testing) {
              this.testing = testing;
    This is my bean class. Instead of putting it with action class NonregUser.java , I have seperated it out for readability. And I am referencing it in the action class.
    4) Action Class - NonregUser.java
    package semail;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts2.interceptor.ServletRequestAware;
    import org.apache.struts2.interceptor.ServletResponseAware;
    import com.opensymphony.xwork2.ActionSupport;
    public class NonregUser extends ActionSupport implements ServletRequestAware,
              ServletResponseAware {
         private static final long serialVersionUID = 2451855813074437309L;
         HttpServletRequest request = null;
         HttpServletResponse response = null;
         private User user = null;
    /* I am referencing my bean class here instead of writing all the getters and setters here.*/
         public User getUser() {
              return user;
         public void setUser(User user) {
              this.user = user;
         public String execute() throws Exception {
              System.out.println("Validating login");
              if(user!=null){
                   System.out.println(user.getFirstname());
                   System.out.println(user.getEmail());
                   System.out.println(user.getTopic());
                   System.out.println(user.getTitle());
    // this server side validation is happening
                   if (user.getTitle().trim().equals("-- Select One --")) {
                        addActionError("Please select Title");
                        return ERROR;
                   } else {
                        return SUCCESS;
              }else{
                   return SUCCESS;
         public void setServletRequest(HttpServletRequest arg0) {
              System.out
                        .println("HttpServletRequest : " + NonregUser.this.getClass());
              request = arg0;
         public void setServletResponse(HttpServletResponse arg0) {
              System.out.println("HttpServletResponse : "
                        + NonregUser.this.getClass());
              response = arg0;
    This is my acation class. Here I am referencing my bean class User.java.
    5) xml validation file - NonregUser-validation.xml
    /*This client validatin is not working*/
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE validators PUBLIC
              "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
              "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
    <validators>
         <field name="topic">
              <field-validator type="requiredstring">
                   <param name="trim">true</param>
                   <message>Please select the Topic</message>
              </field-validator>
         </field>
         <field name="message">
              <field-validator type="requiredstring">
                   <param name="trim">true</param>
                   <message>Please enter Message</message>
              </field-validator>
              <field-validator type="stringlength">
                   <param name="maxLength">8000</param>
    <message>Message cannot contain more than 8000 characters</message>
              </field-validator>
         </field>
         <field name="title">
              <field-validator type="requiredstring">
                   <param name="trim">true</param>
                   <message>Please select the Title</message>
              </field-validator>
         </field>
         <field name="firstname">
              <field-validator type="requiredstring">
                   <param name="trim">true</param>
                   <message>Please enter First name</message>
              </field-validator>
              <field-validator type="stringlength">
                   <param name="maxLength">35</param>
    <message>First Name cannot contain more than 35 characters</message>
              </field-validator>
         </field>
         <field name="familyname">
              <field-validator type="requiredstring">
                   <param name="trim">true</param>
                   <message>Please enter Family name</message>
              </field-validator>
              <field-validator type="stringlength">
                   <param name="maxLength">35</param>
    <message>Family Name cannot contain more than 35 characters</message>
              </field-validator>
         </field>
         <field name="emirate">
              <field-validator type="requiredstring">
                   <param name="trim">true</param>
                   <message>Please enter Emirate/City</message>
              </field-validator>
         </field>
         <field name="email">
              <field-validator type="requiredstring">
                   <param name="trim">true</param>
                   <message>Please enter Email address</message>
              </field-validator>
              <field-validator type="email">               
                   <message>Please enter a valid Email address</message>
              </field-validator>
         </field>
    </validators>
    6) web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app>
         <filter>
         <filter-name>struts2</filter-name>
         <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
         </filter>
         <filter-mapping>
         <filter-name>struts2</filter-name>
         <url-pattern>/*</url-pattern>
         </filter-mapping>
         <welcome-file-list>          
              <welcome-file>/SEmail.jsp</welcome-file>
         </welcome-file-list>     
         <error-page>
    <error-code>404</error-code>
    <location>/pagenotfound.jsp</location>
    </error-page>
    <error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/error.jsp</location>
    </error-page>
    </web-app>
    Edited by: L-J-K on Jul 22, 2008 5:22 AM

    I was trying to do it through creating a new validators.xml where I would redefine all struts built in validations and add de definition for my custom Validation (<validator name="checkUser" class="com.custom.CustomUserValidator"/>). Then I define the ActionClassName-action-validation.xml refering to my custom validator (checkUser). The com.custom.CustomUserValidator Class has to extend FieldValidatorSupport or ValidatorSupoort (depending on what kind of validation).
    Ok that's it, this is the theory, now the custom validator (checkUser) is executed before my action but I don't know how to do it so that if the validation fails i return to the same page showing the error message to the user without having to execute the target action. Does anyone know how to do this????

  • ADF validator or JavaScript for client side validation ?

    using JDev and ADF 11g
    Problem description : To apply validations such as date range check, pattern matching, maxlength etc.. on ADF Faces Components.
    Solution 1: Use ADF validator such as Reg Expr validator, Max Length validator
    Souliton 2: Write Javascript code for validating the component's value at cleint side.
    When using ADF Validator for such type of validation checking, a request is send to the server for processing (additional overhead) . However we can do such validations with javaScript functions without the need to interact with the server. So, what benefit does ADF Validator serves when one needs to implement such validations ?
    Please share your views...

    H,
    afaik, client side validation in ADF Faces suppresses server round trips if a validation error is detected on the client. Only if no problem is found, the server side validation is challenged upon submit (so no extra round trip for validation). Shay is absolutely correct. JavaScript is a convenience but never a solution.
    Here's how to create a custom validator with a client and server side implementation : http://download.oracle.com/docs/cd/E15523_01/web.1111/b31973/af_validate.htm#BABEIIDD
    Frank

  • How to make client side validations using NWDS

    Hi Frndz..
                   Am creating UIs using NWDS ,i made tthe validations @ servr side n i have 2 made this validations @ clinet side ,but am not aware how it is????
    can anyone help me in this regard.
    THANKS & REGARDS
    Rajesh Kumar

    chk it
    /people/martin.kellermann2/blog/2006/12/17/client-side-input-validation-with-htmlb--the-basics
    http://help.sap.com/saphelp_nw04/helpdata/en/43/067941a51a1a09e10000000a155106/frameset.htm
    /people/kirupanand.venkatapathi2/blog/2005/12/18/client-side-validation-in-dynpage
    http://help.sap.com/saphelp_nw04s/helpdata/en/8e/e3a942ad920c31e10000000a1550b0/frameset.htm
    /thread/86123 [original link is broken]
    https://media.sdn.sap.com/html/submitted_docs/dotnet/Programming%20with%20PDK%20for%20.NET/SAP%20NetWeaver%20.NET%20Controls/Event%20Handling/Client%20Side%20Event%20Handling.htm

  • How U Perform Client Side Validations In Webdynpro?

    Hi experts,
    explain me abt How U Perform Client Side Validations In Webdynpro?
    Thanks in advance
    Sreenivas

    Hi ,
    As the javascripts used for client side validations are not supported in Webdynpro, All the validation written in a code take a complete cycle at runtime.
    You need to write the validations in the corresponding eventhandler i.e. action.
    Regards
    Deepak

  • How to get client side validation for double range and double field in stru

    Hi,
    I have achieved client side validation by using <html:javascript formName=""/>
    All fields shows client side validation but double field and double range field is not shows client side validation but shows server side validation.
    I am using Liferay jboss server.
    Please tell me a way to achieve client side validation for double field and double range.
    Thanks & Regards,
    Brijesh Baser

    I see in the query component there is a QueryListener and a QueryOperationListener. Have you tried letting Jdeveloper create methods for these in some backing bean, and putting in some debug code to see when these methods run? I would think one of them could very well be used to validate the input, somehow; if the input were bad you could just raise an exception and pass your error message, I bet.
    If not...
    I am pretty sure that there is an appendix in the Fusion Developer's Guide for Forms developers turned to Java...you might look at what it says for post query. I know in the 10.1.3.0 equivalent documentation, they gave reference to a method in the ViewObject which fired for each record after a query was run. You could definitely intercept this query return from there. In fact doing something like this may be something like what Frank N. was intending when he mentioned ViewObjects "validation". Not sure though. I am still learning what new features there are in 11g adf/bc.
    Good luck.

  • Client side validation in J2SE (Desktop applications)

    Hi,
    I am new to J2SE(desktop applications). I created a GUI screen with the help of Swing. I would like to add some client-side validation to my GUI e.g Required field validator, regular expression validator etc. Can you please provide me with some sample code?
    Regards,
    ap.

    Regular Expressions - http://java.sun.com/docs/books/tutorial/essential/regex/
    For required fields, just don't allow the user to continue unless getText() on the field returns appropriate data.

  • Problem with Client Side Validator - e.getFacesMessage is not a function

    (JDeveloper 11g, TP2 and TP3)
    I have created a custom validator that does server side validation as well as client side validation. It gets invoked - an alert is fired to prove that - but when validation fails, instead of the red box and error message that I was hoping for, I get a JavaScript error:
    e.getFacesMessage is not a function (all-11-otn2.js (line 27600))
    The getClientScript() method in the validator looks like this:
        public String getClientScript(FacesContext facesContext,
                                      UIComponent uIComponent) {
            return "function GreaterThanValidator(p1)\n" +
            "{  this.greaterThanItem=p1; \n" +
            "}\n" +
            "GreaterThanValidator.prototype.validate = function(value){" +
                           "alert('value= '+value); " +
            " if (!(value=='X')){ " +
            "    return new ValidatorException('Value must not be X '" +
            "         +' (current value = '+value+')');}"+
        }   Can someone tell me what I am doing wrong here? Like I said, the validation is performed, the alert is shown. Then when I raise the ValidatorException, the error occurs.
    thanks for any suggestions.
    Lucas
    Message was edited by:
    Lucas Jellema
    Message was edited by:
    Lucas Jellema
    Message was edited by:
    Lucas Jellema

    Lucas,
    I assume that this post is related to the previous
    Display client side validation error message with the pretty box
    I forwarded this internally and am waiting for a hint. Will update this post accordingly (or someone else will do directly)
    Frank

  • Client Side Validations in Visual Composer possible Or Not?

    Hi All,
    I Want To Know Client Side Validations Possible in Visual Composer.
    Because I Write Validate Code For input Field.They Give Only Red Color Message To inputField WhatEver I Gave In Condition Error Message.They Do N't Validate the InputFileds.But They give Suggession Only.
    Please Respond ASAP.
    SubbaRao Chinta

    Hi SubbaRao,
    Although the WebDyn Pro runtime of VC does not perform "true" client side validations, the conditions that a modeler enters on a given control can prevent unnecessary requests to the back end. In order to add such a rule to a control you need to:
    1. Choose Configure on the context menu of the control you want to validate
    2. Select Rules in the Validation group of the task panel. This will open the Define Validation Rules dialog box.
    3. Click the Add Row button, and then open the Condition drop down list, and add the condition you want (to prevent).
    4. In the Error Message column, enter the text you want to display when this condition occurs.
    If you have an action defined in the same view, it will not be carried out if the condition is true.
    If your action is defined in a different view, you need to change the action's validation scope - go into the Define Action dialog and the validation tag, and change the validation scope to "window"
    If none of this helps, try to describe what you have done and I'll see if I can help.
    Good luck,
    Eyal

  • Client side Validation - regd

    Hi all,
    How do v perform client side validations? How do v do it in VC7? for eg, if i make multiple selection in one control, the other control should be disabled. Do v have to code for the validations or is there any configuration available? If it has to be coded could u giv me a sample one?

    Hi Pavithra Ramachandran,
    you can use validations. There is the possibility to use the formula editor for your validation rules.
    Best Regards,
    Marcel

Maybe you are looking for