Re: Default Focus Behavior?

2009-12-28 Thread duncan787
Great tip, thanks! After implementing, I see that the behavior is added to the text field correctly, but the renderHead() method is not being called, can you help me understand why that is? jwcarman wrote: On 3/9/08, James Carman ja...@carmanconsulting.com wrote: On 3/9/08, Warren

Re: Default Focus Behavior?

2009-12-28 Thread Martin Makundi
Hi! Did you implement the IHeaderContributor and mark @Override? 2009/12/28 duncan787 duncan...@gmail.com: Great tip, thanks!  After implementing, I see that the behavior is added to the text field correctly, but the renderHead() method is not being called, can you help me understand why

Re: Default Focus Behavior?

2009-12-28 Thread duncan787
Thank you MartinM. Your question caused me to question the other methods I was overriding from the super...after removing those unnecessary overridden methods, its working like a charm. Thank you! MartinM wrote: Hi! Did you implement the IHeaderContributor and mark @Override?

Re: Default Focus Behavior?

2008-12-29 Thread Scott Swank
Jonathan, Have you considered O'Reilly's Cookbook series? I've done some tech review for them over the years, though not recently. E-mail me directly if you'd like a potentially dated contact. :) Scott On Sun, Dec 28, 2008 at 9:26 AM, Jonathan Locke jonathan.lo...@gmail.com wrote: I have

Re: Default Focus Behavior?

2008-12-28 Thread Jonathan Locke
I have a really elegant solution to this problem that is general enough to go in core or extensions eventually (solves all of the above problems). Actually, I'm putting together a short, but action-packed book called Twenty-Six Wicket Tricks and the code for this problem is going to be trick F

Re: Default Focus Behavior?

2008-12-02 Thread Antony Stubbs
Why not put this code into Wicket? jwcarman wrote: On 3/11/08, Martijn Dashorst [EMAIL PROTECTED] wrote: I suggest wiki. Done: http://cwiki.apache.org/confluence/display/WICKET/Request+Focus+on+a+Specific+Form+Component I'm happy now. My work (no matter how trivial) may help

Re: Default Focus Behavior?

2008-06-12 Thread Rod Good
Hi, I'm trying to set the 'focus on load' to an AutoCompleteTextField within a form. I tried extending the technique outlined by James Carman (see link) to extend AbstractDefaultAjaxBehavior, without success. Any thoughts on how to do this ? Thanks, Rod.

RE: Default Focus Behavior?

2008-06-12 Thread Rod Good
) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:684) at java.lang.Thread.run(Thread.java:619) -Original Message- From: Rod Good Sent: Friday, 13 June 2008 1:06 PM To: users@wicket.apache.org Subject: Re: Default Focus Behavior? Hi, I'm trying to set the 'focus

Re: Default Focus Behavior?

2008-05-29 Thread Doug Donohoe
This helped me. Thanks, jwcarman! -Doug jwcarman wrote: On 3/11/08, Martijn Dashorst [EMAIL PROTECTED] wrote: I suggest wiki. Done: http://cwiki.apache.org/confluence/display/WICKET/Request+Focus+on+a+Specific+Form+Component I'm happy now. My work (no matter how trivial) may

Re: Default Focus Behavior?

2008-05-29 Thread James Carman
Glad to hear it! If you are using it to highlight/focus on errors and you have the time, update the wiki with a little example since I never got around to it. :) On Thu, May 29, 2008 at 6:43 PM, Doug Donohoe [EMAIL PROTECTED] wrote: This helped me. Thanks, jwcarman! -Doug jwcarman

Re: Default Focus Behavior?

2008-03-11 Thread Martijn Dashorst
We have this discussion with each major release of Wicket, and each time there are 100 ways to skin the cat. We want not only to minimize the surface area, but also the number of requests to alter the behavior of existing functionality. If we implement method X, then sure enough someone comes

Re: Default Focus Behavior?

