Skip to Content

Set flag selected selectDialog before opening

Hi, all.

I am using selectDialog in fragment for selecting some values, but before the opening fragment , i need set some list elements as SELECTED.

How i can do it ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 31, 2017 at 09:49 AM

    How are you getting the values, is it through OData or any model or are you setting static values.

    In any case, on instantiating the selectDialog and setting it to a model, get the list elements, look for your desired element and use the method "setRememberSelections" to select that element. Now that whenever your dialog opens, the specific elements will be selected. For more reference, go through the "remember selections" property in the select dialog. You can use the foll. urls for your reference.

    Hope this helps,


    Add comment
    10|10000 characters needed characters exceeded

  • Nov 01, 2017 at 01:20 AM

    Hello, Arjun

    Thanks for help. But i can't understand your answer.

    I am getting values for SelectDialog from one Odata model, but for set selection flag I need to get data from second model and compare some data in first and second models.

    Now i am using code below before open dialog.

    var itms = sap.ui.getCore().byId("selU").getItems();

    for (var k = 0; k < itms.length; k++) {

    if somevalue === somevue2 {

    sap.ui.getCore().byId("selU").getItems()[k].mProperties.selected = true




    But mayby it is not good solution.

    Add comment
    10|10000 characters needed characters exceeded