Hi,
A couple of weeks ago I started looking at displaytag for a new project. I
have been able to use it more or less successfully, and now that I am back
in the office and that I have a proper net access I hope I can finish it
off, and at the same time I give some feedback. I am using version 1.0beta2.
First let me say it is a very helpfull library, thanks to all the
developpers.
In the begining I tried making it work with tiles, but it was too difficult,
paging etc did not work (I did not tried using requestURI). So then I moved
to simpler pages, but still with struts.
Then everything worked very well. What I missed is more uptodate
documentation and best practices. The only major problem I have encountered
is with checkboxes. I needed to use checkboxes in a table, I found several
approaches in the list, but I did not see anything about what is the
recommended/most usual way to do it.
Finally I too the following approach (based on a post by Matt mentioning
that stuff like that <input type="checkbox" name="selected_<%=i%>"/> can be
included inside a column), so I have:
<display:table name="sessionScope.SS_LISTRUNS" id="run" class="mars"
export="true"
sort="list" defaultsort="13" pagesize="6">
<display:column>
<% Run em = ((Run)run); %>
<% int i = run_rowNum.intValue()-1; %>
<input type=hidden name=run_<%=i%> value="<%=em.getId()%>" />
<input type="checkbox" name="selected_<%=i%>"/>
</display:column>
<display:column property="month" title="Month" sortable="true"
maxLength="8"/>
<display:column property="status" sortable="true" title="Status"
headerClass="sortable" maxLength="4"/>
...
</display:table>
I have all this inside an struts form. The user selects the checkboxes he
wants, and submits. Then in my action I do the following:
for (int i = 0; true; i++) {
String run = request.getParameter("run_" + i);
String check = request.getParameter("selected_" + i);
if (run == null) {
//no more rows
break;
}
if (check != null) {
commitRun(request, run, conn);
}
}
I was testing with small number of items (so there is only one page), and
everything was ok. But suddenly, when the number of items make a second page
appear, something very strange happens, in my action all the
request.getParameter("run_" + i) return null!! If the list is small enough
that it holds in one page it works perfectly.
Any ideas?
TIA
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
displaytag-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user