[Seaside] [Scriptaculous] Configure element's class from insidetheupdater?

Boris Popov boris at deepcovelabs.com
Tue Jun 27 17:06:08 UTC 2006


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 :)

| 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)]

But I still can't quite figure out how to pick whether I want to add or
remove a class based on the selection criteria,

Anyone?

-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 Boris Popov
Sent: Tuesday, June 27, 2006 9:52 AM
To: The Squeak Enterprise Aubergines Server - general discussion.
Subject: RE: [Seaside] [Scriptaculous] Configure element's class from
insidetheupdater?

Okay, getting somewhat closer, yet not quite all the way yet,

onClick:
 ((html evaluator)
    triggerForm: fid;
    yourself);
onClick:
 ((html element)
    id: row webid;
    addClassName: 'selected';
    yourself) 

This works fine, so at least I know I can append various elements together
in the onClick, which I didn't realize before. Now I need to figure out how
to have a parameterized "element" event firing where I could either do
addClass or removeClass depending on whether the object is selected... I'm
not convinced I'm headed in the right direction yet though, because I have a
sneaking suspicion this should all be doable from within a single onClick
event.

-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 Boris Popov
Sent: Tuesday, June 27, 2006 9:17 AM
To: The Squeak Enterprise Aubergines Server - general discussion.
Subject: [Seaside] [Scriptaculous] Configure element's class from inside
theupdater?

The following snippet seems to be working fine, but as a next step I'm
trying 
to find a way to add/remove class names to a specific element corresponding
to 
this checkbox,

| fid |
fid := html nextId.
(html form)
 id: fid;
 with:
  [(html checkbox)
    value: (self isSelected: row);
    callback: [:value | self select: row if: value];
    onClick:
      ((html updater)
         triggerForm: fid;
         yourself)]

something along the lines of,

(self isSelected: row)
 ifTrue: [script element
          id: fid;
          addClassName: 'selected']
 ifFalse: [script element
           id: fid;
           removeClassName: 'selected']

but I'm not sure where to plug that in just yet. Any pointers would be 
appreciated.

Thanks!

-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.
-------------- 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/f69feea6/smime-0001.bin


More information about the Seaside mailing list