hi andrei,
many thanks, that works fine. of course in wicket 6 one must call

response.render(JavaScriptHeaderItem.forScript("Wicket.AutoCompleteSettings.enterHidesWithNoSelection
 = true;",
                                                
"AutocompleteSettingsEnterHidesWithNoSelection"));

but that's minor.

best regards, ulf.
--
ulf schneider
+49 163 2505164
mail: [email protected]
blog: http://allesagil.net

datenlabor gmbh
sitz: paderborn, hrb 8819
geschäftsführer: ulf schneider
http://datenlabor.net

Am 18.09.2012 um 12:20 schrieb Andrei Costescu <[email protected]>:

> Hi Ulf,
> 
> Try to see if that setting solves your probl. (override this in your 
> AutoCompleteBehavior for ex.):
> 
>    public void renderHead(IHeaderResponse response)
>    {
> super.renderHead(response);
> response.renderJavascript("Wicket.AutoCompleteSettings.enterHidesWithNoSelection
>  = true;", "AutocompleteSettingsID");
>    }
> 
> If that works, maybe this setting should be made accessible via 
> AutoCompleteSettings class...
> 
> Regards,
> Andrei Costescu
> 
> Pe 18.09.2012 12:40, Martin Grigorov a scris:
>> Hi,
>> 
>> AjaxEditableLabel registers event listeners for blur and keydown on
>> the input field and depending on the keyCode it decides what to do.
>> 
>> One way to solve this is to fire a Wicket PubSub event (e.g.
>> Wicket.Event.publish('/editable/label/save')) and your behavior can
>> subscribe for it:
>> Wicket.Event.subscribe('/editable/label/save', function() {
>>   // hide the dropdown
>> });
>> This requires changes in AjaxEditableLabel itself.
>> 
>> Another way is to register additional similar event listeners on the
>> input yourself and do the same checks for keyCode and hide the
>> options.
>> 
>> 
>> On Tue, Sep 18, 2012 at 12:19 PM, ulf schneider <[email protected]> wrote:
>>> dear wicket developers,
>>> i'm using wicket 6 with an
>>> * AjaxEditableLabel
>>> * the editor has an AutoCompleteBehavior
>>> 
>>> everything works fine, but,
>>> 
>>> case 1 (wrong): when i provide input for the editor that is not in the 
>>> autocompletion options and press ENTER, the input is submitted (correct), 
>>> the editor is hidden and the label displayed (correct) but the 
>>> autocompletion options will not be hidden (wrong).
>>> 
>>> case 2 (right): if i press ESC, the value is not submitted (correct), the 
>>> editor is hidden and the label displayed (correct) and the autocompletion 
>>> options will be hidden (correct).
>>> 
>>> can i configure the the AutoCompletionBehavior in a way that the 
>>> autocompletion options will hide in both cases? i've found a variable 
>>> Wicket.AutoCompleteSettings =  { enterHidesWithNoSelection : false }; in 
>>> wicket-autocomplete.js.
>>> this may help, but i don't know how to use it.
>>> 
>>> best regards, ulf.
>>> --
>>> ulf schneider
>>> +49 163 2505164
>>> mail: [email protected]
>>> blog: http://allesagil.net
>>> 
>>> datenlabor gmbh
>>> sitz: paderborn, hrb 8819
>>> geschäftsführer: ulf schneider
>>> http://datenlabor.net
>>> 
>> 
>> 
> 

Reply via email to