Results 1 to 2 of 2

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

  1. #1
    Sencha User
    Join Date
    Nov 2010
    Vote Rating

    Default 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:

    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 User's Avatar
    Join Date
    Mar 2007
    DC Area =)
    Vote Rating


    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts