I work with smartGwt 3.0 power version
I want to change the shema and the tableName in my Datasource (.ds.xml)
I try this way but it's not working:
And in my Java code :
schema and tableName are set I see in GWT log but how to get it in the XML datasource file ?
I have also see that : DynamicDSGenerator, DataSource.fromXML(), DataSource.addDynamicDSGenerator(). I have read the javadoc, and quick guide and other forum post but I don't know how to use it.
Is everywhere a sample or a other documentation?
Thanks,
I want to change the shema and the tableName in my Datasource (.ds.xml)
I try this way but it's not working:
Code:
<DataSource serverType="sql" dataSourceVersion="1" dbName="Test KUL" ID="DIM_TREEDATASOURCE" schema="{$schema}" tableName="{$tableName}" > <fields> <field name="PARENT_ID" type="text" length="140" primaryKey="true"/> <field name="CHILD_ID" type="text" length="140"/> <field name="CHILD_DESC" type="text" length="140"/> <!-- <field name="PARENT_MEMBER_ID" type="float"/> --> <!-- <field name="CHILD_MEMBER_ID" type="float"/> --> </fields> <generatedBy>SC_SNAPSHOT-2012-02-05_v8.2p/PowerEdition Deployment 2012-02-05</generatedBy> </DataSource>
Code:
DataSource ds = new TreeDs("BO","V_UM_CONN_BU","DIM_TREEDATASOURCE"); .... private class TreeDs extends DataSource { public TreeDs(String schema,String table,String id) { this.setAttribute("schema", schema, true); this.setAttribute("tableName", table, true); this.setID(id); GWT.log(getAttribute("schema")); GWT.log(getAttribute("tableName")); setTitleField("CHILD_DESC"); DataSourceTextField desc = new DataSourceTextField("CHILD_DESC", "Description", 128); //desc.setAttribute("tableName", table); DataSourceTextField pId = new DataSourceTextField("PARENT_ID", "Description", 128); //pId.setAttribute("tableName", table); pId.setPrimaryKey(true); DataSourceTextField cId = new DataSourceTextField("CHILD_ID", "Description", 128); //cId.setAttribute("tableName", table); //DataSourceTextField desc = new DataSourceTextField("CHILD_DESC", "Description", 128); setFields(desc,pId,cId); } }
I have also see that : DynamicDSGenerator, DataSource.fromXML(), DataSource.addDynamicDSGenerator(). I have read the javadoc, and quick guide and other forum post but I don't know how to use it.
Is everywhere a sample or a other documentation?
Thanks,
Comment