Skip to Content
author's profile photo Former Member
Former Member

RememberSelections in SelectDialog Control is not working

Hi Experts,

i am trying to implement table personalization by useing SelectDialog control , i had struck with rememberingSelections can you please check the code and help me

View:

var oButton2 = new sap.m.Button({

text : "Personalizse",

tooltip : "Personalizse_table",

icon : "sap-icon://personnel-view",

customData:[new sap.ui.core.CustomData({

key:"multi",

value:"true"

}),new sap.ui.core.CustomData({

key:"remember",

value:"true"

})],

press :function(oEvent){

var oDialog = new sap.m.SelectDialog({

// icon : "sap-icon://personnel-view",

title : "Personalizse_Table",

//multiSelect:true,

//rememberSelections:true,

//search:this.onSearch,

//cancel:this.onCancel,

confirm: oController.onConfirm

});

var oMetaData = oModel.getServiceMetadata();

var oEntityRef=oMetaData.dataServices.schema[0].entityType[0];

var oListProperties=oEntityRef.property;

var oLength= oListProperties.length;

for ( var i = 0; i < oLength; i++){

oDialog.addItem(new sap.m.InputListItem({

label : oListProperties[i].name,

}));

}

// var oMultiSelect= oEvent.getSource().data("multi");

oDialog.setMultiSelect(true);

// var oRememberSelections= oEvent.getSource().data("remember");

oDialog.setRememberSelections(true);

oDialog.open();

}

});

*******************************************************************************

controller:

onConfirm:function(oEvent){

oCount = oEvent.getParameters().selectedItems.length-1;

var oMetaData = oModel.getServiceMetadata();

var oEntityRef=oMetaData.dataServices.schema[0].entityType[0];

var oListProperties=oEntityRef.property;

var oLength= oListProperties.length;

for(i=0;i<=oCount;i++){

var oSelectedItems = oEvent.getParameters().selectedItems[i].mProperties.label;

for(a=0;a<oLength;a++){

var oColumnName = oListProperties[a].name;

if(oSelectedItems==oColumnName){

console.log(oSelectedItems+"Sucess");

}

//console.log(oColumnName);

}

//console.log(oSelectedItems);

}

},

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Dec 11, 2015 at 12:53 PM

    you have to tell us the problem

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.