<div>I would add that to get the callback to occur via AJAX add:</div>
<div>onChange: (html jQuery ajax serializeThisWithHidden)</div>
<div> </div>
<div>And in an attempt to make it clearer:</div>
<div>The parameter in the list: message is a collection of *objects* and the callback :value will be the selected object. If you give it a collection of string representations of your Stock objects, you will get back the selected string representation. But if you give it a collection of Stocks in this case, you will get back the selected Stock object. Seaside handles the bookwork for you in determining which object in the collection was selected. You don&#39;t need to deal with the selected index if you don&#39;t want to.  <br>
<br></div>
<div class="gmail_quote">On Thu, Oct 13, 2011 at 10:16 AM, Bob Arning <span dir="ltr">&lt;<a href="mailto:arning@charm.net">arning@charm.net</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div text="#000000" bgcolor="#FFFFFF"><font face="Georgia">We had a very similar question on 28-29 Sept (see &quot;Using the select tag&quot;)</font>. The end result was something like:<br><br>(html select)<br>    list: self genders;<br>
    selected: self contact gender;<br>    enabled: [:ea | ea notNil];<br>    labels: [:ea | ea ifNil: [&#39;---&#39;] ifNotNil: [ea printableVersion]];<br>    callback: [:value | self contact gender: value].<br><br>Cheers,<br>
<font color="#888888">Bob</font> 
<div>
<div></div>
<div class="h5"><br><br>On 10/13/11 10:03 AM, squeakman wrote: 
<blockquote type="cite">Hello All, <br><br>Is there a way to get the selectedItem when the Ajax callback is triggered in an html select? <br><br>The following code snippet works for me but I think there must be a better way. <br>
<br>(html select) <br>  id: &#39;stocksList&#39;; <br>  list: self listOfStocks; <br>  onClick: (html scriptaculous request <br>              callback: [:i |self selectedStockIndex: i asNumber + 1.] <br>              value: self jsForGetSelectedIndex). <br>
<br><br>Note that I am using the call:value: method. <br><br>The &quot;self jsForGetSelectedIndex&quot; returns the javascript code that gets the selected index. <br><br>In the callback: I use this returned value to figure out which item was selected. <br>
<br>Is there a better way to do this? <br><br>Thanks, <br>Frank <br><br>_______________________________________________ <br>seaside mailing list <br><a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a> <br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a> <br><br></blockquote></div></div></div><br>_______________________________________________<br>
seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></blockquote></div><br>