Re: [Seaside] [Q] Conditional Updating Using Scriptaculous

chunsj at embian.com chunsj at embian.com
Sat Jan 12 14:42:53 UTC 2008


Wow, this is exactly what I want, thank you. hope there's a book
on Seaside+Scriptaculous...

Thank you very much, again.

----- Original Message -----
   From: Lukas Renggli <renggli at gmail.com>
   To: chunsj at embian.com, Seaside - general discussion <seaside at lists.squeakfoundation.org>
   Sent: 08-01-12 18:24:18
   Subject: Re: [Seaside] [Q] Conditional Updating Using Scriptaculous

  > To update element with id 'id', I can use html updater id:'id'; ... in scriptaculous.
> But there're times that updating is not needed conditionally. For example,
> div element "itemList" does have 1000+ sub element in itself and a link
> for updating 'itemList' is clicked, but there's no new element added so updating
> should not be done. (Doing update does not harm, but it takes 10+ seconds).
>
> How can I do this, "updater with condition"?

As you say, you use a condition.

html updater
     id: 'somewhere';
     callback: [ :r | ... ];
     condition: ((html element
         id: 'id';
         childElements) size
             addDecoration: (SUBinary new operator: '<='; statement: 1000))

For the last line you maybe want to add some conveniance method to
SUObject, this looks a bit ulgy right now.

Generally for complicated JavaScript behavior it makes sense to write
the script in an editor and include it as an external file.

Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch



More information about the seaside mailing list