Vaadin SQLContainer令人耳目一新

时间:2013-07-25 18:59:29

标签: vaadin vaadin7

Vaadin book说:

  

通常,SQLContainer会在需要时自动处理刷新。

但是,这个定义在哪里?容器刷新的频率是多少?

我试过测试但无法解决

1 个答案:

答案 0 :(得分:1)

您只需检查SQLContainer代码即可。

短语

  

通常情况下,SQLContainer会自动处理刷新   必需的。

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

   /**
     * 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();
    }

所有其他操作都适用(请注意刷新()电话):

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