You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sundar Narasimhan <su...@ascent.com> on 2003/05/22 15:14:37 UTC

pager tag question -- how do I reset pager.offset within an action?

I have had this sort of problem before but can't quite recall what I
did to resolve it :)

Basically the problem has to do with the fact that inside struts
actions one cannot modify some request.parameter .. I'd sorely like to
be able to do
   request.setParameter("pager.offset", new String("0"));
before forwarding to a jsp..

Unfortunately only request.setAttribute() exists, and that doesn't
seem to be able to override a parameter that has already been set.

How do people typically do this? (What happens now is that I do a
query, get say 300 items.. and I scroll forward say to the 8'th page
and then resubmit the query, and the pager tag is still stuck at the
8'th page even though the new result set has far fewer items. I'd like
the pager offset to go back to 0 upon a new query. I am passing
pager.offset as a hidden parameter because there are other operations
where I do want the page to remain where it is).

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org