cancel
Showing results for 
Search instead for 
Did you mean: 

More than one button does not work at the same time in my Fiori screen

shrgrl
Participant
0 Kudos

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?

Accepted Solutions (0)

Answers (4)

Answers (4)

shrgrl
Participant
0 Kudos

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();
},
former_member674455
Participant
0 Kudos

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);
shrgrl
Participant
0 Kudos


It shows error like this. What does it mean?

maheshpalavalli
Active Contributor
0 Kudos

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.