This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Same values in all rows of the displaytag table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Same values in all rows of the displaytag table" Watch "Same values in all rows of the displaytag table" New topic

Same values in all rows of the displaytag table

Happy S Singh
Ranch Hand

Joined: Nov 14, 2011
Posts: 52
I get all rows in displaytag table same values i.e. It displays same values for all rows (i.e. last row values)

Below is the Action class snippet where I set the values in formbean

for (int i = 0; i < searchCount; i++) //counts the number of documents
item = srchResults.getItem(i);
public Collection getDocumentMetaData(CMBItem item,FormBean formbean)
throws CMBException, Exception

String FormID = item.getAttrValue(0);
String MainDocument=item.getAttrValue(1);
String SubDocument=item.getAttrValue(2);

return formbeanCol;


<display:table name="formbeanCol" export="false" pagesize="20" sort="list" id="data" requestURI="" class="tablelist">

<display:column title="advisor_Code" sortable="true" property="advisor_Code"></display:column>
<display:column title="formID" sortable="true" property="formID"></display:column>
<display:column title="mainDocument" sortable="true" property="mainDocument"></display:column>
<display:column title="SubDocument" sortable="true" property="subDocument"></display:column>
<display:column title="AppNumber" sortable="true" property="appNumber"></display:column>
<display:column title="branchCode" sortable="true" property="branchCode"></display:column>
<display:column title="advisor_NAME" sortable="true" property="advisor_NAME"></display:column>

Michal Plutynski

Joined: Mar 01, 2012
Posts: 14

can you please format your code well, because it has wrong brace brackets.

And the main question is how and where do you creates your 'formbean'? Maybe you use only one instance of this object in all rows?
I agree. Here's the link:
subject: Same values in all rows of the displaytag table
Similar Threads
how to get values from display table tag list?
Using Displaytag, Checkboxes and Struts to get values - I'm a bit lost
error onclick of radio button inside display tag
[DisplayTag] How to make Multi-column header
how to add link to display:table to a method in the DispatchAction class