I need to affect multiple elements (via html #update, or #element #hide,
#show). I know their IDs. How should I do this? Thanks _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
> I need to affect multiple elements (via html #update, or #element #hide,
> #show). I know their IDs. How should I do this? html evaluator callback: [ :s | s element id: 'first'; hide. s element id: 'second'; show ] Lukas -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
And that block is evaluated on a subsequent trip back on the server side?
Wow! This is amazing. How do I chain these e.g. to get both a hide/show (with html evaluator) and some DOM change (with html updater) from the same onClick? Sophie. "Lukas Renggli" <[hidden email]> wrote in message news:[hidden email]... >> I need to affect multiple elements (via html #update, or #element #hide, >> #show). I know their IDs. How should I do this? > > html evaluator callback: [ :s | > s element id: 'first'; hide. > s element id: 'second'; show ] > > Lukas > > -- > Lukas Renggli > http://www.lukas-renggli.ch _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
"itsme213" <[hidden email]> wrote in message news:fjktgj$5bq$[hidden email]... > And that block is evaluated on a subsequent trip back on the server side? > Wow! This is amazing. > > How do I chain these e.g. to get both a hide/show (with html evaluator) > and some DOM change (with html updater) from the same onClick? Just tried the common sense thing with multiple onClicks and it works. Please let me know if this is the correct way. This stuff is awesome. Sophie _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Lukas Renggli
Lukas Renggli wrote:
>> I need to affect multiple elements (via html #update, or #element #hide, >> #show). I know their IDs. How should I do this? >> > > html evaluator callback: [ :s | > s element id: 'first'; hide. > s element id: 'second'; show ] > > Lukas > > html evaluator callback: [ :script | script element id: 'first'; render: [ :r | self updateFirstOn: r ]. script element id: 'second'; render: [ :r | self updateSecondOn: r ]. ] ) Keith _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
"Keith Hodges" <[hidden email]> wrote > onClick: ( > > html evaluator callback: [ :script | > script element id: 'first'; render: [ :r | self updateFirstOn: r ]. > script element id: 'second'; render: [ :r | self updateSecondOn: r ]. > ] Thanks, that clarifies it further. Would it also be OK to use multiple calls to #onClick, html anchor onClick: ( self hideShowOn: html ); onClick: (html updater id: opId; callback: [:r | self toggleHideShowStateOnServer. self renderBarOn: r]) or is that something to avoid? The generated Javascript gets appended correctly, but perhaps there would be risky asynchronous / race between the requests. - Sophie _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
> Thanks, that clarifies it further. Would it also be OK to use multiple calls
> to #onClick, If #hideShowOn: is an asynchronous updater, then you might be in trouble. Ajax calls are asynchronous and are not guaranteed to be handled in any particular order. However if your actual code is something like this: html anchor onClick: (html element id: opId; toggle); onClick: (html updater id: opId; callback: [:r | ... then that's fine. The first action is not asynchronous. Therefor the order is guaranteed. Lukas -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |