You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by draegoon Z <dr...@hotmail.com> on 2005/02/02 23:17:35 UTC
named anchor and form
Hey guys, the archive text search ability is temporarily down, sorry.
I have a JSP page with an html:form that on the bottom has location fields,
i.e. state/city.
Now I have chosen to have the states prepopulated, however, when someone
selects a state, the form submits and a hidden field serves as a flag to
populate the cities for that state and return.
Problem is: when the page returns/refreshes I'm at the top, the user is
confused or has to scroll down.
I know I could probably accomplish this with javascipt, but wondering if
there is a struts solution.
Keep in mind that even if I have a named anchor lower in the page, the user
is scrolling down, so it doesn't get clicked. And I think, getInputMapping()
would the info anyways, but have yet to check for certain.
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: named anchor and form
Posted by draegoon Z <dr...@hotmail.com>.
Thanks, your solution is exactly what I needed.
>From: Wendy Smoak <ja...@wendysmoak.com>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: Struts Users Mailing List <us...@struts.apache.org>
>Subject: Re: named anchor and form
>Date: Wed, 02 Feb 2005 16:09:17 -0700
>
>From: "draegoon Z" <dr...@hotmail.com>
>
> > Hey guys, the archive text search ability is temporarily down, sorry.
>
>Both http://marc.theaimsgroup.com and http://www.mail-archive.com have this
>list archived.
>
> > Problem is: when the page returns/refreshes I'm at the top, the user is
> > confused or has to scroll down.
> > I know I could probably accomplish this with javascipt, but wondering if
> > there is a struts solution.
>
>I have a long page with options to hide/show different sections. Hiding or
>showing causes a round trip to the server, and I need to put the user back
>where they clicked. So... in the Action, I do:
> request.setAttribute( "anchor", "someString" );
>
>and then at the bottom of the JSP, so it won't get executed until the page
>has loaded all the way...
> <c:if test="${anchor ne null}">
> document.location = "#<c:out value="{$anchor}"/>";
> </c:if>
>
>HTH,
>--
>Wendy Smoak
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: named anchor and form
Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: "draegoon Z" <dr...@hotmail.com>
> Hey guys, the archive text search ability is temporarily down, sorry.
Both http://marc.theaimsgroup.com and http://www.mail-archive.com have this
list archived.
> Problem is: when the page returns/refreshes I'm at the top, the user is
> confused or has to scroll down.
> I know I could probably accomplish this with javascipt, but wondering if
> there is a struts solution.
I have a long page with options to hide/show different sections. Hiding or
showing causes a round trip to the server, and I need to put the user back
where they clicked. So... in the Action, I do:
request.setAttribute( "anchor", "someString" );
and then at the bottom of the JSP, so it won't get executed until the page
has loaded all the way...
<c:if test="${anchor ne null}">
document.location = "#<c:out value="{$anchor}"/>";
</c:if>
HTH,
--
Wendy Smoak
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org