Hello,
I'm having some trouble with the ComboBox. My response from the server is valid and looks okay when going to the url with a browser. The ComboBox is stuck on 'Loading...' however.
This is the code of the view:
Code:
String url = "/SDIQueryServlet?ns=[%22NCBI Taxonomy%22]";
ScriptTagProxy<PagingLoadResult<ModelData>> proxy = new ScriptTagProxy<PagingLoadResult<ModelData>>(url);
ModelType type = new ModelType();
type.setRoot("terms");
type.addField("term", "term");
JsonPagingLoadResultReader<PagingLoadResult<ModelData>> reader = new JsonPagingLoadResultReader<PagingLoadResult<ModelData>>(type);
PagingLoader<PagingLoadResult<ModelData>> loader = new BasePagingLoader<PagingLoadResult<ModelData>>(proxy, reader);
loader.addListener(Loader.BeforeLoad, new Listener<LoadEvent>() {
public void handleEvent(LoadEvent be) {
be.<ModelData> getConfig().set("start", be.<ModelData> getConfig().get("offset"));
}
});
ListStore<ModelData> store = new ListStore<ModelData>(loader);
I query a servlet that lives on my own server and use that as a proxy to a remote server.
The response I get in my servlet is fine:
Code:
{"terms":[{"term":"content", "term2":"content2"}]}
Am I missing something here?
I tried adding a listener to the loader for the Loader.Load event, but that never triggers.
Any help would be most welcome!