<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <title></title>
    <link href="chrome://translator/skin/floatingPanel.css"
      type="text/css" rel="stylesheet">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    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 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=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]-->
      <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> </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 ‘labels’ 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> </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> </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> </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 class="moz-txt-link-abbreviated" href="mailto:seaside-bounces@lists.squeakfoundation.org">seaside-bounces@lists.squeakfoundation.org</a>
                [<a 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> </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> </o:p></pre>
        <pre>-Boris<o:p></o:p></pre>
        <pre><o:p> </o:p></pre>
        <pre><o:p> </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> </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> </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> </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> </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> </o:p></pre>
            <pre>In the browser, I get this HTML code :<o:p></o:p></pre>
            <pre><o:p> </o:p></pre>
            <pre>&lt;select  name="3"&gt;&lt;option  value="1"selected="selected"&gt;Male&lt;/option&gt;&lt;option<o:p></o:p></pre>
            <pre>  value="2"&gt;Female&lt;/option&gt;&lt;/select&gt;<o:p></o:p></pre>
            <pre><o:p> </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> </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> </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> </o:p></pre>
        <pre><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>
        <p class="MsoNormal"><o:p> </o:p></p>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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>
    <br>
    <div style="bottom: auto; left: 0px; right: auto; top: 237px;
      display: none;" class="translator-theme-default"
      id="translator-floating-panel">
      <div title="Cliquer pour traduire"
        id="translator-floating-panel-button"></div>
    </div>
  </body>
</html>