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 Form()
{
onSubmit()
{
// validate fails on textfield4 so transfer focus to that one like
this:??
textField4.add(new FocuOnLoadBehavior());
}
}
what happens now?
On Tue, Mar 11, 2008 at 3:12 PM, Johan Compagner <[EMAIL PROTECTED]>
wrote:
> 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:
> > > 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
> > FocuOnLoadBehavior())? If it's the same code that would be calling
> > either one, it's just a matter of *how* it's being set up. It's not a
> > matter of responsibility going to the correct place.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>