Hello,
I a beginner in smartgwt. My problem is that I can't find out how to get data from a datasource, unless it is inside a listgrid by setDataSource(DataSource);
setAutoFetchData(true);
I have a php file that return data at json format, and it is working fine
Here is my code
I don't want to display this data in any widget. It is the application flow control. How do I can take the data from the DataSource and put the field values into java object or primitive variables (int, string etc)
I tried with ResultSet using
ResultSet res = new ResultSet(sData);
Record rec=res.first();
Can someone help me to figure out how to do it?
thanks
I a beginner in smartgwt. My problem is that I can't find out how to get data from a datasource, unless it is inside a listgrid by setDataSource(DataSource);
setAutoFetchData(true);
I have a php file that return data at json format, and it is working fine
Here is my code
Code:
DataSource sData = new DataSource();
sData.setDataFormat(DSDataFormat.JSON);
sData.setDataURL("http://127.0.0.1:8888/smartgwt/get?service=03");
DataSourceIntegerField id_field = new DataSourceIntegerField("id");
DataSourceFloatField min_field = new DataSourceFloatField("min_lim");
DataSourceFloatField max_field = new DataSourceFloatField("max_lim");
DataSourceTextField type_name_field = new DataSourceTextField("type_name");
DataSourceTextField unit_field = new DataSourceTextField("unit");
sData.setFields(id_field,min_field,max_field,type_name_field,unit_field);
sData.fetchData();
I tried with ResultSet using
ResultSet res = new ResultSet(sData);
Record rec=res.first();
Can someone help me to figure out how to do it?
thanks
Comment