1. #1
    Ext User
    Join Date
    Dec 2010
    Posts
    1
    Vote Rating
    0
    Kishore.buturi is on a distinguished road

      0  

    Default NumberField Custom validation

    NumberField Custom validation


    Hi,

    I want to write a custom validator for NumberField by extending NumberFiled class.

    My Requirement is I have to display in the numberfield as "(Multiple)" string even though it does not allow to insert string from JSON response object.

    please can you help me in how to write a custom validation for NumberField to display string using extjs code whenevrer my numberfield containg the value as "(Multiple)" from JSON response object .


    Regards
    Kishore

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    89
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    I would use TextField as basis and not NumberField (otherwise you also need to revert the maskRe).

    Next, you need to override the validateValue and add your own validation.

  3. #3
    Ext User
    Join Date
    Dec 2010
    Posts
    1
    Vote Rating
    0
    koundinya is on a distinguished road

      0  

    Default


    I am a newbie in GWT/GXT world. I am trying to use a NumberField but I am getting ClassCastException.
    BTW, I am binding the fields with a JSON object.

    java.lang.ClassCastException
    : java.lang.String cannot be cast to java.lang.Number
    at com.extjs.gxt.ui.client.widget.form.NumberPropertyEditor.getStringValue(
    NumberPropertyEditor.java:1)
    at com.extjs.gxt.ui.client.widget.form.Field.setValue(
    Field.java:955)
    at com.extjs.gxt.ui.client.widget.form.TextField.setValue(
    TextField.java:415)
    at com.extjs.gxt.ui.client.binding.FieldBinding.updateField(
    FieldBinding.java:207)

    at com.extjs.gxt.ui.client.binding.FieldBinding.bind(
    FieldBinding.java:82)



  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    89
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Please ask GXT questions in the GXT forum.

Similar Threads

  1. NumberField in EditorGridPanel maxValue validation
    By irinarosu in forum Ext 3.x: Help & Discussion
    Replies: 12
    Last Post: 18 Nov 2012, 1:42 AM
  2. NumberField validation does not fire after override of afterRender
    By apachejo in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 19 Aug 2012, 11:50 PM
  3. [Firefox 2 / GXT 2.1.3] Numberfield validation
    By sdumas in forum Ext GWT: Discussion
    Replies: 4
    Last Post: 16 Jun 2010, 8:54 AM
  4. NumberField validation
    By alt_004 in forum Ext GWT: Discussion
    Replies: 0
    Last Post: 1 Jun 2009, 3:21 AM
  5. Validation of floating number in numberfield.
    By kckc1234 in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 17 Jan 2009, 3:15 AM

Thread Participants: 2

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..." hd porno faketaxi