[Seaside] [Scriptaculous] Configure element's class frominsidetheupdater?

Boris Popov boris at deepcovelabs.com
Tue Jun 27 18:52:34 UTC 2006


Lukas,

1. It's the formatter, really :)

2. Okay, cool.

3. How do you define onSuccess? I've tried the following with the
non-existing 'bag', but don't see the error in the Firefox's JavaScript
console, which prompts me to think that its not being called. Am I using a
wrong protocol for this? The request itself works just fine.

(html request)
  triggerForm: fid;
  onSuccess: 'bah()';
  yourself 

Cheers!

-Boris

-- 
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

boris at deepcovelabs.com

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

-----Original Message-----
From: seaside-bounces at lists.squeakfoundation.org
[mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of Lukas
Renggli
Sent: Tuesday, June 27, 2006 10:49 AM
To: The Squeak Enterprise Aubergines Server - general discussion.
Subject: Re: [Seaside] [Scriptaculous] Configure element's class
frominsidetheupdater?

> What an excellent trial-and-error exercise this is, I got the darn thing
> folded into one onClick in code, although it does the same thing still :)

Yeah, interesting process. I experienced similar trial-and-error exercises
;-)

> | fid |
> fid := html nextId.
> (html form)
>  id: fid;
>  with:
>   [(html checkbox)
>     value: (self isSelected: row);
>     callback: [:value | self select: row if: value];
>     onClick:
>      ((html evaluator)
>         triggerForm: fid;
>         callback: [:script | ]
>         value: (html element)
>                  id: row webid;
>                  addClassName: 'selected';
>                  yourself);
>         yourself)]

1. Your brackets and semicolons are very strangely placed. I think
they are probably wrong and cause some problems.

2. You don't need "html evaluator" if you don't inject a script into
the web-page, just use "html request" for simple requests.

3. The AJAX objects (request, updater, evaluator, etc.) understand a
set of events, such as #onComplete:, #onFailure:, #onSuccess:, etc. I
would use one of these events (probably #onSuccess:) to change the
class of your element. Maybe write a helper function in JavaScript
that takes the element and the checkbox as parameters and toggles the
classes appropriately. Then you can attach this function to the event
handler.

Hope this helps,
Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
Seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3370 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20060627/2d0cdbc0/smime.bin


More information about the Seaside mailing list