I have found the answer! I copy the contents of my method fillGrid
(Integer.valueOf
(node.getAttribute("id")).intValue(),grid.getStore())
and put it in the calling part of the code.
So the bottom line here is, I put the code below concerning the select
all
inside the onSuccess method of the Async.
//--->>
grid.getSelectionModel().selectAll();
grid.doLayout();
centerPanel.doLayout();
//<---
//===================================================
AsyncCallback callback = new AsyncCallback() {
public void onFailure(Throwable caught) {
System.out.println("Loading data failed");
}
public void onSuccess(Object result) {
Collection productList = (Collection) result;
Iterator productIter = productList .iterator();
RecordDef recordDef = new RecordDef(
new FieldDef[]{
new StringFieldDef("product"),
new StringFieldDef("designation"),
new StringFieldDef("groupname")
});
while
(productIter.hasNext())
{ Product
product=(Product) productIter.next();
Record record =
recordDef.createRecord(new Object[]
{ null,null,null });
//record setting
code here
store2.add(record);
} //while hasnext
grid.getSelectionModel
().selectAll();
grid.doLayout();
centerPanel.doLayout();
}
};//end Async
DatabaseServiceAsync service =
DatabaseService.Util.getInstance();
service.getProduct
(listid,callback);// send the query
store2.commitChanges();
//===================================================
--
You received this message because you are subscribed to the Google Groups
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/gwt-ext?hl=en.