我正在使用 Apache Isis 开发一个应用程序,但我没有找到任何有关如何呈现集合(项目列表)、允许用户仅选择其中一些以及执行操作的示例,该操作将是仅适用于选定的。
可以实现吗?有什么建议吗?
谢谢
最佳答案
事实上,您的用例是受支持的:您需要使用@Action(associateWith=...),请参阅[1]。
例如,假设我们有一个“removeItems(…)”操作:
public class Order {
@Collection
SortedSet<OrderItem> getItems() { ... }
...
@Action(associateWith="items", associateWithSequence="2")
public Order removeItems(SortedSet<OrderItem> items) { ... }
}
Wicket 查看器随后将呈现带有复选框的“items”集合,并且如果调用该操作,任何选定的项目都将用作预选的项目集
HTH 丹
[1] http://isis.apache.org/guides/rgant/rgant.html#_rgant-Action_associateWith
关于java - 对集合中选定项目的操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59072571/