im trying to allow a user to spec "n" the number of results per page from a query. In the List page I pass in the number from a query string and then try to populate the dbforms tag. all other items are work, but the maxrows does not.
I get the first page ok with "n" results. However when I click for the next page of results I get a blank page. This is the first call to a servlet/control page.
code as follows
StringBuffer sbmr = new StringBuffer("");
if (request.getParameter("strmr")!=null && !request.getParameter("strmr").equals(""))
sbmr.append(request.getParameter("strmr"));
That's right. whereClause - as part of the dbforms system - is only needed on first page. The information of the resultset is stored in the session context after the first page.
Not so maxRows. This is needed each time the page is rendered.
So put a hidden input field with name=strmr and value=sbmr.toString() on your page!
Henner
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
im trying to allow a user to spec "n" the number of results per page from a query. In the List page I pass in the number from a query string and then try to populate the dbforms tag. all other items are work, but the maxrows does not.
I get the first page ok with "n" results. However when I click for the next page of results I get a blank page. This is the first call to a servlet/control page.
code as follows
StringBuffer sbmr = new StringBuffer("");
if (request.getParameter("strmr")!=null && !request.getParameter("strmr").equals(""))
sbmr.append(request.getParameter("strmr"));
<db:dbform autoUpdate="false" followUp="/pol_list.jsp" maxRows="<%=sbmr.toString()%>" tableName="<%=sbTable.toString()%>" whereClause="<%=whereClause.toString()%>" >
any help much appreciated.
Is sbmr filled on the second page?
try a <p><%=sbmr.toString()%></p> on your page to see this!
Henner
No/
added <p><%=sbmr.toString()%></p> and sbmr is blank on the second page.
However whereClause is also blank on second page but the query still executes correctly.
Paul
That's right. whereClause - as part of the dbforms system - is only needed on first page. The information of the resultset is stored in the session context after the first page.
Not so maxRows. This is needed each time the page is rendered.
So put a hidden input field with name=strmr and value=sbmr.toString() on your page!
Henner
thanks Henner,
It is working as I want it now.
Thanks very much
Paul