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 something like this idea, though I don't really see the need for the isAutoFocusEnabled?

If you have an IFocusStrategy with a method getFocusComponent() which returns the component that should get the focus, then null could mean none (i.e., no autofocus), and anything else could mean focus that component. You could just have 1 single IFocusStrategy on a page, and if you want to chain them just make a ChainingFocusStrategy (i.e., one of them returns null, then go to the next).

What I would also like is if components can have their own IFocusStrategy, so that you can use these to compose your focus strategy for the page. This way complex components can manage their own focus strategy and you don't break encapsulation.

This all amounts to a setFocusStrategy on Component, with the one in the page ultimately choosing the component which gets the focus.

Just some thoughts...

Regards,
Sebastiaan



On Tue, Mar 11, 2008 at 3:36 PM, James Carman <[EMAIL PROTECTED]>
wrote:

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 belongs in "core"?
Shouldn't the core have facilities for managing component focus?  The
Ajax folks shouldn't be the only ones who get this luxury. :)  Perhaps
an IFocusManager interface?  Would that go on the IRequestCycle (since
you can only focus one component per request) or on the Page?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to