PDA

View Full Version : how to get record data from store



armandoxxx
23 Mar 2009, 12:30 PM
HI

I need help of how to get my record from store



ModelType type = new ModelType();
type.root = "data";
type.recordName = "data";
type.addField("idCustomer");
type.addField("ppsIdSedeza");
type.addField("ppsSpremniText");
type.addField("ppsIdSIDDV");
type.addField("ppsSN");
type.addField("ppsImeNKlip");
type.addField("ppsSifOseba");

String url = GWT.getModuleBaseURL()+"ajax/customers/findCustomerSettings";
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);
HttpProxy<ListLoadConfig, ListLoadResult<ModelData>> proxy = new HttpProxy<ListLoadConfig, ListLoadResult<ModelData>>(builder);

JsonReader<ListLoadConfig> reader = new JsonReader<ListLoadConfig>(type);
BaseListLoader<ListLoadConfig, ListLoadResult<ModelData>> loader = new BaseListLoader<ListLoadConfig, ListLoadResult<ModelData>>(proxy, reader);

loader.addLoadListener(new LoadListener(){
public void handleEvent(LoadEvent le){
Dialog d = new Dialog();
d.setModal(true);
d.setHeading("Info");
d.addText(String.valueOf(le.data)+String.valueOf(le.config)); //I GET NULL HERE !!! ...
d.setBodyStyle("padding:13px;");
d.setSize(200, 100);
d.setHideOnButtonClick(true);
d.setButtons(Dialog.OK);
d.show();
}

});

//Store
ListStore<BaseModelData> listStore = new ListStore<BaseModelData>(loader);


can anybody please check it out and help me on the matter ?

kind regards

Armando

kolli
24 Mar 2009, 6:28 AM
you actually need to call loader.load() to get the data.

armandoxxx
26 Mar 2009, 5:27 AM
Yes I know that .. but when the data is loaded I have no clue of how to get it out ..

kind regards

Armando

kolli
26 Mar 2009, 5:39 AM
what are you using the store for.
for combobox and grid,
you need to mention the display Field and the data is displayed automatically..
And for you to just get the data.. try using store.getAt(i).get("isCustomer")