cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Property "Remember" not working on Dialog Fragment?

0 Kudos

Hi all,

I have an xml view with some multiComboBoxes, every one of each related with a value help dialog. My issue is when i open a second dialog and reopen the first, the first dialog doesn't remember my choises. It remember the choises only when I open the same dialog without opening others. The dialog is not being destroyed when i open another but it only lose the remember property.

Here is a piece of my code:



	if (! this[oDialog[num_dia]]) {
		console.log("aperto: "+[oDialog[num_dia]])
		this[oDialog[num_dia]] = sap.ui.xmlfragment("sap.ui.core.sample.index.test_catt_abap_crus.tile_regole.regole_planning.controller."+dialog, this);
		this[oDialog[num_dia]].setRememberSelections(true);
		this[oDialog[num_dia]].setMultiSele
	}
	
	console.log("dentro: "+[oDialog[n
	this.getView().addDependent(this[oDialog[nu
	jQuery.sap.syncStyleClass("sapUiSizeCompact", this.getView(), this[oDialog[num_dia]]);
	this[oDialog[num_dia]].open();
},

Has anyone ecountered this issue?

Thanks in advance.

1.png2.png

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member365727
Active Contributor

Can you move the addDependent line to inside if condition. Guessing that lifecycle of fragment is reset when adding dependent again.

	if (! this[oDialog[num_dia]]) {
		console.log("aperto: "+[oDialog[num_dia]])
		this[oDialog[num_dia]] = sap.ui.xmlfragment("sap.ui.core.sample.index.test_catt_abap_crus.tile_regole.regole_planning.controller."+dialog, this);
		this[oDialog[num_dia]].setRememberSelections(true);
		this[oDialog[num_dia]].setMultiSele
                this.getView().addDependent(this[oDialog[nu        //--->>new line
	}
	
	console.log("dentro: "+[oDialog[n
	
	jQuery.sap.syncStyleClass("sapUiSizeCompact", this.getView(), this[oDialog[num_dia]]);
	this[oDialog[num_dia]].open();
},
0 Kudos

Hi KV,

i tried with your suggestion but the issue persist. The dialog doesn't remember the selections if i open another dialog.

the modified code:

if (!this[oDialog[num_dia]]) {
    console.log("aperto:" + [oDialog[num_dia]])
    this[oDialog[num_dia]] = sap.ui.xmlfragment("sap.ui.core.sample.index.test_catt_abap_crus.tile_regole.regole_planning.controller." + dialog, this);
    this[oDialog[num_dia]].setRememberSelections(true);
    this[oDialog[num_dia]].setMultiSelect(true);
    this.getView().addDependent(this[oDialog[num_dia]]);


}


jQuery.sap.syncStyleClass("sapUiSizeCompact", this.getView(), this[oDialog[num_dia]]);
this[oDialog[num_dia]].open();
}