You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by Bob Schellink <sa...@gmail.com> on 2010/09/21 04:52:18 UTC
`
Hi, Conor,
As I recall, HtmlForm uses fairly straight-forward rendering and doesn't cater for JavaScript
commands such as focus or validation.
Kind regards
Bob
PS: Starting with Click 2.3.0 Behaviors could be used to set focus to a field instead of having that
responsibility on the form.
PPS: Seems HTML5 brings focus to input fields: http://www.phpguru.org/html5-autofocus-jump.html
On 21/09/2010 11:56, C Jennings wrote:
> Hi -
> I was wondering if anone has had any success with getting setFocus(true) to work
> with a HtmlForm or CssForm?
>
> Using ContactDetailsPage.java as an example in the Click Examples project, if i
> set the focus on one of the fields to true as follows:
>
> fieldset.add(new TextField("firstName")).setFocus(true);
>
> it doesn't put the cursor in the First Name text box, when i start up the
> project and point to it on localhost. However, if I then change the form from
> CssForm to Form, it works fine!
>
> Thank you,
>
> Conor
>
>
>
>
Re: `
Posted by C Jennings <co...@yahoo.com>.
Bob -
Thank you for the clarification on this. I just wanted to be sure that I wasn't
missing something when I used the setFocus method withing a HtmlForm.
Regards
Conor
----- Original Message ----
From: Bob Schellink <sa...@gmail.com>
To: user@click.apache.org
Sent: Mon, September 20, 2010 10:52:18 PM
Subject: `
Hi, Conor,
As I recall, HtmlForm uses fairly straight-forward rendering and doesn't cater
for JavaScript
commands such as focus or validation.
Kind regards
Bob
PS: Starting with Click 2.3.0 Behaviors could be used to set focus to a field
instead of having that
responsibility on the form.
PPS: Seems HTML5 brings focus to input fields:
http://www.phpguru.org/html5-autofocus-jump.html
On 21/09/2010 11:56, C Jennings wrote:
> Hi -
> I was wondering if anone has had any success with getting setFocus(true) to
>work
>
> with a HtmlForm or CssForm?
>
> Using ContactDetailsPage.java as an example in the Click Examples project, if i
>
> set the focus on one of the fields to true as follows:
>
> fieldset.add(new TextField("firstName")).setFocus(true);
>
> it doesn't put the cursor in the First Name text box, when i start up the
> project and point to it on localhost. However, if I then change the form from
> CssForm to Form, it works fine!
>
> Thank you,
>
> Conor
>
>
>
>