I'm getting this error when I attempt to set a DataSource for a Timeline:
Here's the Java code:
And here's the DataSource descriptor:
Am I missing something basic, or..? I'm trying to follow this example, http://www.smartclient.com/smartgwt/showcase/#databound_calendar_category.
Code:
[ERROR] [builtinds] - 15:25:48.768:TMR7:WARN:Log:Error: ''this.getDataSource().getField(...).type' is null or not an object' in http://localhost.mydomain:8888/builtinds/sc/modules/ISC_Calendar.js at line 190 [o]DynamicForm.initWidget(undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef) Canvas.init(_1=>undef, _2=>undef, _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef, _11=>undef, _12=>undef, _13=>undef) [a]MathFunction.createAutoChild(_1=>"eventEditor", _2=>Obj, _3=>undef, _4=>undef) Calendar.createEditors() Calendar.initWidget(Obj{ID:isc_Timeline_0}, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef) ** recursed on Canvas.init
Code:
package com.smartgwt.sample.client; import java.util.Date; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.core.Function; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.types.Alignment; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.calendar.Timeline; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.layout.VLayout; public class DemoTimeLine implements EntryPoint { DataSource dsSchTasks; String dsIDSchTasks = "SCHTASKS"; @Override public void onModuleLoad() { loadTheDataSource(); } private void loadTheDataSource() { boolean forceReload = true; DataSource.load(dsIDSchTasks, new Function(){ @Override public void execute() { dsSchTasks = DataSource.getDataSource(dsIDSchTasks); makeGUI(); } }, forceReload); } protected void makeGUI() { VLayout vLayout = new VLayout(){ { setWidth100(); setHeight100(); setDefaultLayoutAlign(Alignment.CENTER); } }; vLayout.addMember(makeListGrid()); vLayout.addMember(makeTimeLine()); vLayout.draw(); } private Canvas makeTimeLine() { Timeline timeline = new Timeline(); timeline.setDataSource(dsSchTasks); // < < ERROR PROVOKED HERE try { timeline.setAutoFetchData(true); } catch (IllegalStateException e) { // TODO Auto-generated catch block e.printStackTrace(); } return timeline; } private ListGrid makeListGrid() { ListGrid listGrid = new ListGrid(); listGrid.setDataSource(dsSchTasks); // THIS WORKS FINE try { listGrid.setAutoFetchData(true); } catch (IllegalStateException e) { // TODO Auto-generated catch block e.printStackTrace(); } return listGrid; } }
Code:
<DataSource ID="SCHTASKS" serverType="sql" dataSourceVersion="1" dbName="myDbName" schema="mySchema" tableName="SCHTASKS"> <fields> <field name="EVENTID" type="sequence" primaryKey="true"> <columnCode>7fab64e36d240dd07aeed2bd5a84b695</columnCode> </field> <field name="LANE" type="text" length="8"> <columnCode>35544953757f37fade2c9be741f7a7ff</columnCode> </field> <field name="NAME" type="text" length="256"> <columnCode>b068931cc450442b63f5b3d276ea4297</columnCode> </field> <field name="DESCRIPTION" type="text" length="256"> <columnCode>67daf92c833c41c95db874e18fcb2786</columnCode> </field> <field name="TASK_COMMENT" type="text" length="256"> <columnCode>df80333b6bba47d3a30efe1f5476700d</columnCode> </field> <field name="STARTDATE" type="datetime"> <columnCode>4e30b6d6aa33492da947b4c6ab31c7ca</columnCode> </field> <field name="ENDDATE" type="datetime"> <columnCode>e0a186d8a0d8f936632fd1bf39991398</columnCode> </field> </fields> <operationBindings> <!-- For testing, limit the number of records retrieved --> <operationBinding operationType="fetch"> <selectClause>$defaultSelectClause</selectClause> <fromClause>$defaultFromClause</fromClause> <whereClause><![CDATA[STARTDATE = TO_DATE('13-OCT-14') ]]></whereClause> </operationBinding> </operationBindings> <allowAdvancedCriteria>true</allowAdvancedCriteria> <generatedBy>v9.1p_2014-10-10/PowerEdition Deployment 2014-10-10</generatedBy> <tableCode>70e615c4aab36e6660ff0264351591b1</tableCode> </DataSource>
Comment