2008-03-11 Thread James Carman
On 3/11/08, Martijn Dashorst [EMAIL PROTECTED] wrote: We have this discussion with each major release of Wicket, and each time there are 100 ways to skin the cat. We want not only to minimize the surface area, but also the number of requests to alter the behavior of existing functionality.

Re: Default Focus Behavior?

2008-03-11 Thread Martijn Dashorst
I suggest wiki. Thanks, Martijn On 3/11/08, James Carman [EMAIL PROTECTED] wrote: On 3/11/08, Martijn Dashorst [EMAIL PROTECTED] wrote: We have this discussion with each major release of Wicket, and each time there are 100 ways to skin the cat. We want not only to minimize the

Re: Default Focus Behavior?

2008-03-11 Thread James Carman
On 3/11/08, Martijn Dashorst [EMAIL PROTECTED] wrote: I suggest wiki. Done: http://cwiki.apache.org/confluence/display/WICKET/Request+Focus+on+a+Specific+Form+Component I'm happy now. My work (no matter how trivial) may help someone someday! :) I don't have time to do so now, but I might

Re: Default Focus Behavior?

2008-03-11 Thread Martijn Dashorst
Another option would be (if there is enough interest) to add it to wicketstuff minis. Martijn -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.1 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

Re: Default Focus Behavior?

2008-03-11 Thread Johan Compagner
i still think that behaviors to control focus is a bit wrong focus should have 1 entry point and i guess that is WebPage.focusComponent() or maybe Form (but you could have 2) By the way we have focus support in ajax mode... see AjaxRequestTarget johan On Tue, Mar 11, 2008 at 12:41 PM, James

Re: Default Focus Behavior?

2008-03-11 Thread James Carman
On 3/11/08, Martijn Dashorst [EMAIL PROTECTED] wrote: Another option would be (if there is enough interest) to add it to wicketstuff minis. Yeah, I thought about that. And, I may try to put that in there. Perhaps there could be a few focus behaviors in there? Perhaps even a FocusBehaviors

Re: Default Focus Behavior?

2008-03-11 Thread Sebastiaan van Erk
Sebastiaan van Erk wrote: Johan Compagner wrote: i still think that behaviors to control focus is a bit wrong focus should have 1 entry point I agree. and i guess that is WebPage.focusComponent() I agree on that one too. or maybe Form (but you could have 2) Exactly, so not a good

Re: Default Focus Behavior?

2008-03-11 Thread Sebastiaan van Erk
Johan Compagner wrote: i still think that behaviors to control focus is a bit wrong focus should have 1 entry point I agree. and i guess that is WebPage.focusComponent() I agree on that one too. or maybe Form (but you could have 2) Exactly, so not a good idea. The page should determine

Re: Default Focus Behavior?

2008-03-11 Thread James Carman
On 3/11/08, Johan Compagner [EMAIL PROTECTED] wrote: i still think that behaviors to control focus is a bit wrong focus should have 1 entry point and i guess that is WebPage.focusComponent() or maybe Form (but you could have 2) By the way we have focus support in ajax mode... see

Re: Default Focus Behavior?

2008-03-11 Thread Johan Compagner
you do WebPage.focusComponent(textField) johan On Tue, Mar 11, 2008 at 2:30 PM, James Carman [EMAIL PROTECTED] wrote: On 3/11/08, Johan Compagner [EMAIL PROTECTED] wrote: i still think that behaviors to control focus is a bit wrong focus should have 1 entry point and i guess that is

Re: Default Focus Behavior?

2008-03-11 Thread James Carman
On 3/11/08, Johan Compagner [EMAIL PROTECTED] wrote: you do WebPage.focusComponent(textField) I mean, in what class? Your page class? In a component class? I'm just trying to understand what the difference is between doing WebPage.focusComponent(textField) or textField.add(new

Re: Default Focus Behavior?

