Application-initiated component repaint?

Hi,

I’ve just started experimenting on the Toolkit.

Is there any technique for triggering the web browser to update (repaint) fields as their data values are changed on the server side, i.e. without user interaction?

Couldn’t find such thing mentioned in the manual.

Thanks,

-mj

Hi mj,

It is possible to accomplish this by using a ProgressIndicator which periodically polls the server for changes. For a discussion and some examples see the
server push
discussion in this forum.

Polling is the easiest way currently.

Probably the easiest way to make polling is to have an invisible ProgressIndicator, as is explained in the manual at
http://itmill.fi/documentation/itmill-toolkit-5-reference-manual/ch04s16.html
or
http://www.itmill.com/documentation/itmill-toolkit-5-reference-manual/ch03s04.html
or in another example at
http://dev.itmill.com/browser/trunk/src/com/itmill/toolkit/tests/book/ChatApplication.java
.

To make the indicator invisible, make a custom theme, set a custom style class name for the indicator and define the style as “display: none”, as is done in
http://dev.itmill.com/browser/trunk/WebContent/ITMILL/themes/tests-book/styles.css
.

IT Mill Toolkit does not have built-in support for server push at the moment. As far as I know, it can be done with GWT and some servlet containers, but it’s hard to say how easy it would be to implement it for IT Mill Toolkit. There’s a long-standing ticket for this at
http://dev.itmill.com/ticket/111
.

See also, for example, the thread
http://forum.itmill.com/posts/list/345.page
.

Perfect, works nicely - the product looks very promising.

Thanks,

-mj