Wicket v1.4.17 I have a Form with a TextField and, among other things, two submit buttons. One is a typical submit button, the other is a submit button that acts as a cancel (closes stuff out and goes to the previous page).
This TextField has an AjaxEventBehavior of onBlur added to it, and inside that behavior, onEvent is overridden. onEvent does some validation of the TextField's contents and dynamically updates some stuff on the page. Meaning, when the TextField loses focus, it's going to immediately update a table on the page. The problem, however, is that the TextField has DefaultFocusBehavior on it as well so that when you first visit the page, the TextField already has focus. So upon first visiting the page, if you try to click either of the submit buttons (well, the "cancel" submit button really, because the other submit button is disabled until the TextField gets input), you have to click it twice before it activates. The first click does nothing, i.e., the onSubmit method doesn't fire. This appears to be caused by the onBlur/onEvent deal, because clicking the button means the TextField has lost focus, but it somehow results in that click not registering. Of course, commenting out the DefaultFocusBehavior line makes everything work fine since the TextField doesn't have focus on the first visit to the page, but since having focus on the TextField is our desired behavior, is there a way to make this work? Between NetBeans code completion in source and messing around in the debugger, I couldn't see a way to find out which component, if any, was clicked in order to trigger the onBlur/onEvent. That would be easy because I could see if it was the cancel button, and if so, I could trigger it's onSubmit (if that's actually even possible). I also didn't see any methods available to any component while inside the onEvent method that would help me get this working right. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/TextField-AjaxEventBehavior-onBlur-onEvent-tp4671150.html Sent from the Users forum mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
