Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Error on Calendar when data retrieved is more than DataPageSize

    SmartClient Version: v9.1p_2014-07-02/LGPL Development Only (built 2014-07-02)

    FireFox 25.0.1 for Linux Mint

    stack trace logged in the Developer Console:
    Code:
    13:14:36.940:XRP1:WARN:Log:TypeError: _9[_1.startDateField] is undefined
    Stack from error.stack:
        DaySchedule.refreshEvents() @ gapp/timesheet/timesheet/sc/modules/ISC_Calendar.js:303
        Calendar.refreshSelectedView() @ gapp/timesheet/timesheet/sc/modules/ISC_Calendar.js:153
        Calendar.dataChanged() @ gapp/timesheet/timesheet/sc/modules/ISC_Calendar.js:153
        anonymous() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:51
        thunk() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:286
        observation() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:283
        ResultSet._doneChangingData() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:1807
        ResultSet._handleNewData() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:1770
        isc.A.fetchRemoteDataReply() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:1756
        [c]Class.fireCallback() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:259
        [c]Class.fireCallback() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:320
        DataSource.fireResponseCallbacks() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:702
        DataSource._completeResponseProcessing() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:699
        DataSource._completeHandleXMLReply() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:676
        [c]Class.fireCallback() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:259
        [c]Class.fireCallback() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:320
        DataSource._completeDSResponseFromXML() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:681
        [c]Class.fireCallback() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:259
        [c]Class.fireCallback() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:320
        DataSource.recordsFromXML() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:685
        DataSource.selectRecords() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:682
        DataSource.dsResponseFromXML() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:676
        DataSource._handleXMLReply() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:676
        [c]Class.fireCallback() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:259
        XMLTools._getXMLResponseReply() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:51
        [c]Class.fireCallback() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:259
        [c]Class.fireCallback() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:320
        anonymous() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:1575
        $wnd.isc.RPCManager.fireReplyCallback() @ :262
        [c]RPCManager.fireReplyCallbacks() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:1580
        [c]RPCManager.performOperationReply() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:1573
        RPCManager._performTransactionReply() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:1558
        [c]RPCManager.performTransactionReply() @ gapp/timesheet/timesheet/sc/modules/ISC_DataBinding.js:1484
        anonymous() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:50
        [c]Class.fireCallback() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:259
        [c]Comm.performXmlTransactionReply() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:1084
        anonymous() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:50
        [c]Class.fireCallback() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:259
        Comm._fireXMLCallback() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:1067
        Comm.sendXmlHttpRequest/_12() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:1072
        unnamed() @ 
    
    13:14:37.021:XRP1:WARN:Log:Uncaught JavaScript exception: TypeError: _9[_1.startDateField] is undefined in http://127.0.0.1:8080/~george/GappLib2/gapp/timesheet/timesheet/sc/modules/ISC_Calendar.js, line 303
    13:14:37.167:TMR3:WARN:Log:TypeError: b[_7] is undefined
    Stack from error.stack:
        isc.A.gridProps.eventsOverlap() @ gapp/timesheet/timesheet/sc/modules/ISC_Calendar.js:61
        isc.A.gridProps.getVisibleEvents() @ gapp/timesheet/timesheet/sc/modules/ISC_Calendar.js:117
        isc.A.gridProps.refreshVisibleEvents() @ gapp/timesheet/timesheet/sc/modules/ISC_Calendar.js:109
        unnamed() @ gapp/timesheet/timesheet/sc/modules/ISC_Calendar.js:53
        [c]Class.fireCallback() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:259
        Timer._fireTimeout() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:1113
        unnamed() @ gapp/timesheet/timesheet/sc/modules/ISC_Core.js:1109
        unnamed() @ 
    
    13:14:37.168:TMR3:WARN:Log:Uncaught JavaScript exception: TypeError: b[_7] is undefined in http://127.0.0.1:8080/~george/GappLib2/gapp/timesheet/timesheet/sc/modules/ISC_Calendar.js, line 61
    I made sure it's not a data issue.
    I've change the code with a higher default(75) DataPageSize which worked.

    If there's more info you need please let me know

    #2
    We're not able to reproduce this in testing from what you've said, but the stacktrace indicates an obvious issue.

    Can you show a simple test-case we can run that shows the issue? Just an onModuleLoad() that sets up your calendar's settings and uses a clientOnly dataSource for data will suffice.

    Comment


      #3
      Some additional information:
      Using a RestDataSource()
      setDataFormat(DSDataFormat.XML)

      Things I've tried:
      1. Replaced the Calender() with a ListGrid(), to make sure it's not a problem with the datasource. It worked fine.
      2. Create a small testcase with attached xml data file (timesheet.xml 104 records), which worked fine (except when I used result.setClientOnly(true))
      Code:
      	    RestDataSource result = new RestDataSource();
      	    result.setDataFormat(DSDataFormat.XML);
              //result.setClientOnly(true);
      	    OperationBinding fetch = new OperationBinding();  
              fetch.setOperationType(DSOperationType.FETCH);  
              fetch.setDataProtocol(DSProtocol.POSTMESSAGE);
              result.setOperationBindings(fetch);
              DataSourceIntegerField id = new DataSourceIntegerField("id", "Id");
              id.setPrimaryKey(true);
              DataSourceTextField name = new DataSourceTextField("name", "Name");
              DataSourceTextField description = new DataSourceTextField("description", "Description");
              DataSourceDateTimeField startDate = new DataSourceDateTimeField("startDate", "startDate");//NOTE field is case sensitive
              DataSourceDateTimeField endDate = new DataSourceDateTimeField("endDate", "endDate");//NOTE field is case sensitive
              DataSourceBooleanField canEdit = new DataSourceBooleanField("canEdit", "canEdit");//NOTE field is case sensitive
              DataSourceTextField eventWindowStyle = new DataSourceTextField("eventWindowStyle", "eventWindowStyle");//NOTE field is case sensitive
              DataSourceIntegerField userid = new DataSourceIntegerField("user_id", "User ID", 25);
              DataSourceIntegerField groupid = new DataSourceIntegerField("usergroup_id", "Group ID", 25);
              DataSourceIntegerField max_bookings = new DataSourceIntegerField("max_bookings", "Max Bookings", 25);
      	    result.setFields(id, name, description, startDate, endDate, canEdit, eventWindowStyle, userid, groupid, max_bookings);
      	    result.setFetchDataURL(GWT.getHostPageBaseURL()+"data/timesheet.xml");	
      	    
      	    Calendar calendar = new Calendar();
              calendar.setDataSource(result);
              calendar.setAutoFetchData(true);
              calendar.draw();
      So it would seem that the problem comes in when trying to retrieve the second set of DataPageSize data, from the server to update the current Calendar view.

      Please let me know if there's more info you need.
      Attached Files

      Comment


        #4
        We've lost track somewhat of what actual bug you're reporting here.

        It seems as though you're saying that your sample code works fine, unless you add setClientOnly(true), right?

        If that's the case, then yes, that's expected behavior - your code doesn't set testData or cacheData on the DataSource, and that's required for clientOnly dataSources.

        You could probably also use DataSource.getClientOnlyDataSource().

        Comment

        Working...
        X