Display a Dynamic table with SJSC 2
Hi,
I'm new to SJSC 2 (but not new to Java) and I'm encountering a problem with my small application, here is what I do :
_ create a Web project
_ drag and drop a table component to the design
_ link the table component to a simple table from dataprovider (SQLServer) with only 2 columns : I then remove the columns because I want the table to bedisplayed dynamically.
_ in the Page1 (default main page), in the init() function, here is my code :
try{
ResultSetMetaData res;
res= getSessionBean1().getPersonRowSet().getMetaData();
int nbColumn = res.getColumnCount();
for (int i = 0; i < nbColumn; i++){
TableColumn tableColumn =new TableColumn();
StaticText staticText =new StaticText();
String textValue ="#{currentRow.value['" + res.getTableName(i+1) +"." + res.getColumnName(i+1) +"']}";
staticText.setValue((String) getValue(textValue));
tableColumn.getChildren().add(staticText);
tableRowGroup1.getChildren().add(tableColumn);
}
}catch (SQLException sqle){
log("Error setting columns: " + sqle.toString());
}
The result I get is a table (hopefully...) with all the rows, but these rows are empty and I don't see why... :(
If I retrieve the number of rows, it's ok, it's working, like the column names etc...but I'm not able to display the data...
Can someone please explain me what I'm doing wrong here ?
Thank you.

