1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    85
    Vote Rating
    1
    KallDrexx is on a distinguished road

      0  

    Default How do I find out when a FormPanel's form is accessible with getForm().getValues()?

    How do I find out when a FormPanel's form is accessible with getForm().getValues()?


    I have a panel that I am adding to my main TabPanel. The panel I am adding contains a FormPanel as one of it's items and inside the FormPanel I have a Name field. What I want to do is change the name of the Tab based on the name in the form field.

    The problem is that if I call the FormPanel's getForm().getValues() inside of the panel's initComponent, I get the following javascript error:

    Uncaught TypeError: Cannot read property 'dom' of undefined

    If I do this outside of initComponent (e.g. on a button press) everything works fine. After doing some testing, I think the issue is that the FormPanel isn't actually rendered yet (and thus the dom doesn't exist), getValues() fails. However, I can't seem to figure out a way to get my FormPanel's values from the Panel on load.

    I tried to listen for events. I tried:

    Code:
    this.detailForm.on('afterrender', function () { alert('test'); });
    but doing this showed that AfterRender is called prior to the form actually being rendered (it's not visible on the screen). Changing the alert to my custom function handler produces the previous dom exception. I attempted to use the 'activate' and 'enable' events instead of 'afterrender', but even though the API says that FormPanel fires those events, the alert('test') never gets called.

    I can't seem to find any way for my panel to get the inner FormPanel's values upon loading my panel. Does anyone have any ideas?
    -->

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    Duplicate post closed. Please don't duplicate your questions.
    -->

Similar Threads

  1. Replies: 6
    Last Post: 20 Apr 2009, 8:11 PM
  2. Replies: 4
    Last Post: 10 Feb 2009, 8:26 AM
  3. Replies: 2
    Last Post: 14 Mar 2008, 1:54 AM
  4. Window getForm (access items formPanel form object)
    By devosc in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 3 Feb 2008, 2:19 PM

Thread Participants: 1

Tags for this Thread