Bookmark Topic Watch Topic
  • New Topic

still problem with display taglib

 
kesava chaitanya
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Report post to moderator
hi pankaj,

i have written this example;please correct me in this example;

TAG.jsp

<%@ include file="init.jsp" %>

<%@ page import="java.util.*"%>

<%
request.setAttribute( "test", new Player(16) );



%>



<display:table name="test" export="true" sort="list" pagesize="5" id="table1">
<display:column property="name" title="NAME" group="1"/>
</display:table>

Player.java

package example;
import java.util.*;



public class Player extends ArrayList
{

public Player(int size)
{
for (int j = 0; j < size; j++)
{
add(new ReportableListObject(size));
}

Collections.sort(this);
}


}

ReportableListObject.java


package example;


import java.util.Random;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.apache.commons.lang.builder.CompareToBuilder;


/**
* A test class that has data that looks more like information that comes back in a report.
* @author epesh
* @version $Revision$ ($Author$)
*/
public class ReportableListObject extends Object implements Comparable
{


private static String[] players = {"Sachin1", "Sachin1", "Sachin1", "Sachin1","Sachin1", "Sachin1", "Sachin1", "Sachin1","Sachin1", "Sachin1", "Sachin1", "Sachin1","Sachin1", "Sachin1", "Sachin1", "Sachin1"};


private String name;



/**
* Constructor for ReportableListObject.
*/
public ReportableListObject(int size)
{
for(int i=0;i<size;i++)
{
this.name = players[i];
}
}



public String getName()
{

return this.name;
}


}

i have modified the example of displaytaglib.war
is it neccassary to write ReportableListObject;what it will do?

i want to print out the names with paging(16 records) and sorting;
cant we do it with one bean file?

bye
chaitanya
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not repeat the same question more than once. Continue any discussion here.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!