1. #1
    Touch Premium Member
    Join Date
    Nov 2010
    Posts
    30
    Vote Rating
    0
    keithrust is on a distinguished road

      0  

    Default Answered: Noob: Form.isValid() returning: Uncaught TypeError: Object [object Object] has no met

    Answered: Noob: Form.isValid() returning: Uncaught TypeError: Object [object Object] has no met


    I'm using Designer 1.2.2 and I have a Panel with a series of forms. I want to validate that the required fields are filled in by form to enable or disable different buttons. I'm having a heck of a time trying to get isValid() to work, Chrome giving the error: Uncaught TypeError: Object [object Object] has no method 'isValid'.

    Code:
            this.down('#ProjectPath').isValid();
            return this.down('#ProjectPath').hasInvalidField();
    I'm using the first line to highlight any required fields and the second line to have the function return true or false if there are any invalid fields so I know whether or not to enable the buttons. Is this an issue of not getting a handle on the form properly? I've been using this.down('#<id>') successfully so far, but I am a newbie here...

    FYI, ProjectPath is the ID of the form I'm currently interested in checking for valid fields.

  2. You might want to query up to the window/panel component first before query.down to the form component. Also, you need to use the getForm() method in order to access the isValid() function.


    For example...
    PHP Code:
            var loginForm me.getAdminUIlogon().down('form').getForm();
            if(
    loginForm.isValid()){
                
    loginForm.submit({ /* ... code block */ });
            }
    //end if loginForm 
    In this example getAdminUIlogon is an automatic getter method for the window component that is nesting the form.panel. Rather than reference the form directly, I simply instruct the componentQuery to look for the form inside that window. Then get the form...

  3. #2
    Sencha Premium Member lorezyra's Avatar
    Join Date
    Dec 2007
    Location
    Japan -- 日本
    Posts
    634
    Answers
    8
    Vote Rating
    14
    lorezyra will become famous soon enough lorezyra will become famous soon enough

      0  

    Default


    You might want to query up to the window/panel component first before query.down to the form component. Also, you need to use the getForm() method in order to access the isValid() function.


    For example...
    PHP Code:
            var loginForm me.getAdminUIlogon().down('form').getForm();
            if(
    loginForm.isValid()){
                
    loginForm.submit({ /* ... code block */ });
            }
    //end if loginForm 
    In this example getAdminUIlogon is an automatic getter method for the window component that is nesting the form.panel. Rather than reference the form directly, I simply instruct the componentQuery to look for the form inside that window. Then get the form...
    Perfection as a goal is a nice idea that can point one in a specific direction. However, since "perfection" is an ever changing (evolving?) and moving target, one must admit that perfection can never be obtained...

    When in doubt, check the d4mn source code!
    ================================================
    And here are my terms...
    1. I don't care if you use my source code. (Known as "Code.")
    2. I don't care if I get any monetary compensation.
    3. I do care to receive credit for Code provided. So, please keep my name in the comments for Code provided.
    4. Code is provided without warranty "AS-IS" and I claim absolutely no warranty nor liability to the quality, security, and run-ability on any platform.
    5. By using Code, you accept all risk inherit with Code regardless if Code has known and yet to be discovered bugs.
    6. You are welcome to change and improve the Code to best meet your needs.
    7. I don't care if you use the Code in a commercial or open-source project.
    8. You are not required to contact me prior to using the Code.
    ================================================
    Simple. Enjoy.

  4. #3
    Touch Premium Member
    Join Date
    Nov 2010
    Posts
    30
    Vote Rating
    0
    keithrust is on a distinguished road

      0  

    Default


    Sweet! getForm() was the missing ticket. I've got a lot of reading to do...

Thread Participants: 1

Tags for this Thread

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