cancel
Showing results for 
Search instead for 
Did you mean: 

sap.m.List & getSelectedContexts() ??!

Former Member
0 Kudos

Hi,

I have list:

var list = new sap.m.List("actlistDlg",{

  mode: sap.m.ListMode.MultiSelect,

  includeItemInSelection: true,

  width:"280px",

  /*items: {

  path: "/ProductCollection",

  template: new sap.m.StandardListItem({

   title: "{NAME1}",

   description: "{NAME2}",

  })

  }

  */

  });

  var temp = new sap.m.StandardListItem("actlistDlgTemplate", {

  title: "{CHILD_TO_PARTNER/LASTNAME}",

  description: "{CHILD_TO_PARTNER/FIRSTNAME}",

  customData: [

  new sap.ui.core.CustomData({

  key: "path",

  value: "x"

  }),

  ],

  });

list.bindItems(/", temp);

After I opened a dialog, I want ot get the selected context from the lts.

I use list.getSelectedContexts(true)

I allways get an error, that the object list does not have such a method....

Is there any example, how I can get selected values from muli-list?

jens

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member220538
Active Participant
0 Kudos

Hi,

You have to use the method getSelectedItems().It returns array containing the selected list items.


var selected=[];

selected=list.getSelectedItems();

Regards,

Jeffin

brian_keenan
Contributor
0 Kudos

You will need to use the method below,  from the item then you can get the context

getSelectedItems