Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Behavior question about handlers

    I've noticed some behavior about event handlers that is different from what I would expect and wanted to know if this was intended or not.

    If I create a FormItem and add a ChangedHandler to it, then set it as the editorType for a DataSourceField, when that item shows up on a form, it has the ChangedHandler I applied.
    If I also add a ChangedHandler to the actual FormItem that is drawn in the form, it is ignored in favor of the handler on the editorType.
    If I add a ChangedHandler to the FormItem that is drawn in the form, but I do this inside of a FormItemInitHandler, this new handler runs correctly. However, it overwrites my original ChangedHandler that was applied to the editorType.

    Each time I call addChangedHandler, is it expected that I am actually adding on a new handler and never replacing an existing handler? If this is known behavior or was intended to be this way, is there a workaround that allow me to add handlers in the situations I mentioned, and have them all work together?

    I attached a test case showing these things happening.

    Thanks

    SmartGWT 3.0 built 2011-12-05, updated version of Chrome
    Attached Files

    #2
    Any thoughts on this one? If the first post is confusing, it might be clearer to see in the sample code than in words. Basically, adding a ChangedHandler to a form item in the form is causing a problem when the form item's editorType has ChangedHandler(s) of its own. Either the editorType's handlers or the form item's handlers will end up not firing, depending on how they are applied.

    This only seems to happen when the handlers are of the same type (ChangedHandler doesn't clash with a BlurHandler, etc)

    Thanks

    Comment


      #3
      One more bump - has anyone else had problems with this? I'm having to work around it by trying to use different events/handlers to catch the same thing. I'd really just like to be able to apply several ChangedHandlers. Some need to be applied to the DataSourceField's editorType, and some added later to the form item created from that editorType.

      Comment

      Working...
      X