2008-03-11 Thread Johan Compagner
MyPage() { textField1.add(new FocuOnLoadBehavior()); textField2.add(new FocuOnLoadBehavior()); textField3.add(new FocuOnLoadBehavior()); } which fields gets the focus? On Tue, Mar 11, 2008 at 2:49 PM, James Carman [EMAIL PROTECTED] wrote: On 3/11/08, Johan Compagner [EMAIL PROTECTED] wrote:

Re: Default Focus Behavior?

2008-03-11 Thread Johan Compagner
and a behavior is really the wrong thing Because who says if you render the page again that it has to again set the focus on that one? MyPage() { textField1.add(new FocuOnLoadBehavior()); textField2.add(new FocuOnLoadBehavior()); textField3.add(new FocuOnLoadBehavior()); Form form = new

Re: Default Focus Behavior?

2008-03-11 Thread Johan Compagner
that still wouldn't help adding 3 of them at once On Tue, Mar 11, 2008 at 3:17 PM, Gerolf Seitz [EMAIL PROTECTED] wrote: the behavior would have to be temporary. On Tue, Mar 11, 2008 at 3:14 PM, Johan Compagner [EMAIL PROTECTED] wrote: and a behavior is really the wrong thing Because

Re: Default Focus Behavior?

2008-03-11 Thread James Carman
On 3/11/08, Gerolf Seitz [EMAIL PROTECTED] wrote: the behavior would have to be temporary. Yes, the behaviors stay with the component. I guess that would screw this up! :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Default Focus Behavior?

2008-03-11 Thread James Carman
On 3/11/08, Johan Compagner [EMAIL PROTECTED] wrote: that still wouldn't help adding 3 of them at once Well, adding three of them like this would just be stupid. :) It wouldn't really break anything. The last one that gets rendered would probably get the focus, since it would be the last one

Re: Default Focus Behavior?

2008-03-11 Thread Johan Compagner
yes so it is not the last one you ask to have focus on Very confusing for an average user thats why there should be a single point just like AjaxRequestTarget.focusComponent() works. johan On Tue, Mar 11, 2008 at 3:24 PM, James Carman [EMAIL PROTECTED] wrote: On 3/11/08, Johan Compagner

Re: Default Focus Behavior?

2008-03-11 Thread Gerolf Seitz
the behavior would have to be temporary. On Tue, Mar 11, 2008 at 3:14 PM, Johan Compagner [EMAIL PROTECTED] wrote: and a behavior is really the wrong thing Because who says if you render the page again that it has to again set the focus on that one? MyPage() { textField1.add(new

Re: Default Focus Behavior?

2008-03-11 Thread James Carman
On 3/11/08, Johan Compagner [EMAIL PROTECTED] wrote: yes so it is not the last one you ask to have focus on Very confusing for an average user thats why there should be a single point just like AjaxRequestTarget.focusComponent() works. Ok, you've sold me. So, is this something that

Re: Default Focus Behavior?

2008-03-11 Thread Gerolf Seitz
how about boolean WebPage#isAutoFocusEnabled and the possibility to provide several IFocusStrategy instances with different priority? this would allow to eg only set the focus on the first formcomponent of the first form if no other formcomponent has an error... On Tue, Mar 11, 2008 at 3:36 PM,

Re: Default Focus Behavior?

2008-03-11 Thread Johan Compagner
hmm the request cycle would be quite awful its not really there for that kind of state The problem is that the AjaxRequestTarget is in normal rendering something like PageRequestTarget. The problem is you cant really through it on a Page because the page can maybe not be accessed (if you have a

Re: Default Focus Behavior?

2008-03-11 Thread James Carman
On 3/11/08, Johan Compagner [EMAIL PROTECTED] wrote: hmm the request cycle would be quite awful its not really there for that kind of state The problem is that the AjaxRequestTarget is in normal rendering something like PageRequestTarget. The problem is you cant really through it on a

Re: Default Focus Behavior?

2008-03-11 Thread Sebastiaan van Erk
Gerolf Seitz wrote: how about boolean WebPage#isAutoFocusEnabled and the possibility to provide several IFocusStrategy instances with different priority? this would allow to eg only set the focus on the first formcomponent of the first form if no other formcomponent has an error... I like

Re: Default Focus Behavior?

2008-03-10 Thread Nino Saturnino Martinez Vazquez Wael
What I mean is commonly used when users must enter data quickly, eg no mouse clicks. Not sure if the use case is large enough, though.. So the following thing can happend: When you fill a textfield to a certain length(or press enter) or choose a radio button it automaticly passes on to the

Re: Default Focus Behavior?

2008-03-10 Thread Igor Vaynberg
On Sun, Mar 9, 2008 at 1:37 PM, James Carman [EMAIL PROTECTED] wrote: On 3/9/08, djo.mos [EMAIL PROTECTED] wrote: This simply looks great ! I think this should make it into the core Wicket behaviors as the componenet focus is quite useful. Me too! That's why I submitted:

Re: Default Focus Behavior?

2008-03-10 Thread Gin Yeah
Can we have a faq in the wiki enumerating all the possible scenarios and solutions? On Sun, Mar 9, 2008 at 11:51 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: On Sun, Mar 9, 2008 at 1:37 PM, James Carman [EMAIL PROTECTED] wrote: On 3/9/08, djo.mos [EMAIL PROTECTED] wrote: This

Re: Default Focus Behavior?

2008-03-10 Thread James Carman
On 3/10/08, Igor Vaynberg [EMAIL PROTECTED] wrote: i dont think something like this should go into core. it seems pretty clear from this thread that there are very many ways to do this and each project will use their own. what you have proposed seems trivial to construct, so for projects

RE: Default Focus Behavior?

2008-03-09 Thread Warren
WebMarkupContainer bodyTag = new WebMarkupContainer(bodyTag); bodyTag.add(new SimpleAttributeModifier(onload, form.username.focus();)); -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of James Carman Sent: Sunday, March 09, 2008 7:58 AM To:

Re: Default Focus Behavior?

2008-03-09 Thread James Carman
On 3/9/08, Warren [EMAIL PROTECTED] wrote: WebMarkupContainer bodyTag = new WebMarkupContainer(bodyTag); bodyTag.add(new SimpleAttributeModifier(onload, form.username.focus();)); Ok, but wouldn't it be cooler/easier/more java-oriented to do: TextField userName = new TextField(userName);

Re: Default Focus Behavior?

2008-03-09 Thread James Carman
On 3/9/08, James Carman [EMAIL PROTECTED] wrote: On 3/9/08, Warren [EMAIL PROTECTED] wrote: WebMarkupContainer bodyTag = new WebMarkupContainer(bodyTag); bodyTag.add(new SimpleAttributeModifier(onload, form.username.focus();)); Ok, but wouldn't it be cooler/easier/more java-oriented

Re: Default Focus Behavior?

2008-03-09 Thread Nino Saturnino Martinez Vazquez Wael
true..! You could add it to wicket input events , if it fits.. regards Nino James Carman wrote: On 3/9/08, Warren [EMAIL PROTECTED] wrote: WebMarkupContainer bodyTag = new WebMarkupContainer(bodyTag); bodyTag.add(new SimpleAttributeModifier(onload, form.username.focus();)); Ok,

Re: Default Focus Behavior?

2008-03-09 Thread Nino Saturnino Martinez Vazquez Wael
What about a chaining component? EG you enter something in form.field a, and when thats filled then it jumps to form field b..? Etc... regards Nino James Carman wrote: On 3/9/08, Warren [EMAIL PROTECTED] wrote: WebMarkupContainer bodyTag = new WebMarkupContainer(bodyTag);

RE: Default Focus Behavior?

2008-03-09 Thread Warren
PROTECTED] Behalf Of James Carman Sent: Sunday, March 09, 2008 8:52 AM To: users@wicket.apache.org Subject: Re: Default Focus Behavior? On 3/9/08, James Carman [EMAIL PROTECTED] wrote: On 3/9/08, Warren [EMAIL PROTECTED] wrote: WebMarkupContainer bodyTag = new WebMarkupContainer(bodyTag

Re: Default Focus Behavior?

2008-03-09 Thread djo.mos
jwcarman wrote: How about something like: public class DefaultFocusBehavior extends AbstractBehavior { private Component component; public void bind( Component component ) { this.component = component; component.setOutputMarkupId(true); }

Re: Default Focus Behavior?

2008-03-09 Thread Peter Ertl
-1 for letting components handle focus. There's only _one_ focus that can set on a page at a time. What if several components demand focus? Who will be the winner? Also, not every WebComponent can receive focus (Label, Image, ...) but only FormComponents (input, select, button, ...) I

Re: Default Focus Behavior?

2008-03-09 Thread James Carman
On 3/9/08, Peter Ertl [EMAIL PROTECTED] wrote: -1 for letting components handle focus. There's only _one_ focus that can set on a page at a time. What if several components demand focus? Who will be the winner? Well, the last one that requests it will win because it will be the last

Re: Default Focus Behavior?

2008-03-09 Thread James Carman
I don't think I understand what you mean here. Do you mean something like setting the tab order like in Swing? On 3/9/08, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: What about a chaining component? EG you enter something in form.field a, and when thats filled then it

Re: Default Focus Behavior?

2008-03-09 Thread James Carman
On 3/9/08, djo.mos [EMAIL PROTECTED] wrote: This simply looks great ! I think this should make it into the core Wicket behaviors as the componenet focus is quite useful. Me too! That's why I submitted: https://issues.apache.org/jira/browse/WICKET-1404 I was pretty surprised something

Re: Default Focus Behavior?

2008-03-09 Thread Sebastiaan van Erk
I think he means that, suppose you have a username and password field; then if the username is already filled in (e.g. from a cookie), then focus should go to the next field (password field). It probably should be the same as the tab order (first empty field in tab order gets focus) from a ui

Re: Default Focus Behavior?

2008-03-09 Thread James Carman
On 3/9/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote: I think he means that, suppose you have a username and password field; then if the username is already filled in (e.g. from a cookie), then focus should go to the next field (password field). Well, since you set up the behavior in your

RE: Default Focus Behavior?

2008-03-09 Thread Warren
I need to write a function that involves many components. It would be nice to add a behavior to a form, like you have with a TextField, that would construct a function that included all of the relevant components of that form. The function I need to write looks like this: function keyPressed() {

Re: Default focus behavior for ajax request

2007-09-11 Thread Matej Knopp
Because currently there is no way during ajax processing to determine that the event was a focus related one. I think that it's good to restore focus on last focused element by default. But I'm also aware that it causes problems with focus related event, so i think maybe we should just call

Re: Default focus behavior for ajax request

2007-09-11 Thread Carlos Pita
behavior if the event is onblur. Can you submit RFE? Done. I filed it as minor improvement https://issues.apache.org/jira/browse/WICKET-957. Because currently there is no way during ajax processing to determine that the event was a focus related one. I think that it's good to Maybe setting

Re: Default focus behavior for ajax request

2007-09-11 Thread Johan Compagner
see my comments in that issue. Its not that we have to do something on the serverside this is a clientside issue. johan On 9/11/07, Carlos Pita [EMAIL PROTECTED] wrote: behavior if the event is onblur. Can you submit RFE? Done. I filed it as minor improvement

Re: Default focus behavior for ajax request

2007-09-11 Thread Carlos Pita
Dunno. Up till now my workaround is to set focusComponent to null at the server-side for validation purposes. I'm not suggesting that this should be wicket's approach or something similar, of course. Regards, Carlos On 9/11/07, Johan Compagner [EMAIL PROTECTED] wrote: see my comments in that