html select question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

html select question

Murtaza Zaidi
Hi,

I have a select list implemented as follows:

id := html nextId.
widget := html select.
widget
id: id;
style: ('height: %1px; width: %2px; z-index: 101; position: relative; font-size: 11px; ' bindWith: self height printString with: self width printString); 
                list: self getList;
selected: self selectedItemString;
onChange: (html jQuery ajax serializeThis);
onChange: (self renderPortal: [self setSelectedItem: self selectedItem] on: html);
callback: [:value | self selectedItem: (self getItemFrom: value)]

I'm seeing an issue where sometimes, the second onChange event fires before the callback which produces the wrong result. The correct behaviour would be the execution of events as follows:

onChange1
callback
onChange2

So far, I've been unable to find a way to do this. Any help would be great.

Thanks,
Murtaza

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: html select question

Paul DeBruicker
Can you do it like this?

onChange:(html jQuery ajax serializeThis;
                                          onComplete:(self renderPortal: [self setSelectedItem: self selectedItem] on:
html);


if not #onComplete: try #onSuccess:




Murtaza Zaidi wrote
Hi,

I have a select list implemented as follows:

id := html nextId.
widget := html select.
widget
id: id;
style: ('height: %1px; width: %2px; z-index: 101; position: relative;
font-size: 11px; ' bindWith: self height printString with: self width
printString);
                list: self getList;
selected: self selectedItemString;
onChange: (html jQuery ajax serializeThis);
onChange: (self renderPortal: [self setSelectedItem: self selectedItem] on:
html);
callback: [:value | self selectedItem: (self getItemFrom: value)]

I'm seeing an issue where sometimes, the second onChange event fires before
the callback which produces the wrong result. The correct behaviour would
be the execution of events as follows:

onChange1
callback
onChange2

So far, I've been unable to find a way to do this. Any help would be great.

Thanks,
Murtaza

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside