Overwrite #renderHead(IHeaderResponse), check for the first component with error message and add a little javascript:

response.renderOnLoadJavascript(String.format("document.getElementById('%s').focus()", componentWithError.getMarkupId()));

Regards
Sven

On 12/23/2011 02:50 PM, chimaira wrote:
Hi All,
I using wicket for my war application.
I use wickets validator and feedback to control form inputs and constraints.
so usefull . easy and amazing.

But:
I wish to set a focus on a wrong input field (or change color to red for ex)
after getting feedback error from wickets 'feedback'. but when this last one
(feedback) is invoked, I can't do anything. I have to focus manually (with
my pointer ) on the wrng field.

My question, how to control focus after feedback . or how to perfomr actions
afeter getting feedback.

Thanks a lot .

MA

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Control-focus-on-input-after-a-form-feedback-tp4228658p4228658.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to