tags:

views:

272

answers:

1

I'm going out on a limb here, and hoping that someone has used IT Mill Toolkit before:

I have a Table with a bunch of Items inside. I edit one of them – how do I get the Table to refresh and re-render itself? I've tried with requestRepaint(), requestRepaintAll() on both the table, and the Layout that contains the Table, but I can't get it to refresh itself. When I reload the page, or scroll back and forth (so that the Item goes from view and comes back into view), the Item has been updated.

Is there a way to programmatically get the Table to refresh its current view?

+1  A: 

Doesn't the item container implement this feature? Say that you use a IndexedContainer in your Table. AFAIK the IndexedContainer notices when you change the content, and it in turn sends a notice to everything using it as a datasource (= table). So a normal table should pick this up.

Edit- checked this:

IndexedContainer implements Property.ValueChangeNotifier

Table implements ValueChangeListener which runs a requestRepaint().

In other words, your container also has to implement the notifier so that the automatic repaint can be called.

Jens Jansson
I've implemented my own container. That might be the problem :)
Henrik Paul
requestRepaint() is the right one, but it won't do anything if it evaluates that the content hasn't changed. valueChange(event) in Table does resetPageBuffer(); and refreshRenderedCells(); before calling requestRepaint(). There lies the problem why simple repaint wont work.Use valueChangeNotifier
Jens Jansson