tags:

views:

103

answers:

2

I have a requirement to print my list in two columns along with pagination.

I am not able to figure out how will I get 2 records at a time from the list set in the datatable.

A: 

You can do this via the DataModel. See the question Multiple rows per record in JSF? This is the opposite of what you want, but the principle is the same.

Your model implementation could return a row level bean that exposes an object for each column.

McDowell
A: 

I am not sure if this works: Make a new String; Loop your content and add them to the string one by one.

E.g

ArrayList setA=new ArrayList();

ArrayList setB=new ArrayList();

//add stuff to both arraylist

String result="";

for (int i < setA.size(); i ++) {

result=setA.get(i)+"\t"+setB.get(i);

}

System.out.println(result);

hope i am answering your questions.

cheers!

Jason