[CLOSED] 1.2 breaking working 1.0 code (store event handler doesn't recognize form panel)

  1. #1

    [CLOSED] 1.2 breaking working 1.0 code (store event handler doesn't recognize form panel)

    For some reason after loading the latest release, my store is barking at me that the FormPanel it's attached to doesn't exist when loading....this is pretty much standard code taken from the samples. i know loading is asynchronous, but i assumed that 1.2 would not just break my code...i have an identical version running 1.0 and it works - this is just a standard listener on the store:

      datachanged: {
      fn: function(store){var record = this.getAt(0) || {};DetailForm.getForm().loadRecord(record);setChecked(record);DetailForm.clearInvalid();}
    },
    this error is thrown client-side javascript in 1.2 - again it works fine in 1.0

    Error: DetailForm is not defined
    Source File: http://www.figureheadsoftware.com:80...ity=Evaluation
    Line: 647

    any ideas?
    Last edited by Daniil; Dec 28, 2011 at 4:08 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Please set up Delay="10" for the DataChanged listener.

    If you use a Load listener, you might need to set up Delay="10" as well.
  3. #3

    delay didn't work

    thanks for the response Daniil - but it didn't seem to help - i will setup the examples tomorrow and see if it's happening too.

    load: {
      delay: 10,
      fn: function(store,records,options){DetailForm.body.unmask();}
    },
    Error: DetailForm is not defined
    Source File: http://www.figureheadsoftware.com:80...ity=Evaluation
    Line: 652
    Last edited by Daniil; Dec 27, 2011 at 8:08 AM. Reason: Please use [CODE] tags
  4. #4
    Does increasing the Delay to 100 help?

    Is "DetailForm" a client id of FormPanel?

    Could you provide a sample to reproduce?
  5. #5

    not good

    Daniil -

    yes, that is the client id of the form panel....and like i said, identical code is working in 1.0.

    I upped the delay to 100 and i'm still getting lots of errors on the load events of various stores used on my page.

    I'm afraid to use this delay paradigm since i assume different computers will need more or less time on the client side - is there a better way to do this than to just "guess" at the correct delay?
  6. #6
    Well, previously there was Delay="10" for Load listener which has been removed to provide a developer with more flexibility.

    The problem that a component must be rendered before it's accessed using its client id.

    In your case I can suggest to set up AutoLoad="false" for the Store and set up the following Render listener for the FormPanel.
    <Render Handler="Store1.load()" />
  7. #7
    Though I'm not sure it will solve the problem, because setting up a delay doesn't help, but it should.

    If the problem persists even with the approach I suggested, please provide a sample to reproduce the problem.
  8. #8

    fixed (for now)

    I added delays on basically all of the load / datachanged / beforeload event listeners for any stores i am using and for now, on my dev server it's working. hopefully it doesn't pop up again - thanks for your help.
  9. #9
    Good.

    You could consider the suggested approach in the future.

Similar Threads

  1. Replies: 5
    Last Post: Jun 25, 2012, 6:19 PM
  2. Set Handler Event on code-behind for Window
    By maurox in forum 1.x Help
    Replies: 0
    Last Post: Apr 18, 2012, 1:55 PM
  3. Save store doesn't fire CommitFailed event
    By Greg44 in forum 1.x Help
    Replies: 1
    Last Post: Apr 13, 2012, 4:15 PM
  4. Replies: 2
    Last Post: Mar 15, 2012, 12:57 AM
  5. Replies: 2
    Last Post: Nov 04, 2008, 12:28 AM

Tags for this Thread

Posting Permissions