On Mon, 13 Jul 2009 15:05:24 +0200 Nicolas Petton <[email protected]> wrote:
> Le lundi 13 juillet 2009 à 14:50 +0200, Stefan Schmiedl a écrit : > > Before I dive in and learn to do it manually, is there an idiomatic > > way of updating a given element (periodically)? > > > > I am building the supervisor page for the OnlineTester, which > > contains something like a "dashboard" showing the completion rate > > of each test. This is currently implemented as widget although > > it does not need to be, now that I think about it. Anyways, its > > contents should be refreshed once every minute. > > You should probably use one of the periodical updater jQuery plugins. > http://plugins.jquery.com/search/node/updater Smart solutions for a bigger problem :-) > There is no integration in Iliad for now, so you will have to write > some Javascript code ;) Here's what I have now, but consider cheating (a bit): contents [ <category: 'building'> ^ [ :e | |id| id := self session nextId printString. e build: self statusWidget. e anchor id: id; text: 'Refresh'; action: [ self statusWidget markDirty ]. e script: 'window.setInterval( function() { jQuery( "a#' , id , '" ).click(); }, 60*1000 );' ] ] Question #1: Is there a reason why "session nextId" is a number instead of a string? It does not matter when assigning it to the id attribute, but it is a bit of a trap because splicing it (as a number) into a string does not give the desired result. Question #2: The solution above nicely logs the expected XHR requests in firebug. When I tried Iliad.evaluteAnchorAction( "a#' , id , '" ); instead, no such requests were logged. Do I actually go and read the Javascript books on the shelf behind me or is there something else I'm not aware of? Thanks, s.
signature.asc
Description: PGP signature
_______________________________________________ help-smalltalk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-smalltalk
