AjaxEventBehavior onfocus
Hi, i'm trying to implement a kind of onfocus event for a TextField but I don't know how to do this exactly. I found the AjaxEventBehavior in the mailinglist but don't know how to use it right. Here is my sample: public class MyAjaxTextField extends TextField{ public MyAjaxTextField(String arg0) { super(arg0); } public MyAjaxTextField(String arg0, IModel model) { super(arg0,model); PropertyModel pm = (PropertyModel)model; Person person = (Person)pm.getTarget(); this.add(new MyAjaxEventBehavior(onfocus)); } } # public class MyAjaxEventBehavior extends AjaxEventBehavior{ public MyAjaxEventBehavior(String event) { super(event); } @Override protected void onEvent(AjaxRequestTarget target) { System.out.println(MyAjaxEventBehavior called.); } } So this works fine an the MyAjaxEventBehavior called is written to the console but it is written every time. It doesn't matter if it is onfocus or onblur or whatever. How do I have to change things that only by onfocus the System.out part is being displayed? Fabian
Re: AjaxEventBehavior onfocus
Hi again, well I think i got the Problem. Everytime I switch between Eclipse an Firefox the onfocus - Event is triggered. Am I right? So that's the reason why the MyAjaxEventBehavior called will be displayed that often? Wouldn't that be a problem in a productiv environment? For example: A user starts his application within a browser an activates an onfocus field. Whyever he has to change from his webbrowser to another app and when he returns the onfocus - Event is triggered again. Is this a normal onfocus behavior? Freundliche Grüße / With kind regards Fabian Hagen SN AG Klingenderstr. 5 D 33100 Paderborn voice +49 5251/1581- 862 fax +49 5251/1581-71 eMail [EMAIL PROTECTED] web http://www.s-und-n.de Vorstand Klaus Beverungen Josef Tillmann Vorsitzender des Aufsichtsrates Heinz-Dieter Wendorff Handelsregister Amtsgericht Paderborn HRB 3270
Re: AjaxEventBehavior onfocus
[EMAIL PROTECTED] wrote: Everytime I switch between Eclipse an Firefox the onfocus - Event is triggered. Am I right? Yep, that's normal. You should also receive the corresponding onblur event when the user alt+tabs away. This is nothing to do with Wicket - it's how the browsers work. Regards, Al - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]