0

Live Data in Grid.

asked 2009-02-12 13:07:50 +0800

sanhaq gravatar image sanhaq
264 1 6

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?

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2009-02-12 13:31:04 +0800

ziccardi gravatar image ziccardi
321 7

You must provide your own RowRenderer

Regards,
Massimiliano

link publish delete flag offensive edit

answered 2009-02-12 16:03:15 +0800

james gravatar image james
255 2

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);
	}
}

link publish delete flag offensive edit

answered 2009-02-13 09:51:33 +0800

sanhaq gravatar image sanhaq
264 1 6

thank you.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-02-12 13:07:50 +0800

Seen: 169 times

Last updated: Feb 13 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More