[Seaside] Default value for html select?

Boris Popov, DeepCove Labs boris at deepcovelabs.com
Tue Oct 19 10:24:35 UTC 2010



Couple of important notes,


1.       You need to provide an actual selected object, not a block

2.       You do not need to worry about string/object conversion
yourself, callback will always get an actual object from the list, not
its label


html select

        list: MyCoursesModel users; 

        selected: program manager;

        callback: [:user | program manager: user]


Hope this helps,





DeepCove Labs Ltd.

+1 (604) 689-0322

4th floor, 595 Howe Street

Vancouver, British Columbia

Canada V6C 2T5



PacNet Services (Europe) Ltd.

+353 (0)61 714-360

Shannon Airport House, SFZ

County Clare, Ireland





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.


From: seaside-bounces at lists.squeakfoundation.org
[mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of Kevin
Sent: 19 October 2010 11:18
To: seaside at lists.squeakfoundation.org
Subject: [Seaside] Default value for html select?




I am currently using a drop-down list in my Seaside application, but it
always takes the first item of the list as default value. Is there a way
to specify which item to take as default value?


For reference here is the code I'm using to display the drop-down list:




html select

        list: MyCoursesModel listOfUsersByEmail; 

        selected: [ program manager. ];

        callback: [ :email | program manager: (MyCoursesModel
userByEmail: email). ].







-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20101019/af2de305/attachment-0001.htm

More information about the seaside mailing list