在 Wicket DefaultTableTree 中是否可以使用 AJAX 页面导航?
In Wicket DefaultTableTree is it possible to use AJAX page navigation?
我们使用的是 DefaultTableTree,它工作得很好,除了我在页面上还有其他内容,我希望分页仅执行 table 内容的更新而不是整页刷新。
我注意到 DefaultTableTree 的构造函数构造了一个 NavigationToolBar(非 AJAX):
public DefaultTableTree(String id, List<? extends IColumn<T, S>> columns, ISortableTreeProvider<T, S> provider, int rowsPerPage, IModel<Set<T>> state) {
super(id, columns, provider, (long)rowsPerPage, state);
this.getTable().addTopToolbar(new NavigationToolbar(this.getTable()));
this.getTable().addTopToolbar(new HeadersToolbar(this.getTable(), provider));
this.getTable().addBottomToolbar(new NoRecordsToolbar(this.getTable()));
this.add(new Behavior[]{new WindowsTheme()});
}
是否有某种覆盖此行为的方法来创建 AjaxNavigationToolBar 而不是这个非 AJAX 版本的导航器?
如果不是,是否可以在构建 DefaultTableTree 后简单地删除该导航器并用 AJAX 版本替换它?
DefaultTableTree
只是其抽象超类的默认实现,具有一些工具栏和主题配置:
直接继承 TableTree
并根据需要进行配置可能更容易。
在不需要树的情况下回答我自己的问题table:
如果您想使用 DataTable 而不需要树 table,那么此 class 最适合获取 AJAX 强大的数据 table:
我们使用的是 DefaultTableTree,它工作得很好,除了我在页面上还有其他内容,我希望分页仅执行 table 内容的更新而不是整页刷新。
我注意到 DefaultTableTree 的构造函数构造了一个 NavigationToolBar(非 AJAX):
public DefaultTableTree(String id, List<? extends IColumn<T, S>> columns, ISortableTreeProvider<T, S> provider, int rowsPerPage, IModel<Set<T>> state) {
super(id, columns, provider, (long)rowsPerPage, state);
this.getTable().addTopToolbar(new NavigationToolbar(this.getTable()));
this.getTable().addTopToolbar(new HeadersToolbar(this.getTable(), provider));
this.getTable().addBottomToolbar(new NoRecordsToolbar(this.getTable()));
this.add(new Behavior[]{new WindowsTheme()});
}
是否有某种覆盖此行为的方法来创建 AjaxNavigationToolBar 而不是这个非 AJAX 版本的导航器?
如果不是,是否可以在构建 DefaultTableTree 后简单地删除该导航器并用 AJAX 版本替换它?
DefaultTableTree
只是其抽象超类的默认实现,具有一些工具栏和主题配置:
直接继承 TableTree
并根据需要进行配置可能更容易。
在不需要树的情况下回答我自己的问题table:
如果您想使用 DataTable 而不需要树 table,那么此 class 最适合获取 AJAX 强大的数据 table: