Announcement

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

  • RestDatasource.transformResponse and componentId

    Hi,
    What I'm trying to achive is to send the search criteria in an encoded JSON string because PHP dosen't do well with the way SmartClient sends them ( fore more info see the this thread http://forums.smartclient.com/showthread.php?t=2184&highlight=transformRequest )

    Now, my question is about the componentId value which at some point is set to "(cacheAllData fetch)" ( Line 15980 in SC_SNAPSHOT-2012-02-11_v8.3d/LGPL Deployment build).
    What is this all about? :)

    Oh, and another question, is there a simple way to get the component that uses the datasource (without using eval) ?


    Code:
    transformRequest: function (dsRequest) { 
        var data = this.Super('transformRequest', arguments)
    
         if(dsRequest.operationType == "fetch" && dsRequest.componentId != "(cacheAllData fetch)") {
          var component = eval(dsRequest.componentId);
          data.pvCriteria = isc.JSON.encode(component.getCriteria());		
         }				
         return data;
    }
    Thanks in advance,
    John
Working...
X