I am trying to populate a dataTable via a list. Essentially my app, submits a search parameter and I can access the search results like so:
resultsToRender = resultsBean.getResults();
And then I am creating my list like so:
setSearchItems(new ArrayList<SelectItem>());
for( Result result : resultsBean.getResults() )
{
String item= result.getEntity().get( "content.item-name" );
searchItems.add(new searchItems(item));
}
Whilst my data table seems to pick up the correct number of rows according to the search parameters I am not entirely sure how to setup my list so that I can displays the row specific data, at the moment every row in my dataTable simply displays the information of the last item in my list.
Cheers
That can happen when either the
entityproperty ofresultisstatic, or thatsearchItemsconstructor assigns theitemto a static property.Those properties should not be
static. Remove that modifier.