Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Form control adds a couple of hidden fields to its list of controls and this can mess up insertion logic because the user won't be aware of these hidden fields.

The obvious One solution is for Form to add the hidden fields later, at render time (perhaps by overriding onRender). There are two problems with this approach however. If Form subclasses override onRender and forget to invoke super.onRender, Form will break. But the bigger issue is if users skip the onRender phase by returning false from a listener.Seems we need a solution where a callback to the Form can be registered which will be fired at rendering time. Thus its not possible for users to override or interfere with the callback. We could piggyback on an enhanced ControlRegistry which allows one to register callbacks between event phases. For example a POST_RENDER_PHASE callback could be used by form to add the hidden fieldsform to keep an internal index of where HiddenFields are located in the Form control list.