[Seaside] Problem smalltalk code

Ramon Leon ramon.leon at allresnet.com
Wed Oct 27 17:49:47 UTC 2010


Rather than adding to the list like this and passing around strings...

html select
   list: ((user organizations collect: [:org | org oName ]) addFirst: 
'-- Select an organization --'; yourself);
   on: #selected of: self;

Just do this to accomplish the same thing, and you don't really want to 
just get org names either, you want the org object, so fix the labels 
like this...

html select
   beOptional;
   optionLabel: '-- Select an organization --';
   list: user organizations;
   labels: [:org | org oName];
   on: #selected of: self;

Now when the user makes a selects, #selected is set to the correct org 
object, not just its name.

-- 
Ramon Leon
http://onsmalltalk.com


More information about the seaside mailing list