[Seaside] [Scriptaculous] Problem with Autocompleter
renggli at gmail.com
Sat Apr 8 22:25:50 UTC 2006
> First of all, thanks for your answer... but it still doesn't work :'(
> When I add the 'onHide' event, the list appears but fades so fast that no
> click is possible.
This is strange, because it works for me.
However there is one major problem I didn't thought of: #onHide: and
#onShow: are (internal) callback-events used to display and hide the
completion-list. The original intention of their existence is to be
able to use a different effect to show and hide the completion-list,
not to do other things such as to serialize the input-field.
So probably we should go a different path (as usual, there are
different ways to do more or less the same thing):
- Add an #onBlur: event to the text-input that serializes the
text-field as soon as the input box looses its focus.
- Add a submit-button (or a default form action, if you don't want a
button) to submit the data, either transparently trough an AJAX
request or using a normal form callback.
I published Scriptaculous.60-lr.mcz to SqueakSource that reverts to
the original code and adds an #onBlur: event. Depending on your exact
requirements you might want to try my other suggestion.
callback: [ :value | text := value ];
onBlur: (html request
script: ((html autocomplete: 'name')
on: #renderListOn: of: self).
More information about the Seaside