You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sven Meier (JIRA)" <ji...@apache.org> on 2019/04/08 17:54:00 UTC

[jira] [Commented] (WICKET-6652) Improve setfocus javascript function

    [ https://issues.apache.org/jira/browse/WICKET-6652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16812658#comment-16812658 ] 

Sven Meier commented on WICKET-6652:
------------------------------------

To my knowledge AjaxFormComponentUpdatingBehavior does not alter the focus.

I assume you're adding your input to the AjaxRequestTarget? That would indeed replace the HTML input element and reset the focus.

> Improve setfocus javascript function
> ------------------------------------
>
>                 Key: WICKET-6652
>                 URL: https://issues.apache.org/jira/browse/WICKET-6652
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-core
>    Affects Versions: 8.3.0
>            Reporter: Giovanni Cuccu
>            Priority: Major
>
> I'm trying to rewrite a simple Angular app in wicket and I'm facing an issue.
> My webapp must validate the text entered by user in real time. I create a AjaxFormComponentUpdatingBehavior tirggered by keyup event. the main problem is that when wicket validates the input it refocus the component on the html placing the caret at the beggining of the field, before the already typed text. So if I Digit 'gi' as text and the text is invalid the caret of the filed is before the 'g' and not after the 'i'.  Is it possibile to have a patch or a workaround (i tried to use appendJavascript in my Behavior but with no luck).
> Thanks a lot.
>  
> Giovanni
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)