Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-478

Provide conditional choices, defaults and validation between action parameters

    Details

      Description

      For example, suppose there is an action to specify an address, where we specify the country, the state and the postcode. We want the state to have choices and a default dependent on the country, and we want the postcode to be validated according to the rules of that country.

      public Address enterAddress(Country c, State st, @Named("Postcode") String postcode)

      { ... }

      Any dependent parameter must supply a param-specific validate [this is a new method prefix]:

      public String validate1EnterAddress(Country c, State st, String postcode) { ... }
      public String validate2EnterAddress(Country c, State st, String postcode) { ... }

      The choices and defaults for State also accept all param types preceding:

      public List<State> choices1EnterAddress(Country c) { ... }

      public State default1EnterAddress(Country c)

      { ... }

      When the user enters a value for the country, this is passed to these methods. If the user tabs directly to the State param without entering the country, then these would return empty lists/value.

      If the user enters a value for the country, then corresponding entries for the state and postcode, and then tabs back to the country and enters a different value, then the validateNXxx methods are called (for all N > 0, country being param 0). If the validate methods indicate their current value is invalid, then the values are set to null or to the recomputed default (if a default method is available).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                danhaywood Dan Haywood
                Reporter:
                danhaywood Dan Haywood
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: