Skip to Content
0
Aug 30, 2016 at 01:04 PM

Unable to set UploadUrl of uploadcollection in code

384 Views

The setUploadUrl method does not work, when I used it I found that the url is still a default one i.e " ../../../upload", then I tried to build a model on the controller with a url and pass it to the uploadCollection in this way:

On the view I bound the uploadUrl property to the model:

uploadUrl="{/uploadURL/path}

On the controller I instatiated a model and set it to the uploadCollection, I have tried setting the model inside the onChange event of the uploadCollection and also outside it, even though the uploadCollection got the model the url still was the default one:

var oData = {

uploadURL: {

path: "my Server Url/my service/Applications('" +parameter1 + "','" + parameter2 + "')/App_Attachments"

}

};

var oModel1 = new JSONModel(oData);

var oUploadCollection = this.getView().byId("UploadCollection");

oUploadCollection.setModel(oModel1);