Wicket
  1. Wicket
  2. WICKET-2258

Make Form.callOnError() and Form.persistFormComponentData() protected

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Wicket 1.3.4, Wicket 1.4rc2

      Description

      We are developing a system where some complex validations are handled by the domain objects.

      This means that setting some properties may raise exceptions. While we are able to catch these exceptions and convert them into meaningful error messages that get into the feedbackpanel, this only happens when updating the model, right after calling valid() on the form components, effectively discarding the values kept in the components.

      Our solution would be to alter the form processing so that:
      + Form validators are invoked
      + If none fails, model is updated
      + if the update doesn't fail, components are marked as valid

      Since this would change the actual form processing cycle, we do not expect Wicket to provide this behavior out of the box, but when we attempted to subclass Form, and override process() we found out that methods callOnError() and persistFormComponentData() called in the implementation of that method are private. We need them to be at least protected so that we can rewrite the onProcess to suit our needs

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Pablo Abad
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development