<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p class="MsoNormal">Perhaps it might be clearer to rewrite Boris's
      example as:</p>
    <p class="MsoNormal"><span style="font-size: 11pt; font-family:
        &quot;Calibri&quot;,&quot;sans-serif&quot;; color: rgb(31, 73,
        125);"><br>
        (html select)<o:p></o:p></span></p>
    <p class="MsoNormal"><span style="font-size: 11pt; font-family:
        &quot;Calibri&quot;,&quot;sans-serif&quot;; color: rgb(31, 73,
        125);"> &nbsp;&nbsp;&nbsp; list: self genders;<o:p></o:p></span></p>
    <p class="MsoNormal"><span style="font-size: 11pt; font-family:
        &quot;Calibri&quot;,&quot;sans-serif&quot;; color: rgb(31, 73,
        125);"> &nbsp;&nbsp;&nbsp; selected: self contact gender;<o:p></o:p></span></p>
    <p class="MsoNormal"><span style="font-size: 11pt; font-family:
        &quot;Calibri&quot;,&quot;sans-serif&quot;; color: rgb(31, 73,
        125);"> &nbsp;&nbsp;&nbsp; enabled: [:ea | ea notNil];<o:p></o:p></span></p>
    <p class="MsoNormal"><span style="font-size: 11pt; font-family:
        &quot;Calibri&quot;,&quot;sans-serif&quot;; color: rgb(31, 73,
        125);"> &nbsp;&nbsp;&nbsp; labels: [:ea | ea ifNil: ['---'] ifNotNil: [ea
        printableVersion]];<o:p></o:p></span></p>
    <p class="MsoNormal"><span style="font-size: 11pt; font-family:
        &quot;Calibri&quot;,&quot;sans-serif&quot;; color: rgb(31, 73,
        125);"> &nbsp;&nbsp;&nbsp; callback: [:value | self contact gender: value].<o:p></o:p></span></p>
    <span style="font-size: 11pt; font-family:
      &quot;Calibri&quot;,&quot;sans-serif&quot;; color: rgb(31, 73,
      125);"><o:p></o:p></span><br>
    Where Gender becomes a first-class object rather than some String,
    Character or Integer value.<br>
    <br>
    Cheers,<br>
    Bob<br>
    <br>
    On 9/29/11 3:09 PM, Olivier Auverlot wrote:
    <blockquote cite="mid:4E84C286.3050006@gmail.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <title></title>
      <link href="chrome://translator/skin/floatingPanel.css"
        type="text/css" rel="stylesheet">
      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 moz-do-not-send="true" class="moz-txt-link-freetext"
        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>
      <blockquote
        cite="mid:CBE458BB46D12C48A467980CEDA34121055040D0@Pondo.yvr.png"
        type="cite">
        <meta http-equiv="Content-Type" content="text/html;
          charset=ISO-8859-1">
        <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]-->
        <div class="WordSection1">
          <p class="MsoNormal"><span style="font-size: 11pt;
              font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;
              color: rgb(31, 73, 125);">Olivier,<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-size: 11pt;
              font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;
              color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
          <p class="MsoNormal"><span style="font-size: 11pt;
              font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;
              color: rgb(31, 73, 125);">No, you have a way of separately
              providing display &#8216;labels&#8217; for your actual objects in the
              list,<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-size: 11pt;
              font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;
              color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
          <p class="MsoNormal"><span style="font-size: 11pt;
              font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;
              color: rgb(31, 73, 125);">(html select)<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-size: 11pt;
              font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;
              color: rgb(31, 73, 125);"> list: self countries;<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-size: 11pt;
              font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;
              color: rgb(31, 73, 125);"> selected: country;<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-size: 11pt;
              font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;
              color: rgb(31, 73, 125);"> enabled: [:ea | ea notNil];<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-size: 11pt;
              font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;
              color: rgb(31, 73, 125);"> labels: [:ea | ea ifNil:
              ['---'] ifNotNil: [ea name]];<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-size: 11pt;
              font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;
              color: rgb(31, 73, 125);"> callback: [:value | country :=
              value].<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="font-size: 11pt;
              font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;
              color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
          <div>
            <p class="MsoNormal"><span style="font-size: 11pt;
                font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;
                color: rgb(31, 73, 125);">-Boris<o:p></o:p></span></p>
          </div>
          <p class="MsoNormal"><span style="font-size: 11pt;
              font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;
              color: rgb(31, 73, 125);"><o:p>&nbsp;</o:p></span></p>
          <div>
            <div style="border-right: medium none; border-width: 1pt
              medium medium; border-style: solid none none;
              border-color: rgb(181, 196, 223) -moz-use-text-color
              -moz-use-text-color; padding: 3pt 0in 0in;">
              <p class="MsoNormal"><b><span style="font-size: 10pt;
                    font-family:
                    &quot;Tahoma&quot;,&quot;sans-serif&quot;; color:
                    windowtext;">From:</span></b><span style="font-size:
                  10pt; font-family:
                  &quot;Tahoma&quot;,&quot;sans-serif&quot;; color:
                  windowtext;"> <a moz-do-not-send="true"
                    class="moz-txt-link-abbreviated"
                    href="mailto:seaside-bounces@lists.squeakfoundation.org">seaside-bounces@lists.squeakfoundation.org</a>
                  [<a moz-do-not-send="true"
                    class="moz-txt-link-freetext"
                    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<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 moz-do-not-send="true" href="mailto:seaside-bounces@lists.squeakfoundation.org">seaside-bounces@lists.squeakfoundation.org</a> [<a moz-do-not-send="true" 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: 5pt; margin-bottom: 5pt;">
            <pre>2011/9/29 Olivier Auverlot<a moz-do-not-send="true" href="mailto:olivier.auverlot@gmail.com">&lt;olivier.auverlot@gmail.com&gt;</a>:<o:p></o:p></pre>
            <blockquote style="margin-top: 5pt; margin-bottom: 5pt;">
              <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&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><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&nbsp; name="3"&gt;&lt;option&nbsp; value="1"selected="selected"&gt;Male&lt;/option&gt;&lt;option<o:p></o:p></pre>
              <pre>&nbsp; value="2"&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;&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><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 moz-do-not-send="true" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><o:p></o:p></pre>
            <pre><a moz-do-not-send="true" 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 moz-do-not-send="true" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><o:p></o:p></pre>
          <pre><a moz-do-not-send="true" 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 moz-do-not-send="true" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><o:p></o:p></pre>
          <pre><a moz-do-not-send="true" 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>
        <pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
seaside mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>
</pre>
      </blockquote>
      <br>
      <div style="bottom: auto; left: 0px; right: auto; top: 237px;
        display: none;" class="translator-theme-default"
        id="translator-floating-panel"> </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
seaside mailing list
<a class="moz-txt-link-abbreviated" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a>
<a class="moz-txt-link-freetext" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>
</pre>
    </blockquote>
  </body>
</html>