You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Mike Kienenberger <mk...@gmail.com> on 2005/10/20 18:10:52 UTC
Re: Help! How to set focus on a form?
If you provide a patch, it'll be more likely to end up in t:form sooner :)
Your best bet is to send an email to jsr-252-comments@jcp.org if you'd
like to see it in a future version of JSF's h:form.
-Mike
On 10/20/05, CONNER, BRENDAN (SBCSI) <bc...@sbc.com> wrote:
> FYI: I checked into how Struts renders <html:form focus="fieldName"
> ...>, and it simply adds the following lines after the end of the form:
>
> <script language="JavaScript" type="text/javascript">
> <!--
>
> document.forms["viewName:formName"].elements["viewName:formName:fieldNam
> e"].focus();
> // -->
> </script>
>
> Is that something we can build into a <t:form> component? Does anyone
> know whether something like this will be in the next standard for
> <h:form>?
>
> I'll submit a JIRA suggested enhancement for this, since I believe it
> could be quite useful.
>
> - Brendan
>
> > -----Original Message-----
> > From: CONNER, BRENDAN (SBCSI)
> > Sent: Thursday, October 20, 2005 10:03 AM
> > To: 'MyFaces Discussion'
> > Subject: Help! How to set focus on a form?
> >
> > Under Struts, one could do the following: <html:form ....
> > focus="fieldName"> to specify which field within a form should receive
> > focus upon loading the form. How can I do this under JSF?
> >
> > - Brendan
>