1

I'm developing an application using Apache Isis and I didn’t find any examples on how to present a collection (list of items), allow the user to select only some of them, and to execute an Action which will be applied only to the SELECTED ones.

Is it possible to be done? Any suggestion?

Thanks

sgbrito
  • 11
  • 1

1 Answers1

1

Your use case is, in fact, supported: you need to use @Action(associateWith=...), see [1].

For example, suppose we have a "removeItems(…)" action:

public class Order {

    @Collection
    SortedSet<OrderItem> getItems() { ... }

    ...

    @Action(associateWith="items", associateWithSequence="2")
    public Order removeItems(SortedSet<OrderItem> items) { ... }
}

The Wicket viewer will then render the "items" collection with checkboxes, and any selected items will be used as the pre-selected set of items if the action is invoked

HTH Dan

[1] http://isis.apache.org/guides/rgant/rgant.html#_rgant-Action_associateWith

Dan Haywood
  • 2,215
  • 2
  • 17
  • 23