Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

With the delegate pattern you have the possiblity to react on defined events of the panel from outside. In the above described example
you have two delegate methods.

  • void searchSumitted(SearchPanel panel);
    This method is invoked after the form was successfully submitted. Here
    you have the possiblity to read the data from the form, execute some backend methods
    (for example reading some customers from the database) and set a list of customers
    which will be shown in the result table.
  • customerSelected(SearchPanel panel, Customer customer);
    This method is invoked after a customer was selected from the result table.
    The the method tells you which customer was selected.

The form handles all the stuff regarding the search fields. For example the panel check whether all
mandatory fields are filled. If everything is fine the delegate method void searchSumitted(SearchPanel panel) is invoked.
Inside this method you have access to the submitted form values and you can provide the result list.
After that the result table is shown. When the user selects a row of the result table the second delegate method customerSelected(SearchPanel panel, Customer customer) is executed.
Inside this method you get the selected customer value object.

...