Hi,
last night I tried smartgGWT 6.0p LGPL from 30.03. I have trouble with loading a timeline calendar. This worked really well in 5.0p and 5.1p. With 6.0p I have issues with loading the dataSource. After calling "calendar.draw()", I get the following error message:
If I remove the methods "calendar.setEndDate( endDateCalendar );" and "calendar.setStartDate( startDateCalendar );" an empty calendar will appear without any data.
Thanks
Andy
Method for drawing the calendar:
Datasource class
last night I tried smartgGWT 6.0p LGPL from 30.03. I have trouble with loading a timeline calendar. This worked really well in 5.0p and 5.1p. With 6.0p I have issues with loading the dataSource. After calling "calendar.draw()", I get the following error message:
Code:
[ERROR] [com.uds.webadmin.GBookingAdmin] - 16:46:03.408:TMR8:WARN:Log:TypeError: _19.endField.endDate is undefined Stack from error.stack: TimelineView.buildSnapGapList() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Calendar.js?isc_version=11.0p.js:315 TimelineView.refreshEvents() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Calendar.js?isc_version=11.0p.js:318 Calendar.refreshSelectedView() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Calendar.js?isc_version=11.0p.js:419 Calendar.dataChanged() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Calendar.js?isc_version=11.0p.js:419 anonymous() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js?isc_version=11.0p.js:59 thunk() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js?isc_version=11.0p.js:316 observation() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js?isc_version=11.0p.js:313 ResultSet._doneChangingData() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js?isc_version=11.0p.js:1923 ResultSet._handleNewData() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js?isc_version=11.0p.js:1880 isc.A.fetchRemoteDataReply() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js?isc_version=11.0p.js:1866 [c]Class.fireCallback() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js?isc_version=11.0p.js:282 [c]Class.fireCallback() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js?isc_version=11.0p.js:350 DataSource.fireResponseCallbacks() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js?isc_version=11.0p.js:728 DataSource._completeResponseProcessing() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js?isc_version=11.0p.js:725 DataSource._handleClientOnlyReply/_6() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js?isc_version=11.0p.js:586 DataSource._handleClientOnlyReply() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js?isc_version=11.0p.js:587 [c]Class.fireCallback() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js?isc_version=11.0p.js:282 [c]Class.fireCallback() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js?isc_version=11.0p.js:350 anonymous() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js?isc_version=11.0p.js:1673 $wnd.isc.RPCManager.fireReplyCallback() @ :311 [c]RPCManager.fireReplyCallbacks() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js?isc_version=11.0p.js:1678 [c]RPCManager.performOperationReply() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js?isc_version=11.0p.js:1671 RPCManager._performTransactionReply() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js?isc_version=11.0p.js:1656 [c]Class.fireCallback() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js?isc_version=11.0p.js:282 Timer._fireTimeout() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js?isc_version=11.0p.js:1409 Timer.setTimeout/_6<() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js?isc_version=11.0p.js:1406
Thanks
Andy
Method for drawing the calendar:
Code:
public class CalendarTest implements EntryPoint { Timeline calendar = null; public void onModuleLoad() { initCalendar(); } private void initCalendar() { calendar = new Timeline(); calendar.setShowEventDescriptions( true ); calendar.setShowQuickEventDialog( false ); calendar.setShowAddEventButton( false ); calendar.setCanCreateEvents( true ); calendar.setCanRemoveEvents( true ); calendar.setCanResizeEvents( false ); // Sets Hover calendar.setHoverWidth( 500 ); // Activate weekends calendar.setDisableWeekends( false ); calendar.setShowWeekends( true ); // 60min x 24h (Ignore Time) calendar.setEventSnapGap( 1440 ); calendar.setEventAutoArrange( true ); // Can not move via drag & drop to another lane calendar.setCanEditLane( false ); calendar.setCanReorderLanes( true ); calendar.setLaneEventPadding( 2 ); // Sets start and end date of calendar // Sets Calendar Start Date Date startDateCalendar = new Date(); CalendarUtil.addDaysToDate( startDateCalendar, -1 ); CalendarUtil.resetTime( startDateCalendar ); calendar.setStartDate( startDateCalendar ); // Sets Calendar End Date Date endDateCalendar = new Date(); CalendarUtil.addDaysToDate( endDateCalendar, 30 ); CalendarUtil.resetTime( endDateCalendar ); calendar.setEndDate( endDateCalendar ); // Sets lane field (first Columns) calendar.setLaneFields( new ListGridField[] { new ListGridField( "title", GWebAdmin.lang.name(), 350 ) } ); // Init Lanes calendar.setLanes( getLanes() ); // Sets the indicators calendar.setShowIndicators( false ); calendar.setIndicators( getIndicators() ); // Inits Calendar Header initHeaderLevels(); // Sets the calendar dataSource CAssignedShowPlaner dsClass = new CAssignedShowPlaner(); DataSource dataSource = dsClass.getDataSource( ); calendar.setDataSource( dataSource ); calendar.setAutoFetchData( true ); calendar.draw(); } // End of Method private void initHeaderLevels() { HeaderLevel headerDays = new HeaderLevel( TimeUnit.DAY ); headerDays.setHeaderWidth( columnWidth ); headerDays.setTitleFormatter( new HeaderLevelTitleCustomizer() { @Override public String getTitle( HeaderLevel headerLevel, Date startDate, Date endDate, String defaultValue, Calendar calendar ) { DateTimeFormat fmt = DateTimeFormat.getFormat( "EEE,dd.MMM" ); return fmt.format( startDate ); } } ); HeaderLevel[] headerLevels = new HeaderLevel[] { new HeaderLevel( TimeUnit.WEEK ), headerDays }; calendar.setHeaderLevels( headerLevels ); } } // End of Class
Code:
import com.google.gwt.core.client.GWT; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.fields.DataSourceDateTimeField; import com.smartgwt.client.data.fields.DataSourceSequenceField; import com.smartgwt.client.data.fields.DataSourceTextField; import com.smartgwt.client.types.DSDataFormat; public class CAssignedShowPlaner { static String eventId = "eventId"; static String name = "name"; static String startDate = "startDate"; static String endDate = "endDate"; static String lane = "lane"; static String description = "description"; public DataSource getDataSource( ) { DataSource ds = new DataSource(); ds.setDataURL( "rest/showPlaner/getAllShows" ); ds.setClientOnly( true ); ds.setID( "timeline" ); ds.setDataFormat( DSDataFormat.JSON ); DataSourceSequenceField eventIdField = new DataSourceSequenceField( eventId, GWebAdmin.lang.id() ); eventIdField.setPrimaryKey( true ); DataSourceDateTimeField startDateField = new DataSourceDateTimeField( startDate ); DataSourceDateTimeField endDateField = new DataSourceDateTimeField( endDate ); DataSourceTextField laneField = new DataSourceTextField( lane ); DataSourceTextField nameField = new DataSourceTextField( name ); DataSourceTextField descField = new DataSourceTextField( description ); ds.setFields( eventIdField, nameField, descField, laneField, startDateField, endDateField ); return ds; } }
Comment