Announcement

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

    RestDataSource and DSPProtocol issue

    Hi I am using smartgwt 2.5 nightly build from 2011-03-05 and GWT 2.1.1
    I need from DataSource to send request in postxml format but with datasource:
    Code:
    public DateDS(String id) {
    	setID(id);
    	setDataProtocol(DSProtocol.POSTXML);
    	setDataURL("/Date.Service");
    	DataSourceIntegerField dsifDateId = new DataSourceIntegerField("idDaty", "Id");
    	dsifDateId.setPrimaryKey(true);
    	DataSourceDateTimeField dsdtfDate = new DataSourceDateTimeField("data", "Data");
    	setFields(dsifDateId, dsdtfDate);
    	}
    I get request in format:
    Code:
    data=2011-03-08T07%3A53%3A41&_operationType=add&_oldValues=%7B%7D&_componentId=isc_DynamicForm_0&_dataSource=DateDS&isc_metaDataPrefix=_&isc_dataFormat=xml
    To get request in xml format I have to add operationbindings to datasource even though I do not need to set anything for particular operation.
    after adding:
    Code:
    	OperationBinding fetchOB = new OperationBinding();
    	fetchOB.setOperationType(DSOperationType.FETCH);
    	OperationBinding addOB = new OperationBinding();
    	addOB.setOperationType(DSOperationType.ADD);
    	OperationBinding updateOB = new OperationBinding();
    	updateOB.setOperationType(DSOperationType.UPDATE);
    	setOperationBindings(addOB,fetchOB,updateOB);
    request goes with proper xml format.
    Can somebody from isomorphic explain whether it is issue or maybe it has purpose ?

    #2
    See the docs - there are default OperationBindings on the RestDataSource.

    Comment


      #3
      thanks for response, I missed that
      according to java doc:
      The default OperationBindings for a RestDataSource specify dataProtocol as "getParams" for the fetch operation, and "postParams" for update, add and remove operations.

      Comment

      Working...
      X