Listbox/Grid Memory limitation/bug?
5 Mar 2008 19:52:59 GMT
26 Mar 2008 15:04:46 GMT
26 Mar 2008 15:04:46 GMT
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4865078
By: perry_rhodan
This is no longer an issue in ZK 3.0.4
ZK - Open Source Ajax Java Framework
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4818693
By: perry_rhodan
I have run into a problem trying to display data in the Listbox or a Grid. The idea is that I have a Tabbox with two panels the first panel is the search criteria and the second panel is the result panel. For the test, the search criteria returns a list of 269 objects that I display portions of the data on the result tab. On the result tab I started with a Listbox but also tried a Grid to display
3 columns of data.
The data for first column is ~16 characters, the second column is ~6 characters, and the third column is about ~96 characters. Through a series of print statements I was able to determine that I never come back out of the "setModel" on the grid or list. The setModel stops processing right after about 50 entries. however, if I comment out the third column, the one where I insert a label that is 96 characters in length for each row, the function completes normally! So I know that I have the general idea down of using "live data" returned from a database.
I am just running into some other issue - a memory issue? a bug? something else?
Is this a known limitation or should I be able to perform the above? Thanks.
Here is the statement I never come back from attempting to display 3 columns of data:
System.out.println("Before set model");
mResultGrid.setModel(myModel);
System.out.println("After set model");
Here is the panel excerpt for reference:
private final void createResultPanel()
{
Tabpanel resultPanel = new Tabpanel();
resultPanel.setParent(tabPanels);
Label blank = new Label(" ");
blank.setParent(resultPanel);
mResultGrid = new Grid();
mResultGrid.setMold("paging");
mResultGrid.setPageSize(50);
mResultGrid.setParent(resultPanel);
try
{
mResultGrid.setRowRenderer("GridRowRenderer");
}
catch(Exception e)
{
e.printStackTrace();
}
Columns myheaders = new Columns();
myheaders.setSizable(false);
myheaders.setParent(mResultGrid);
Column theHeader = new Column("Arrival Timestamp");
theHeader.setParent(myheaders);
theHeader = new Column("Object Id");
theHeader.setParent(myheaders);
theHeader = new Column("Payload");
theHeader.setParent(myheaders);
}
Here is the row renderer class where I have commented out the third column to see that it works:
public class GridRowRenderer implements RowRenderer {
SimpleDateFormat mDateTimeFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm");
public void render(Row row, java.lang.Object data)
{
AaicasEcmm ecmmData = (AaicasEcmm)data;
System.out.println("Object ID:" + ecmmData.getObjectId() + "; seq number:"
+ ecmmData.getSeqNumber());
Label myCell;
long theTime = ecmmData.getArrivalTimestamp();
if(theTime >0)
{
Date arrivalTime = new Date(ecmmData.getArrivalTimestamp());
myCell = new Label(mDateTimeFormat.format(arrivalTime));
myCell.setValue(mDateTimeFormat.format(arrivalTime));
myCell.setParent(row);
}
String tempString;
tempString = ecmmData.getObjectId();
if(tempString==null)
tempString = "No Valid ID";
myCell = new Label(tempString);
myCell.setValue(tempString);
myCell.setParent(row);
/*
tempString = ecmmData.getData();
if(tempString==null)
tempString = "No Payload:" + ecmmData.getSeqNumber();
myCell = new Label(tempString);
myCell.setValue(tempString);
myCell.setParent(row);
*/
row.setValue(data);
}
}