<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.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.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'>Seaside generates unique values for you to be able to look up an actual object and feed it into the callback, what I’m saying is that you don’t need to worry about those at all – you populate the list with objects, possibly using custom label getters and wait until you get an object fed into your callback.<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 3:10 PM<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>Thank Boris but I don't know if your example can resolve my question. The problem is not to produce labels but setting a unique value for each line of the select tag and read this value in my seaside application.<br><br>It's possible that we have the same problem with the radio and checkbox tags<br><br>In web application, it's a very common practice to dissociate the information displayed for the user and the data exchanged between the client and the server. <br><br><a href="http://www.w3schools.com/tags/att_option_value.asp">http://www.w3schools.com/tags/att_option_value.asp</a><br><br>I used this approach in all my previous web applications with many programming languages (C, Rebol, Perl, PHP, ...). Why not with Pharo and Seaside ? .<br><br>In fact in the callback, I think that the server code must not work with the label value but with the value of the tag. It's not the same thing. <br><br>Olivier ;-)<br><br><br><br><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Olivier,</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>No, you have a way of separately providing display ‘labels’ for your actual objects in the list,</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>(html select)</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>list: self countries;</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>selected: country;</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>enabled: [:ea | ea notNil];</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>labels: [:ea | ea ifNil: ['---'] ifNotNil: [ea name]];</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>callback: [:value | country := value].</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;</span><o:p></o:p></p><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>-Boris</span><o:p></o:p></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;</span><o:p></o:p></p><div><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:-moz-use-text-color -moz-use-text-color'><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'> <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>] <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</span><o:p></o:p></p></div></div><p class=MsoNormal>&nbsp;<o:p></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><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>&nbsp;<o:p></o:p></pre><pre>-Boris<o:p></o:p></pre><pre>&nbsp;<o:p></o:p></pre><pre>&nbsp;<o:p></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>&nbsp;<o:p></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>&nbsp;<o:p></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>&nbsp;<o:p></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>&nbsp;<o:p></o:p></pre><pre>html&nbsp; select<o:p></o:p></pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; list:&nbsp; #(#Male&nbsp; #Female);<o:p></o:p></pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; selected:&nbsp; self&nbsp; contact&nbsp; gender;<o:p></o:p></pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; callback:&nbsp; [&nbsp; :value&nbsp; |<o:p></o:p></pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value&nbsp; =&nbsp; #Male<o:p></o:p></pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ifTrue:&nbsp; [&nbsp; self&nbsp; contact&nbsp; beMale&nbsp; ]<o:p></o:p></pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ifFalse:&nbsp; [&nbsp; self&nbsp; contact&nbsp; beFemale&nbsp; ]&nbsp; ].<o:p></o:p></pre><pre>&nbsp;<o:p></o:p></pre><pre>In the browser, I get this HTML code :<o:p></o:p></pre><pre>&nbsp;<o:p></o:p></pre><pre>&lt;select&nbsp; name=&quot;3&quot;&gt;&lt;option&nbsp; value=&quot;1&quot;selected=&quot;selected&quot;&gt;Male&lt;/option&gt;&lt;option<o:p></o:p></pre><pre>&nbsp; value=&quot;2&quot;&gt;Female&lt;/option&gt;&lt;/select&gt;<o:p></o:p></pre><pre>&nbsp;<o:p></o:p></pre><pre>My problem is how to set the values for each&lt;option&gt;&nbsp; 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>&nbsp;<o:p></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>&nbsp;<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><pre>&nbsp;<o:p></o:p></pre><pre>&nbsp;<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><p class=MsoNormal>&nbsp;<o:p></o:p></p><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>