on 09-12-2018 2:38 PM
I'm implementing a FileUploader, displayed in a Dialog. Relevant Code:
function onAddExcelData() {
var that = this;
if (this.fixedDialog === undefined) {
this.fixedDialog = new sap.m.Dialog({
title: "Choose CSV File for Upload",
beginButton: new sap.m.Button({
text: "Upload",
press: function (oEvent) {
that.fixedDialog.close();
}
}),
content: [new sap.ui.unified.FileUploader("excelUploader")],
endButton: new sap.m.Button({
text: "Cancel",
press: function () {
that.fixedDialog.close();
}
})
})
this.getView().addDependent(this.fixedDialog);
this.fixedDialog.attachBeforeClose(this.setDataToJsonFromExcel, this);
}
this.fixedDialog.open();
}
}
Whenever I want to click the beginButton or endButton, the console shows the error
<code>UncaughtTypeError: I.fFunction.call isnot a function
I read about this issue and the suggested solution is always, to define a new variable before calling the press function. But even though I added that variable, I still get the error. Does anyone have further ideas?
Hi Sonja,
the problem in your code is that SAPUI5 cannot find the click handler (onAddExcelData) in your controller. I reproduced this issue in this jsfiddle: https://jsfiddle.net/zeLf961k
You can fix the issue by replacing the call to you handler with:
press: [ oController.onAddExcelData , oController],
As seen here https://jsfiddle.net/zeLf961k/2/
Regards,
Marius
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.