[Seaside] Re: How to avoid too many callbacks

Gerhard Obermann obi068 at gmail.com
Thu May 1 18:01:49 UTC 2008


Hi!

Its already a fully working example!
Now with the simplification suggested by Lukas!

renderContentOn: html
 html heading: 'Callback Test'.
  1 to: 100 do: [:idx | html anchor id: 'id_', idx asString;
       class: 'showCell';
       with: idx. html space.
       idx \\ 20 = 0 ifTrue: [html break]].
 html break.
 html div id: 'result'; with: [self renderResultOn: html].

 self session addLoadScript: (html selector
      add: 'a.showCell';
      do: [ :each | each element on: 'click' do: (html evaluator callback:
[:script | script element id: 'result'; update: [:r | self renderResultOn:
r]];
      callback: [:v | self result: v] value: (SUStream new nextPutAll:
'this.id'))]).
cheers
Gerhard
On Thu, May 1, 2008 at 6:39 PM, itsme213 <itsme213 at hotmail.com> wrote:

> "Gerhard Obermann" <obi068 at gmail.com> wrote in message
>
> > BTW the test result shows a good performance gain without the 100
> > callbacks.
> >
> > Render Time (with 100 callbacks) : 29 ms
> > Render Time (with 1 callback) : 6 ms
> > File Size (with 100 callbacks): 20736
> > File Size (with 1 callback): 8611
>
> Wow, looks like I could do this in some places in my app. Any chance you
> could share the rest of this test/sample code?
>
> Always amazed by how much I do not know :)
>
> - Sophie
>
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20080501/745d40d3/attachment.htm


More information about the seaside mailing list