• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

Same values in all rows of the displaytag table

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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);
a=getDocumentMetaData(item,formbean);
}
public Collection getDocumentMetaData(CMBItem item,FormBean formbean)
throws CMBException, Exception
{

String FormID = item.getAttrValue(0);
formbean.setFormID(FormID);
String MainDocument=item.getAttrValue(1);
formbean.setMainDocument(MainDocument);
String SubDocument=item.getAttrValue(2);
formbean.setSubDocument(SubDocument);
formbean.setAppNumber(item.getAttrValue(3));
formbean.setBranchCode(item.getAttrValue(4));
formbean.setAdvisor_NAME(item.getAttrValue(5));
formbean.setAdvisor_Code(item.getAttrValue(6));
formbeanCol.add(formbean);
}

return formbeanCol;
}
}

JSP


<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>

</display:table>
 
Greenhorn
Posts: 14
jQuery Eclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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?
 
What do you have to say for yourself? Hmmm? Anything? And you call yourself a tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic