Hi, I am new to smartGWT and I plan on using smartGWTPower.
The problem I am experiencing is that a ListGrid I created for testing does not display the data of the SqlDataSource I provided for it.
In visual builder the datasource can retrieve the data and display it in a ListGrid.
I don’t get any errors on the server log.
In the Developer Console I can see the rpc request completed successfully. In the response -> raw I can see the data.
But the list grid does not display the data.
I am using GWT v2.2, SmartGWTEE v2.4 (Evaluation), chrome v11.0.686.1 dev
The onModuleLoad method of the module I am testing, the debug key is used to show the rpc call in the Dev Console.
onModuleLoad(){
HLayout hlayout = new HLayout();
final DataSource ds = DataSource.get("person");
ListGrid listGrid = new ListGrid();
listGrid.setDataSource(ds);
hlayout.addMember(listGrid);
hlayout.draw();
KeyIdentifier debugKey = new KeyIdentifier();
debugKey.setCtrlKey(true);
debugKey.setShiftKey(true);
debugKey.setKeyName("X");
Page.registerKey(debugKey, new KeyCallback() {
public void execute(String keyName) {
ds.fetchData();
}
});
}
You’re using a dev build of Chrome, and have probably encountered some sort of temporary regression in the browser, since there is no way for this process to fail without an error message unless the browser is broken.
Use a production release of the browser instead.
If I am not mistaken, using GWT requires you to use the dev build. At least to take advantage of the hot deployment.
So if I am to use a production release that would mean I have to compile and deploy the app to a server and that I will not be able to debug the program in java?
No, you are confused between Development Mode (works with most browser supported by GWT, including IE, Firefox, Safari and release versions of Chrome) and the “Dev Channel” of Chrome. There is no need to use a pre-release of Chrome while developing and you should not do so.
Oh, yes. You are correct. I will try running it on the production release
I tried it in IE v8.0.7600.16385 and same thing happened.
I tried it in FireFox v3.5.3 and same thing happened.
But here is the strange thing:
I then added the following to onModuleLoad:
...
DynamicForm df = new DynamicForm();
df.setDataSource(ds);
df.setOverflow(Overflow.AUTO);
ComboBoxItem cbi = new ComboBoxItem("person_id","Person");
cbi.setOptionDataSource(ds);
cbi.setValueField("person_id");
cbi.setDisplayField("name");
df.setFields(cbi);
hlayout.addMember(df);
...
I then tested it in chrome, FF and IE and in all the same result: the ListGrid does not display anything but the ComboBoxItem does display the data.
Any advice?
Your original code was going to trigger fetch via Shift-Control-X. Have you tried just adding a direct call to fetchData().
I added ds.fetch() at the end of the onModuleLoad method, but nothing. I attached a txt file. In it I pasted the server log from directly after the preCache completed.
Could there be anything else you might need?
UPDATE:
I noticed in the dev console that the first fetch rpc request (I assume it is the request that the ListGrid made) does not have a name in the Component column. Could this be any help? Or could this just be an initial load done by the DataSourceLoader?
server_log.txt (12 KB)
Shouldn’t be ds.fetchData() (read the docs for that method). Call fetchData() on the ListGrid to cause that component to load data.
Ah, beautiful! That got it working!
I guess if I had looked at the smartGWT showcase I would have picked up on that… Have yet to deploy the showcase on my container.
Thanks oh so very much for the help!