cancel
Showing results for 
Search instead for 
Did you mean: 

SSCE - Dropdown box empty by default

jurgen_de_jong
Explorer
0 Kudos

I created a dashboard in the Self Service Composition Environment. In this dashboard I created a dropdown box which gets the data from a QueryTemplate.

   

Based on the selection in the dropdown box I refresh a Query template grid on the bottom of the dashboard.

So far so good.

However, at the initial load of the dashboard the default value of the drop down box is always the first value of the query. It would be better in this case to have a blank value, so no values are shown in the Query Template grid.

Is this possible?

Accepted Solutions (1)

Accepted Solutions (1)

swaroop_anasane
Active Contributor
0 Kudos

Hi Jurgen,

Yes, it's possible.

You need to edit source. Add a function like:

function loading(){

    var base = DropdownBox0_c0c0.getInternalUI5Object();

   var allItems = base.getItems();

   var newBlank = new sap.ui.core.ListItem({text:"Select DD", key:""});

    allItems.unshift(newBlank);

    $.each(allItems, function(i){

        base.addItem(allItems[i]);

    });

   base.setSelectedKey("");

    //alert(allItems);

    //alert(base.getItems());

}

and then provide this function name in Initialize: property under design tab. And there you go.

Result:

Thanks,

Swaroop

Former Member
0 Kudos

Tried this in 15.1 it doesn't work. This way works in 15.0

Regards,

Sriram

swaroop_anasane
Active Contributor
0 Kudos

Hi Sriram,

It's built on same platform I guess, may be with UI5 lib upgrades, some functions may not work same way.

You may try to look for alternative methods.

Thanks,

Swaroop

jurgen_de_jong
Explorer
0 Kudos

Hi Swaroop, Sriram,

I indeed tried this on 15.1, but unfortunately it didn't work.

Any idea how to get it working on 15.1?

Thanks,

Jurgen

swaroop_anasane
Active Contributor
0 Kudos

Hi Jurgen,

Unfortunately I don't have a 15.1 box with me right now.

What I can suggest is to put alerts between each line in above code and try previewing it. This way if you do not receive alert post say third alert, you would come to know which function is not supported.

Then check the recent API to try our similar functions with other name that may would.

Similar case in my code, bindItems() didn't work so i tried addItems() and it worked.

Let us know if any luck.

Best Regards,

Swaroop

Answers (0)