tapestry 4 contrib表多次调用getModel()

时间:2009-11-17 08:50:56

标签: java tapestry

public IBasicTableModel getModel() {
        return new IBasicTableModel() {

            public int getRowCount() {

                System.out.println("called many times....");
                return getServiceLayer().countTotalCategoryRow(getKeyword());

            }
}

当我在控制台上尝试这个和打印输出时,它显示了这个方法getRowCount() 被多次调用。这在挂毯4中是正常的吗?

1 个答案:

答案 0 :(得分:1)

我不知道你是否自11月以来在这方面取得了任何进展,但它可以在初始渲染期间调用一次,也可以在倒带循环期间调用一次。

此外,实现IBasicTableModel的匿名类需要实现方法getCurrentPageRows - 但您可能已经知道了;)