Can't refresh CellTable

225 views
Skip to first unread message

Néstor Boscán

unread,
Apr 1, 2011, 11:04:25 AM4/1/11
to google-we...@googlegroups.com
Hi

I have a CellTable that has a cell that when I click on it I need to remove the current row. I've tried deleting the object from the ArrayList and redrawing the CellTable but it doesn't work. Also I've tried to call setRowData again and redraw the CellTable and the table doesn't redraw. If I use an external button to add a new object to the array and call setRowData it does work. I don't know if it has to do that I'm deleting the row from withing an event of the CellTable.

Regards,

Néstor Boscán

mike b

unread,
Apr 5, 2011, 5:01:38 PM4/5/11
to google-we...@googlegroups.com
We're having the same problem getting a CheckBoxCell to go from un-checked to checked to un-checked...

I can see in Firebug where the HTML input does NOT have "checked" in it, but it still shows a checked box. 

This is what we had to do...  Its ugly but it works consistently. 

        actualList.remove(5);
        Scheduler.get().scheduleDeferred(new ScheduledCommand() {
           
            @Override
            public void execute() {
                cellTable.setRowData(new ArrayList<MyObject>());//set a blank list here
            }
        });

// let the browser catch up
        Scheduler.get().scheduleDeferred(new ScheduledCommand() {
           
            @Override
            public void execute() {
                cellTable.setRowData(actualList);  // not put the actual list back into it
            }
        });


Good luck!


Néstor Boscán

unread,
Apr 5, 2011, 6:19:23 PM4/5/11
to google-we...@googlegroups.com
Thanks a lot for that answer, and yes it does look ugly!!! But it will have to do.

Regards,

Néstor Boscán



--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Néstor Boscán

unread,
Apr 5, 2011, 7:44:35 PM4/5/11
to google-we...@googlegroups.com
Interesting behaviour. Now I can add rows, remove rows, but when I try to add rows again the table won't refresh.

Regards,

Néstor Boscán

2011/4/5 Néstor Boscán <nest...@gmail.com>

Néstor Boscán

unread,
Apr 6, 2011, 10:24:51 PM4/6/11
to google-we...@googlegroups.com
My bad. I was calling setRowData(0, list) instead of setRowData(list). I changed it and it worked.

jchimene

unread,
Aug 9, 2011, 7:36:01 PM8/9/11
to google-we...@googlegroups.com
I found this post today. After implementing the suggestion, I found that just delaying the rest of the update works as expected, viz:

    selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
        @Override
        public void onSelectionChange(SelectionChangeEvent event) {
        com.google.gwt.core.client.Scheduler.get().scheduleDeferred(new ScheduledCommand() {
            @Override
            public void execute() {
            getUiHandlers().onActivityDelete(selectionModel.getSelectedObject());
            }
        });
        }
    });
given
final SingleSelectionModel<Activity> selectionModel
and
uiHandlers
is from gwt-presenter framework.
Reply all
Reply to author
Forward
0 new messages