java - 对集合中选定项目的操作

标签 java apache isis

我正在使用 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/

相关文章:

java - [持久性异常 : Error getting sequence nextval]

java - Android 在应用程序完全关闭之前向服务器发出请求

java - 为什么 Quartz 说这个 cron 表达式无效?

php - mod_rewrite : Trailing slash on URL with two GET variables

Apache mod_rewrite 重定向 : ampersands in new query string being transformed incorrectly

java - 按主机名设置 vaadin 主题

php - 我需要在 schema.xml 中编写什么才能在 Solr 中的两个或多个字段中进行搜索?

java - Apache Isis jdoqlFromClause 多级继承验证错误

java - 我们如何在 eclipse IDE 中创建新的 apache isis 项目?

java - 如何更新 ISIS 项目核心