-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I could use 1-D array to populate one grid using "ListModel strset = new SimpleListModel(data);" where data is the 1-D array.And in front end we can see only one column containging the value passed as data array.But can anybody tell me how to populate grid with multi-Dimentional array so that in the scrren I can see multiple columns?
I found this one. Works pretty well.
Just add more lines of "new Label" or use textboxes or whatever you want.
rowRenderer.java
(default package)
import org.zkoss.zul.RowRenderer; import org.zkoss.zul.Label; import org.zkoss.zul.Row; //define the RowRenderer class public class rowRenderer implements RowRenderer{ public void render(Row row, java.lang.Object data) throws Exception { String[] _data = (String[])data; new Label(_data[0]).setParent(row); new Label(_data[1]).setParent(row); } }
Asked: 2009-02-12 13:07:50 +0800
Seen: 169 times
Last updated: Feb 13 '09