on 11-10-2020 7:24 PM
Hi everyone. I'm designing a screen in Fiori. There will be different buttons on the screen. More than one button does not work in the same runtime. For example;
When I click this button, a dialog opens.
Here I save datas and exit.
Then when I click on the first screen different button it doesn't work. I need to refresh to page it work.
Dialog screens are each like this:
_getlisanEkleDialog: function () {
if (!this._oLisanEkleDialog) {
this._oLisanEkleDialog = sap.ui.xmlfragment("projeler.ozgecmisUygulamasi.fragment.lisanEkle", this);
this.getView().addDependent(this._oLisanEkleDialog);
jQuery.sap.syncStyleClass("sapUiSizeCompact", this.getView(), this._oLisanEkleDialog);
}
return this._oLisanEkleDialog;
},<br>
I checked the nomenclatures, couldn't find any mistakes. What is my problem?
janschulz I tried but I still get the same error.
"Error: Error: adding element with duplicate id 'container-ozgecmisUygulamasi---worklist--dialogEmployeeInstead'"
_getlisanDialog: function () {
if (!this._oLisanDialog) {
this._oLisanDialog = sap.ui.xmlfragment(this.getView().getId(), "projeler.ozgecmisUygulamasi.fragment.lisan", this); ///////HERE
this.getView().addDependent(this._oLisanDialog);
jQuery.sap.syncStyleClass("sapUiSizeCompact", this.getView(), this._oLisanDialog);
}
return this._oLisanDialog;
},
onLisan: function () {
this._getlisanDialog().open();
},
///////////////////////////////////////////////////////////////////
getlisanEkleDialog: function () {
if (!this._oLisanEkleDialog) {
this._oLisanEkleDialog = sap.ui.xmlfragment(this.getView().getId(), "projeler.ozgecmisUygulamasi.fragment.lisanEkle", this); ///////HERE
this.getView().addDependent(this._oLisanEkleDialog);
jQuery.sap.syncStyleClass("sapUiSizeCompact", this.getView(), this._oLisanEkleDialog);
}
return this._oLisanEkleDialog;
},
onLisanEkle: function () {
this._getlisanEkleDialog().open();
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That means that your dialog already got created. After that you try to create it again, which leads to an duplicate. See here
Your problem might be that you create your fragment without the views id prefix, try this:
sap.ui.xmlfragment(this.getView().getId(), "projeler.ozgecmisUygulamasi.fragment.lisanEkle", this);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Click f12 in your browser (Chrome) check console and see if any errors are there and post that screenshot or error for understanding your issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.