You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Joel Halbert <jo...@su3analytics.com> on 2011/05/21 11:53:43 UTC

page automatically scrolling to component on load

Hi,

We've got a upload file form using the Upload component:

	  <t:form>
	     <t:errors/>
	     <input t:type="upload" t:id="file" t:validate="required"/>
		 <input type="submit" value="Import"/>
	  </t:form>

This is all located towards the bottom of the page and I've noticed that
when the page first loads it scrolls down to this field, in all
browsers.

Could this be  because it's trying to render an error message, even
though there is none?

- Joel


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: page automatically scrolling to component on load

Posted by Joel Halbert <jo...@su3analytics.com>.
Worked a treat, thanks.

On Sat, 2011-05-21 at 09:13 -0400, Bryan Lewis wrote:
> Tapestry automatically puts the focus into the first field of the page
> unless you tell it not to.  Try adding the 'autofocus' attribute to the form
> declaration:
> 
>     <t:form  ...  autofocus="false">
> 
> 
> On Sat, May 21, 2011 at 5:53 AM, Joel Halbert <jo...@su3analytics.com> wrote:
> 
> > Hi,
> >
> > We've got a upload file form using the Upload component:
> >
> >          <t:form>
> >             <t:errors/>
> >             <input t:type="upload" t:id="file" t:validate="required"/>
> >                 <input type="submit" value="Import"/>
> >          </t:form>
> >
> > This is all located towards the bottom of the page and I've noticed that
> > when the page first loads it scrolls down to this field, in all
> > browsers.
> >
> > Could this be  because it's trying to render an error message, even
> > though there is none?
> >
> > - Joel
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: page automatically scrolling to component on load

Posted by Bryan Lewis <jb...@gmail.com>.
Tapestry automatically puts the focus into the first field of the page
unless you tell it not to.  Try adding the 'autofocus' attribute to the form
declaration:

    <t:form  ...  autofocus="false">


On Sat, May 21, 2011 at 5:53 AM, Joel Halbert <jo...@su3analytics.com> wrote:

> Hi,
>
> We've got a upload file form using the Upload component:
>
>          <t:form>
>             <t:errors/>
>             <input t:type="upload" t:id="file" t:validate="required"/>
>                 <input type="submit" value="Import"/>
>          </t:form>
>
> This is all located towards the bottom of the page and I've noticed that
> when the page first loads it scrolls down to this field, in all
> browsers.
>
> Could this be  because it's trying to render an error message, even
> though there is none?
>
> - Joel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>