on 02-01-2018 10:22 AM
Hi All,
I want to display PDF in sap.m.PDFViewer control, for which i want to set the header of the model:
this.oModel.setHeaders({ "Content-Disposition": "inline" });
I bind this model to my fragment where my PDFViewer control is present.
However, in the network calls, i dont see the "Content-Disposition" header getting passed.
Also, when I make a call from controller, i see the "Content-Disposition" header getting passed in the Request headers.
I have also tried adding the header in the manifest.json under data source but nothing helps.
Where am i going wrong?
var oFileUploadConsentFragment = sap.ui.xmlfragment("myfragment", this);
this.getView().addDependent(oFileUploadConsentFragment);
var sSrcPath = "myServiceURL" + "/Attachments('IdOfMyAttachment')/$value";
var oJsonData = {
"Attachment": sSrcPath
};
var oConsentManagementModel = new sap.ui.model.json.JSONModel(); oConsentManagementModel.setData(oJsonData);
this.oFileUploadConsentFragment.setModel(oConsentManagementModel, "oJsonModel");
this.getView().getModel().setHeaders({
"Content-Disposition": "inline"
});
this.oFileUploadConsentFragment.setModel(this.getView().getModel());
XML Fragment:
<PDFViewer source="{oJsonModel>/Attachment}"></PDFViewer>
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.