Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help needed in generating table from java class

 
Kumar Gaurav
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
code in jsp page

<tr:table width="100%" id="internalTab" binding="#{forceMatchNewRequest.tableInternal}" >

line of codes in java class

private ArrayList<ArrayList> tableValueInternal;
private ArrayList<ArrayList> tableValueExternal;
private ArrayList<String> columnHeader;

tableValueInternal = new ArrayList<ArrayList> ();
tableValueExternal = new ArrayList<ArrayList> ();
columnHeader = new ArrayList<String> ();
columnHeader.add("RNLegder No.");
columnHeader.add("Security Description");
columnHeader.add("Trade Date");
columnHeader.add("Buy/Sell");
columnHeader.add("Ref Num");
columnHeader.add("Currency");
columnHeader.add("Quantity");
columnHeader.add("Trade Price");
columnHeader.add("Give In Charge");

//populating column data
ArrayList<String> columnData = new ArrayList<String> ();
columnData.add("M1ZBLU");
columnData.add("DEC 08 OSE NIKKEI 225");
columnData.add("23-Feb-2009");
columnData.add("B");
columnData.add("8KJH KNf0");
columnData.add("USD");
columnData.add("100");
columnData.add("12000");
columnData.add("0");

ArrayList<String> columnData1 = new ArrayList<String> ();
columnData1.add("A68523");
columnData1.add("NOV 08 HS INDEX");
columnData1.add("11-Mar-2009");
columnData1.add("S");
columnData1.add("8KJA Gjc");
columnData1.add("GBP");
columnData1.add("20");
columnData1.add("13876");
columnData1.add("-100");

tableValueInternal.add(columnData);
tableValueExternal.add(columnData1);

//Populating table(internal) itself
tableInternal = new CoreTable ();
CoreColumn column = null;
for (int i = 0; i < columnHeader.size(); i++) {

column = new CoreColumn ();
column.setParent(tableInternal);
column.setHeaderText(columnHeader.get(i));
for (int j = 0; j < tableValueInternal.size(); j++ ) {

column.setSeparateRows(true);
ArrayList<String> columnValue = tableValueInternal.get(j);
CoreOutputText text = new CoreOutputText();
text.setParent(column);
text.setValue(columnValue.get(i));
column.getChildren().add(text);
// column.setRendered(true);
}
tableInternal.getChildren().add(column);
}
//Populating table(external) itself
tableExternal = new CoreTable ();
CoreColumn column1 = null;
for (int i = 0; i < columnHeader.size(); i++) {

column1 = new CoreColumn ();
column1.setParent(tableExternal);
column1.setHeaderText(columnHeader.get(i));
for (int j = 0; j < tableValueExternal.size(); j++ ) {

column1.setSeparateRows(true);
ArrayList<String> columnValue = tableValueExternal.get(j);
CoreOutputText text = new CoreOutputText();
text.setParent(column1);
text.setValue(columnValue.get(i));
column1.getChildren().add(text);
// column1.setRendered(true);
}
tableExternal.getChildren().add(column1);
}

i am not able to view the table. well sometime while refreshing the page i m able to see column headers but not the data.
Any help would be highly helpful
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic