[Seaside] Using the select tag
Boris Popov, DeepCove Labs
boris at deepcovelabs.com
Thu Sep 29 13:39:31 UTC 2011
Olivier,
No, you have a way of separately providing display ‘labels’ for your actual objects in the list,
(html select)
list: self countries;
selected: country;
enabled: [:ea | ea notNil];
labels: [:ea | ea ifNil: ['---'] ifNotNil: [ea name]];
callback: [:value | country := value].
-Boris
From: seaside-bounces at lists.squeakfoundation.org [mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of Olivier Auverlot
Sent: Thursday, September 29, 2011 9:16 AM
To: Seaside - general discussion
Subject: Re: [Seaside] Using the select tag
Hi Boris,
This means that I must analyze the choice of the user from the text that is displayed on the screen. ok :-(
But how can I must doing if my application supports many languages ?
Olivier ;-)
The framework will pass an actual 'selected' object from your 'list' into the callback, what it puts in the 'value' in the HTML should be completely irrelevant to you.
-Boris
-----Original Message-----
From: seaside-bounces at lists.squeakfoundation.org [mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of Olivier Auverlot
Sent: Thursday, September 29, 2011 9:00 AM
To: Seaside - general discussion
Subject: Re: [Seaside] Using the select tag
if I can't set and read the value of an option tag. How can I know the index of the selected line ?
Olivier ;-)
2011/9/29 Olivier Auverlot<olivier.auverlot at gmail.com> <mailto:olivier.auverlot at gmail.com> :
Hi,
I need to use a drop-down menu in a seaside application. In the
examples that I have found, the displayed values are initialized with #list:
html select
list: #(#Male #Female);
selected: self contact gender;
callback: [ :value |
value = #Male
ifTrue: [ self contact beMale ]
ifFalse: [ self contact beFemale ] ].
In the browser, I get this HTML code :
<select name="3"><option value="1"selected="selected">Male</option><option
value="2">Female</option></select>
My problem is how to set the values for each<option> tag ? I would
get something like :
Why do you want to do this?
Cheers
Philippe
_______________________________________________
seaside mailing list
seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110929/f4fe89aa/attachment-0001.htm
More information about the seaside
mailing list