Versions Compared

Key

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

...

  • If JavaScript is not enabled the Control ActionListener's onAction(Control source) method will be invoked, providing a simple fallback mechanism.

Cons:

  • It could encourage writing complex Pages that are hard to understand and maintain
  • The concept of a Behavior is a bit complex to understand at first.

Outstanding Issues:

  • The initial thinking is that a behavior can only have a single listener defined. How will a behavior handle multiple incoming events? For example two behaviors could be registered on a field, "onblur" for validation purposes, and "onkeypress" for auto-completion. The Event object passed into the listener could be inspected, but this leads to if-else logic. This brings up the idea of having multiple listeners per behavior.
    o Pro: Each listener could be registered for a specific event, and will only be triggered for Ajax requests of that event type.
    o Con: Having multiple listeners per behavior could increase the conceptual complexity and could lead to an increase in maintenance. For example, if the client-side code neglects to pass the event parameter, no listener will be invoked. The user will now have to deal with whether the control ID or event request parameter or both are missing.