Can I use a DataSource but not bind to any xml file or DB?
I try to use the addData method of DataSource but cannot see any data.
What I have is below:
DataSource ds = new DataSource();
ds.setID("somestring");
DataSourceTextField pkField = new DataSourceTextField("primarykey");
pkField.setHidden(true);
pkField.setPrimaryKey(true);
DataSourceTextField countryCodeField = new DataSourceTextField("countryCode", "Code");
countryCodeField.setRequired(true);
ds.setFields(pkField, countryCodeField);
ds.setClientOnly(true);
ListGrid table = new ListGrid();
table.setDataSource(ds);
ListGridRecord record = new ListGridRecord();
record.setAttribute("primarykey", "123");
record.setAttribute("countryCode", "AAA");
ds.addData(record);
------------------
Then when I test this, I only see the table header, but no data at all.
Do I miss anything?
Thanks,
I try to use the addData method of DataSource but cannot see any data.
What I have is below:
DataSource ds = new DataSource();
ds.setID("somestring");
DataSourceTextField pkField = new DataSourceTextField("primarykey");
pkField.setHidden(true);
pkField.setPrimaryKey(true);
DataSourceTextField countryCodeField = new DataSourceTextField("countryCode", "Code");
countryCodeField.setRequired(true);
ds.setFields(pkField, countryCodeField);
ds.setClientOnly(true);
ListGrid table = new ListGrid();
table.setDataSource(ds);
ListGridRecord record = new ListGridRecord();
record.setAttribute("primarykey", "123");
record.setAttribute("countryCode", "AAA");
ds.addData(record);
------------------
Then when I test this, I only see the table header, but no data at all.
Do I miss anything?
Thanks,