1

GWT 2.4 に がありCheckBoxCellますCellTable。チェックボックスをオンまたはオフにした後、change イベントが 2 回発生します。理由がわかりません。どんな助けでも大歓迎です。

private void createTable() {

    // Create a CellTable with a key provider.
    final CellTable<Contact> table = new CellTable<Contact>(KEY_PROVIDER);

    // Add a checkbox column
    final CheckboxCell cbCell = new CheckboxCell();
    Column<Contact, Boolean> cbColumn = new Column<Contact, Boolean>(cbCell) {
        @Override
        public Boolean getValue(Contact object) {
            System.out.println("method getValue() - " + object.id + " - " + object.checked);
            return object.checked;
        }
    };

    cbColumn.setFieldUpdater(new FieldUpdater<Fieldupdater.Contact, Boolean>() {
        @Override
        public void update(int index, Contact object, Boolean value) {
            System.out.println("method update() - " + object.id + " - " + value);
        }
    });

    table.addColumn(cbColumn);

    // Push the data into the widget.
    table.setRowData(CONTACTS);

    // Add it to the root panel.
    RootPanel.get("table1").add(table);
}
4

0 に答える 0