You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Thomas Krause (JIRA)" <ji...@apache.org> on 2006/10/16 16:11:38 UTC

[jira] Updated: (WICKET-3) listen for "selection changed" event at AutocompleteTextField

     [ http://issues.apache.org/jira/browse/WICKET-3?page=all ]

Thomas Krause updated WICKET-3:
-------------------------------

    Attachment: wicket-autocomplete.diff

the diff mentioned in my post

> listen for "selection changed"  event at AutocompleteTextField
> --------------------------------------------------------------
>
>                 Key: WICKET-3
>                 URL: http://issues.apache.org/jira/browse/WICKET-3
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket-extensions
>    Affects Versions: 1.2.2
>            Reporter: Thomas Krause
>         Attachments: wicket-autocomplete.diff
>
>
> When using drop-down list you can listen to the onchange-Event (e.g. with a AjaxFormSubmitBehavior) in order to perform certain actions.
> This is not possible when using the AutocompleteTextField even if it is very like a drop-down list. Listening to onchange will activate you behavior at any keystroke and not only when the user selected one entry of the given list.
> As a "workaround" I changed the wicket-autocomplete.js in a way, that the AutocompleteTextField will fire the onload-Event whenever a selection was made. onload is no official event for a textfield in HTML so this is a kind of a hack. In addition, onload is fired when the RETURN was hit inside the textbox.
> I think the possibility to react on a selection by the user at an AutocompleteTextField would be desirable and enhances the things you can do with. E.g. I use AutocompleteTextField to display a list of matching dictionary-entries and if the user selects one of them I will load this one without additional interaction by the user. But since this is not really a very clean way of implementing this feature I'm in doubt wether this should really find it's way into a wicket release. Maybe there is already a way to listen to the mentioned event, but I didn't find it.
> diff of wicket-autocomplete.js: 
> 63a64
> >                                 obj.onload();
> 65c66,70
> <                   }
> ---
> >                     }
> >                     else
> >                     {
> >                       obj.onload();
> >                     }
> 200a206,207
> >                                         var obj=wicketGet(elementId);
> >                                         obj.onload();

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira