Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-1484

[Wish] Extend @Parameter, specify a class to obtain the default, choices, autoComplete.

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Reopened
    • Minor
    • Resolution: Unresolved
    • 1.13.0
    • None
    • None

    Description

      public void updateName(
          @Parameter(defaultOf="Foo")  // if can specify an Object???
          @ParameterLayout(named = "New name")
          final String name) {
      
          setName(newName);
      }
      

      or a more elaborate (over-complicated?) design:

      eg:

      public void updateName(
          @Parameter(defaultFrom=ParameterDefaultFromProperty.class
          @ParameterLayout(named = "New name")
          final String name) {
      
          setName(newName);
      }
      

      where (part of the applib):

      public interface ParameterDefaulter {
          Object defaultFor(Object domainObject, String actionName, String parameterName);
      } 
      

      and the applib also provides a default implementation:

      public class ParameterDefaultFromProperty implements ParametedDefaulter { ... }
      

      that uses an injected service (from core.runtime) to look up the parameter value from the corresponding property of the object.

      Attachments

        Activity

          People

            Unassigned Unassigned
            danhaywood Daniel Keir Haywood
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: