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

@AutoComplete annotation on repository does not seem to honour @MinLength

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: viewer-wicket-1.3.1
    • Fix Version/s: 1.12.0
    • Component/s: Core: Viewer: Wicket
    • Labels:
      None

      Activity

      Hide
      danhaywood Dan Haywood added a comment - - edited

      to reproduce:

      @DomainObject(
              autoCompleteRepository = SimpleObjects.class,
              autoCompleteAction = "autoComplete"
      )
      public class SimpleObject { ... }
      

      and also

          @Action(
                  semantics = SemanticsOf.IDEMPOTENT
          )
          public void delete(SimpleObject simpleObject) {
              repositoryService.remove(simpleObject);
          }
      
          public List<SimpleObject> autoComplete(@MinLength(2) String search) {
              return Lists.newArrayList(FluentIterable.from(listAll())
                      .filter(new Predicate<SimpleObject>() {
                          @Override public boolean apply(@Nullable final SimpleObject object) {
                              return object.getName().contains(search);
                          }
                      })
                      .toList());
          }
      

      whereas this works:

          @Action(
                  semantics = SemanticsOf.IDEMPOTENT
          )
          public void delete(SimpleObject simpleObject) {
              repositoryService.remove(simpleObject);
          }
      
          public List<SimpleObject> autoComplete0Delete(@MinLength(2) String search) {
              return Lists.newArrayList(FluentIterable.from(listAll())
                      .filter(new Predicate<SimpleObject>() {
                          @Override public boolean apply(@Nullable final SimpleObject object) {
                              return object.getName().contains(search);
                          }
                      })
                      .toList());
          }
      
      Show
      danhaywood Dan Haywood added a comment - - edited to reproduce: @DomainObject( autoCompleteRepository = SimpleObjects.class, autoCompleteAction = "autoComplete" ) public class SimpleObject { ... } and also @Action( semantics = SemanticsOf.IDEMPOTENT ) public void delete(SimpleObject simpleObject) { repositoryService.remove(simpleObject); } public List<SimpleObject> autoComplete(@MinLength(2) String search) { return Lists.newArrayList(FluentIterable.from(listAll()) .filter( new Predicate<SimpleObject>() { @Override public boolean apply(@Nullable final SimpleObject object) { return object.getName().contains(search); } }) .toList()); } whereas this works: @Action( semantics = SemanticsOf.IDEMPOTENT ) public void delete(SimpleObject simpleObject) { repositoryService.remove(simpleObject); } public List<SimpleObject> autoComplete0Delete(@MinLength(2) String search) { return Lists.newArrayList(FluentIterable.from(listAll()) .filter( new Predicate<SimpleObject>() { @Override public boolean apply(@Nullable final SimpleObject object) { return object.getName().contains(search); } }) .toList()); }
      Hide
      jira-bot ASF subversion and git services added a comment -

      Commit b0663416fac67ebf8c85ae8ad6f841962508ec70 in isis's branch refs/heads/master from Dan Haywood
      [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=b066341 ]

      ISIS-687: now honouring @MinLength when specified on an action.

      Show
      jira-bot ASF subversion and git services added a comment - Commit b0663416fac67ebf8c85ae8ad6f841962508ec70 in isis's branch refs/heads/master from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=b066341 ] ISIS-687 : now honouring @MinLength when specified on an action.

        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:

            Development