Hello
I'm using display tags to display lists of data in multiple pages (jsp).
My problem is that after submitting the form, it's reloaded with page 1. But sometimes I'd like to reload another page (by exemple the current page where the submit was done).
Is there a way to specify the page to be shown when reloading the jsp?
-
Pagination with display tag (5 messages)
- Posted by: Fr??d??ric GROSSO
- Posted on: June 21 2005 06:41 EDT
Threaded Messages (5)
- mention clearly by Biswa Ranjan mishra on June 21 2005 10:40 EDT
- I try to explain by Fr??d??ric GROSSO on June 22 2005 02:44 EDT
- I'm displaying and getting data through a display tag in a jsp w by Biswa Ranjan mishra on June 22 2005 04:57 EDT
- I try to explain by Fr??d??ric GROSSO on June 22 2005 02:44 EDT
- Help on the smae issue by senthil kum on July 07 2006 15:32 EDT
- Similar Issue with display tag on second search by Rajesh Renke on January 04 2010 06:00 EST
-
mention clearly[ Go to top ]
- Posted by: Biswa Ranjan mishra
- Posted on: June 21 2005 10:40 EDT
- in response to Fr??d??ric GROSSO
i may help u -
I try to explain[ Go to top ]
- Posted by: Fr??d??ric GROSSO
- Posted on: June 22 2005 02:44 EDT
- in response to Biswa Ranjan mishra
I'm displaying and getting data through a display tag in a jsp with code like this:
<display:table name="sessionScope.documentMiseEnPageForm.listeArticles" id="article"
class="liste" requestURI="" pagesize="30" decorator="com.it.bdc.utils.struts.BoutonsDecorateur">
<nested:root name="article"><nested:nest property="contenu">
...
<display:column title="Pg">
<html:text property='<%="listeArticles["+(article_rowNum.intValue() - 1)+"].contenu.page"%>'
size="2" maxLength="2" styleClass="w2" onkeypress="pagine(event, this)"/><span style="display: none" index="<%=article_rowNum.intValue() - 1%>" />
</display:column>
...
</display:table>
As you can see, pagesize is set to "30", so if the number of articles is more important than 30, there will be more than one page, each page containing 30 articles.
As you can also see in this code, if the user press "enter" in a particular column, a javascript code
is launched. This code ends with a submit() of the form. When the form is reloaded after the submit, page 1
is displayed. But if the user press "enter" in page 22, I'd like to reload the form in page 22 and not page one.
I hope this is more clear -
I'm displaying and getting data through a display tag in a jsp w[ Go to top ]
- Posted by: Biswa Ranjan mishra
- Posted on: June 22 2005 04:57 EDT
- in response to Fr??d??ric GROSSO
Hi,
form your details, what i understand , there might be a problem in displayNext() method in Action Class, hope you are using struts... . just check where you are forwarding the request after the end of displayNext() method. i think you are forwarding to again to make a search or something like that, so if you press enter on any page it is again going to 1st page. which means it is doing a new DB call.
i will suggest, you better do one call to DB, while displaying the results in display tag and displaytag will take care to keep the results in session and you can iterate through different pages.
hope , it will solve your problem -
Help on the smae issue[ Go to top ]
- Posted by: senthil kum
- Posted on: July 07 2006 15:32 EDT
- in response to Fr??d??ric GROSSO
Hi - i am facing the same issue..based on the submit , a column value gets changed - which i why a new DB query is required.. Is there a way that the page no can be made to be rememberered while submitting requests? kg -
Similar Issue with display tag on second search[ Go to top ]
- Posted by: Rajesh Renke
- Posted on: January 04 2010 06:00 EST
- in response to senthil kum
After hitting Search button on displayed result I navigate using next/previous hyperlink of display tag table, I am able to navigate to respective pages but.. say, while I am on page number 3, I again click on Search button.. the result should is not RESETing and does not show first page of the result. Note: Following code I am executing in Action class before hitting DB.. HttpSession session = request.getSession(); ParamEncoder paramEncoder = new ParamEncoder(tableId); String pageParam = paramEncoder.encodeParameterName(TableTagParameters.PARAMETER_PAGE); String sortOrderParam = paramEncoder.encodeParameterName(TableTagParameters.PARAMETER_ORDER); String sortColParam = paramEncoder.encodeParameterName(TableTagParameters.PARAMETER_SORT); session.removeAttribute(pageParam); session.removeAttribute(sortOrderParam); session.removeAttribute(sortColParam); I take fresh results from DB only when I click on search button. for navigation I dont hit DB.. instead my Action class forwards it to same page. Plz help me in resolving the issue..