1. #11
    Sencha Premium Member Neilcoder's Avatar
    Join Date
    Apr 2011
    Location
    Ireland
    Posts
    262
    Vote Rating
    0
    Neilcoder is on a distinguished road

      0  

    Default


    thanks Col!

    I'm wondering with this approach;

    PHP Code:
        RegExValidator myEmailValidator = new RegExValidator("^(\\w+)([-+.][\\w]+)*@(\\w[-\\w]*\\.){1,5}([A-Za-z]){2,4}$""Email");
        
    email.getValidators().add(myEmailValidator); 

    Will I be able to use the validator multiple times? Or do I need a separate validator for an additional email CC field?

    PHP Code:
    emailCc.getValidators().add(myEmailValidator); 

  2. #12
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Why might you need more than one? Do you mean more than one instance? Assuming so, provided you aren't subclassing the validator and adding some state other than what is already there, you shouldn't need one.

    The existing state just covers bits like 'what is the regex', and 'what error message do we use'. If you customize one, and use the same validator in multiple cases, naturally they will all have the same values, whether or not this is what you intended.

  3. #13
    Sencha Premium Member Neilcoder's Avatar
    Join Date
    Apr 2011
    Location
    Ireland
    Posts
    262
    Vote Rating
    0
    Neilcoder is on a distinguished road

      0  

    Default


    Hi Colin,

    Yes more than one instance of the validator,

    I think that I was not sure at whether the re-use of the validator, would mean that if one field was validated then the others would also validate.

    Thanks for clearing this up.

    Neil

  4. #14
    Sencha User
    Join Date
    Apr 2013
    Posts
    29
    Vote Rating
    0
    kozla13 is on a distinguished road

      0  

    Default


    How can i make server side validation. For exepale if the email adress alredy exist ?

  5. #15
    Sencha Premium Member Neilcoder's Avatar
    Join Date
    Apr 2011
    Location
    Ireland
    Posts
    262
    Vote Rating
    0
    Neilcoder is on a distinguished road

      0  

    Default


    Hi, I don't know the best solution is in GXT for that.

    my guess is its based upon GWT serverside validation.

    http://www.gwtproject.org/doc/latest...alidation.html

    One idea I have as a simple solution would be to make the email address the key for you model that way you would get an exception thrown trying to add a record with the same key. However I sure there's a better way.

    Hope this helps until someone else can provide a better response.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."