Skip to Content
avatar image
Former Member

SAPUI5 Property "Remember" not working on Dialog Fragment?

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Feb 21, 2017 at 05:47 PM

    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();
    },
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 22, 2017 at 04:03 PM

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