<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Georgia">We had a very similar question on 28-29 Sept
(see "Using the select tag")</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: ['---'] ifNotNil: [ea
printableVersion]];<br>
callback: [:value | self contact gender: value].<br>
<br>
Cheers,<br>
Bob<br>
<br>
On 10/13/11 10:03 AM, squeakman wrote:
<blockquote cite="mid:j76r2s$rt6$1@dough.gmane.org" 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: 'stocksList';
<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 "self jsForGetSelectedIndex" 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 class="moz-txt-link-abbreviated" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a>
<br>
<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>
<br>
<br>
</blockquote>
</body>
</html>