Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1618

Component events "onValidate / onSuccess / onFailure"



    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 5.3, 5.4
    • None
    • tapestry-core


      Currently a compont is more or less something which just groups UI elements. Tapestry should give components a chance to take full responsibility for all UI elements it contains including setup, validation and storage. On the one hand we can pre-set values (like setting checkbox aso) via setupRender by reading a domain model but there is no way to store the values because a component is not getting events from the form. There are several methods like custom bindings, ComponentAction or calling component methods from the form (page class) to come around this issue, but this just looks like workarounds.

      In case components would provide optional methods for onValidate / onSuccess / onFailure (and become part of the form's events) it's possible to write standalone components which read a domain model and reflect changes to a domain model and even do cross checks between fields. This would increase component reusability to my personal opinion and create more solid units. Furthermore it easily allows handling of data which is not stored as simple attributes (eg bitfield which is mapped to multiple checkboxes and needs conversion in setupRender / onSuccess).




            Unassigned Unassigned
            jens breitenstein Jens Breitenstein
            3 Vote for this issue
            6 Start watching this issue