I've been getting odd exceptions from GWT dev mode indicating invalid JavaScript syntax only when I try to load certain of my DataSources (using the SmartGWT server-side framework and the DataSourceLoader servlet). I've traced the problem to the specific bug, and here's what's happening:
Our DataSource has an auto-derived schema and then a few field-specific overrides. This causes the DataSourceLoader servlet to generate a nested DataSource specification that looks like this (beginning only):
The SmartGWT.mobile implementation of DataSource supports loading multiple DataSources in one batch by the (undocumented and somewhat counterintuitive) means of calling "load" with a comma-separated list of DataSource IDs. It then takes the entire response body and, instead of directly executing it like SmartClient does, it tries to partially parse the configuration. However, the initial step in the parsing makes an invalid assumption:
As you can see in the DSL-generated response, this command splits the single DataSource into what SmartGWT.mobile thinks are multiple DataSources. DataSource then tries on line 1708 to evaluate the code fragment, which has unbalanced braces and blows up.
I'm not sure what the best way to attempt to resolve this issue is, but it's a blocker for development, and I haven't been able to think of a workaround yet.
Our DataSource has an auto-derived schema and then a few field-specific overrides. This causes the DataSourceLoader servlet to generate a nested DataSource specification that looks like this (beginning only):
Code:
if (window.isc == undefined || window.isc.DataSource == undefined){ alert("Can't load DataSources - SmartClient runtime not loaded");}isc.DataSource.create({ allowAdvancedCriteria:false, "fmt:bundle":{ basename:"ds" }, fmt:"urn:jsptld:http://java.sun.com/jsp/jstl/fmt.tld", [b]inheritsFrom:isc.DataSource.create[/b]({ allowAdvancedCriteria:true, dropExtraFields:true, ID:"ds_customer_inheritsFrom", generatedBy:"SNAPSHOT_v8.3d_2012-07-25/Pro Deployment 2012-07-25", fields:[ { name:"version", length:255, type:"integer", required:true, canEdit:true },
Code:
[b]DataSource.java:1676[/b] String[] configs = creationText.split("isc.DataSource.create");
I'm not sure what the best way to attempt to resolve this issue is, but it's a blocker for development, and I haven't been able to think of a workaround yet.
Comment