Skip to Content
0

SAPUI5 Property "Remember" not working on Dialog Fragment?

Feb 21, 2017 at 01:19 PM

58

avatar image

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

1.png (5.7 kB)
2.png (22.0 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Srikanth KV Feb 21, 2017 at 05:47 PM
1

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();
},
Share
10 |10000 characters needed characters left characters exceeded
Ndricim Cobo Feb 22, 2017 at 04:03 PM
0

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();
}
Share
10 |10000 characters needed characters left characters exceeded