Vaadin SQLContainer刷新

标签 vaadin vaadin7

Vaadin book说:

Normally, the SQLContainer will handle refreshing automatically when required.

但是,这是在哪里定义的呢?容器多久刷新一次?

我已经尝试过测试但无法解决

最佳答案

您可以简单地检查SQLContainer代码。

短语

Normally, the SQLContainer will handle refreshing automatically when required.

表示 SQLContainer 将在对其状态进行一些更改后自行刷新。例如,在添加 orderBy 后,refresh() 将被调用:

   /**
     * Adds the given OrderBy to this container and refreshes the container
     * contents with the new sorting rules.
     * 
     * Note that orderBy.getColumn() must return a column name that exists in
     * this container.
     * 
     * @param orderBy
     *            OrderBy to be added to the container sorting rules
     */
    public void addOrderBy(OrderBy orderBy) {
        if (orderBy == null) {
            return;
        }
        if (!propertyIds.contains(orderBy.getColumn())) {
            throw new IllegalArgumentException(
                    "The column given for sorting does not exist in this container.");
        }
        sorters.add(orderBy);
        refresh();
    }

所有其他操作都是如此(请注意 refresh() 调用):

  public void rollback() throws UnsupportedOperationException, SQLException {
        debug(null, "Rolling back changes...");
        removedItems.clear();
        addedItems.clear();
        modifiedItems.clear();
        refresh();
    }

关于Vaadin SQLContainer刷新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17866533/

相关文章:

java - 瓦丁表 : load data only on click of button

java - Vaadin 网格 : How to disable mouse event handler which runs inline editor?

css - 瓦丁。组合框响应弹出窗口

java - 更改 Vaadin 7 应用程序的根上下文

java - TextField selectAll 的效果减半

java - 为什么无法解析我的 com.vaadin.UI 导入?

css - 在 Vaadin 应用程序中应用 Css 样式

javascript - Vaadin:通过 "close"、 "ok"或 "x"关闭通知?

vaadin - 如何为 Vaadin Grid 中的列设置样式类?

Vaadin 通过链接加载另一个 View ?