<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Olivier,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>No, you have a way of separately providing display ‘labels’ for your actual objects in the list,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>(html select)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> list: self countries;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> selected: country;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> enabled: [:ea | ea notNil];<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> labels: [:ea | ea ifNil: ['---'] ifNotNil: [ea name]];<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> callback: [:value | country := value].<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>-Boris<o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> seaside-bounces@lists.squeakfoundation.org [mailto:seaside-bounces@lists.squeakfoundation.org] <b>On Behalf Of </b>Olivier Auverlot<br><b>Sent:</b> Thursday, September 29, 2011 9:16 AM<br><b>To:</b> Seaside - general discussion<br><b>Subject:</b> Re: [Seaside] Using the select tag<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Hi Boris,<br><br>This means that I must analyze the choice of the user from the text that is displayed on the screen. ok :-( <br><br>But how can I must doing if my application supports many languages ?<br><br>Olivier ;-)<br><br><o:p></o:p></p><pre>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.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>-Boris<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>-----Original Message-----<o:p></o:p></pre><pre>From: <a href="mailto:seaside-bounces@lists.squeakfoundation.org">seaside-bounces@lists.squeakfoundation.org</a> [<a href="mailto:seaside-bounces@lists.squeakfoundation.org">mailto:seaside-bounces@lists.squeakfoundation.org</a>] On Behalf Of Olivier Auverlot<o:p></o:p></pre><pre>Sent: Thursday, September 29, 2011 9:00 AM<o:p></o:p></pre><pre>To: Seaside - general discussion<o:p></o:p></pre><pre>Subject: Re: [Seaside] Using the select tag<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>if I can't set and read the value of an option tag. How can I know the index of the selected line ?<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Olivier ;-)<o:p></o:p></pre><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre>2011/9/29 Olivier Auverlot<a href="mailto:olivier.auverlot@gmail.com">&lt;olivier.auverlot@gmail.com&gt;</a>:<o:p></o:p></pre><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre>Hi,<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>I need to use a drop-down menu in a seaside application. In the <o:p></o:p></pre><pre>examples that I have found, the displayed values are initialized with #list:<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>html  select<o:p></o:p></pre><pre>        list:  #(#Male  #Female);<o:p></o:p></pre><pre>        selected:  self  contact  gender;<o:p></o:p></pre><pre>        callback:  [  :value  |<o:p></o:p></pre><pre>                value  =  #Male<o:p></o:p></pre><pre>                ifTrue:  [  self  contact  beMale  ]<o:p></o:p></pre><pre>                ifFalse:  [  self  contact  beFemale  ]  ].<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>In the browser, I get this HTML code :<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>&lt;select  name=&quot;3&quot;&gt;&lt;option  value=&quot;1&quot;selected=&quot;selected&quot;&gt;Male&lt;/option&gt;&lt;option<o:p></o:p></pre><pre>  value=&quot;2&quot;&gt;Female&lt;/option&gt;&lt;/select&gt;<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>My problem is how to set the values for each&lt;option&gt;  tag ? I would <o:p></o:p></pre><pre>get something like :<o:p></o:p></pre></blockquote><pre>Why do you want to do this?<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Cheers<o:p></o:p></pre><pre>Philippe<o:p></o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>seaside mailing list<o:p></o:p></pre><pre><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><o:p></o:p></pre><pre><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><o:p></o:p></pre></blockquote><pre><o:p>&nbsp;</o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>seaside mailing list<o:p></o:p></pre><pre><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><o:p></o:p></pre><pre><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>seaside mailing list<o:p></o:p></pre><pre><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><o:p></o:p></pre><pre><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><o:p></o:p></pre><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>