Announcement

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

    Calendar ignores fetch/update/addOperation

    SmartClient Version: v13.0p_2023-09-07/AllModules Development Only (built 2023-09-07)

    Hello, I just noticed that the Calendar ignores fetchOperation, updateOperation, addOperation and removeOperation.

    please try the test case here https://www-demos.smartclient.com/sm...&skin=Twilight

    Code:
    // using a client-only dataSource so that test data is always relative to the current date
    isc.DataSource.create({
        ID: "eventDS",
        fetchOperation: "foo",
        updateOperation: "bar",
        addOperation: "foobar",
        fields:[
            {name:"eventId", primaryKey: true, type: "sequence"},
            {name:"name"},
            {name:"description"},
            {name:"startDate", type: "datetime"},
            {name:"endDate", type: "datetime"}
        ],
        clientOnly: true,
        testData: eventData
    
    });
    
    isc.Calendar.create({
        ID: "eventCalendar",
        startDate: eventData.getDataStartDate(),
        dataSource: eventDS, autoFetchData: true
    });
    in the RPC tab you may see that the operationIds are never sent.

    #2
    hi Claudio,

    You're going to kick yourself :) fetchOperation et al are properties on DBC, not on DataSource...

    Comment


      #3
      oh dear, note to self: should never post in a hurry before exiting office :-)

      actually in my application I noticed the problem only on add/updateOperation, and it seems replicable in the showcase for add/update/removeOperation, please forgive me and try this revised test case:

      Code:
      isc.DataSource.create({
          ID: "eventDS",
          fields:[
              {name:"eventId", primaryKey: true, type: "sequence"},
              {name:"name"},
              {name:"description"},
              {name:"startDate", type: "datetime"},
              {name:"endDate", type: "datetime"}
          ],
          clientOnly: true,
          testData: eventData
      
      });
      
      isc.Calendar.create({
          ID: "eventCalendar",
          addOperation: "foo",
          updateOperation: "bar",
          removeOperation: "foobar",
          startDate: eventData.getDataStartDate(),
          dataSource: eventDS, autoFetchData: true
      });
      this is an update:

      Code:
      {
          dataSource:"eventDS",
          operationType:"update",
          componentId:"eventCalendar",
          data:{
              eventId:6,
              name:"Airport run test",
              description:"This canvas is styled by color settings on the CalendarEvent",
              startDate:"2021-05-26T23:00:00.000",
              endDate:"2021-05-27T01:00:00.000",
              headerTextColor:"white",
              headerBackgroundColor:"green",
              headerBorderColor:"green",
              textColor:"darkgreen",
              borderColor:"darkgreen",
              backgroundColor:"lightgreen"
          },
          textMatchStyle:"exact",
          willHandleError:true,
          showPrompt:true,
          oldValues:{
              eventId:6,
              name:"Airport run",
              description:"This canvas is styled by color settings on the CalendarEvent",
              startDate:"2021-05-26T23:00:00.000",
              endDate:"2021-05-27T01:00:00.000",
              headerTextColor:"white",
              headerBackgroundColor:"green",
              headerBorderColor:"green",
              textColor:"darkgreen",
              borderColor:"darkgreen",
              backgroundColor:"lightgreen",
              eventLength:7200000
          },
          requestId:"eventDS$6276",
          fallbackToEval:false,
          lastClientEventThreadCode:"MUP4",
          bypassCache:true,
          dataProtocol:"clientOnly",
          clientOnlyDataModified:true
      }

      Comment


        #4
        Great, thanks - we've fixed the non-fetch variants (Calendar makes direct calls to the DS methods but wasn't passing the opId in the requestProperties).

        The fix might just make it into today's build, but more likely you'll see it tomorrow.
        Last edited by Isomorphic; 9 Sep 2023, 06:13.

        Comment


          #5
          SmartClient Version: v13.0p_2023-09-14/Enterprise Deployment (built 2023-09-14)

          I can confirm it's working, thank you very much

          Comment

          Working...
          X