Hi,
I'm stuck on a seemingly simple problem. All I'm trying to do is to get the data from a datasource (processDS) into a RecordList (procRecordList). This is my (simplified) code:
I can get the records inside the execute method, but after the method, the records are gone.
I think I'm missing something very basic here, but just can't seem to figure it out. Any help will be appreciated.
I'm using SmartGWT 2.2 with Firefox 6.5.
Thanks in advance.
I'm stuck on a seemingly simple problem. All I'm trying to do is to get the data from a datasource (processDS) into a RecordList (procRecordList). This is my (simplified) code:
Code:
// processDS is defined outside the method public void loadData() { final RecordList procRecordList = new RecordList(); processDS.fetchData(null, new DSCallback() { public void execute(DSResponse response, Object rawData, DSRequest request) { procRecordList.addList(response.getData()); SC.say(""+procRecordList.getLength()); // This prints the correct number of records, which are there in the datasource } }); SC.say(""+procRecordList.getLength()); // This prints zero }
I think I'm missing something very basic here, but just can't seem to figure it out. Any help will be appreciated.
I'm using SmartGWT 2.2 with Firefox 6.5.
Thanks in advance.
Comment