Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8150

How to get key from a listitem

$
0
0
//             // Create the ListBox                oSimpleListBox = new sap.ui.commons.ListBox({                allowMultiSelect: true,                id: "box1",                }).bindAggregation("items", "/jobs",                        new sap.ui.core.ListItem({                            text: "{job_desc}",                            key: "{job_number}"                        }));

 

                new sap.ui.commons.Button({                text: "Add",                    press: function() {                    var selectedItems = oSimpleListBox.getSelectedItems();                        alert(selectedItems);                        for (var i=0; i<selectedItems.length;i++) {                            var listItem = selectedItems[i];                            oSimpleListBox2.insertItem(listItem, 0);                        }                    }            }).placeAt("content"); 

I want to alert the key of "listItem" but i can't seem to, i just want to try and get the key(job_number) because I have a second listbox that updates with the ones i select from "box1" and is added correctly to the box which is bound to "/jobsp",but I can't get the second box's model to update with the new values it receives from the first box.

 

So wanted to try first getting the key.

 

Any ideas?

 

Thanks.


Viewing all articles
Browse latest Browse all 8150

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>