[Seaside] Q on "html select" and how to get selected item in
an Ajax callback
arning at charm.net
Thu Oct 13 14:16:12 UTC 2011
We had a very similar question on 28-29 Sept (see "Using the select
tag"). The end result was something like:
list: self genders;
selected: self contact gender;
enabled: [:ea | ea notNil];
labels: [:ea | ea ifNil: ['---'] ifNotNil: [ea printableVersion]];
callback: [:value | self contact gender: value].
On 10/13/11 10:03 AM, squeakman wrote:
> Hello All,
> Is there a way to get the selectedItem when the Ajax callback is
> triggered in an html select?
> The following code snippet works for me but I think there must be a
> better way.
> (html select)
> id: 'stocksList';
> list: self listOfStocks;
> onClick: (html scriptaculous request
> callback: [:i |self selectedStockIndex: i asNumber + 1.]
> value: self jsForGetSelectedIndex).
> Note that I am using the call:value: method.
> the selected index.
> In the callback: I use this returned value to figure out which item
> was selected.
> Is there a better way to do this?
> seaside mailing list
> seaside at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside