cancel
Showing results for 
Search instead for 
Did you mean: 

DropdownBox occur error in chrome

Former Member
0 Kudos

Hi all,

I have a problem with ListBox control.

Now I have a DropdownBox, and set a list of listbox in it.When I zoom in the browser and click the dropdownbox, there is an error "Uncaught Error: "108.1818" is of type number, expected int for property "scrollTop" of Element sap.ui.commons.ListBox#__box0" .

Does anyone know how to solve this problem?

Accepted Solutions (1)

Accepted Solutions (1)

Qualiture
Active Contributor
0 Kudos

I have seen this behavior too, and it is clearly a bug.

However, it only appears when having a ListBox inside a DropdownBox. Using simple ListItems it works just fine. If you don't need the ListBox, you may try using normal ListItems

Former Member
0 Kudos

Do you mean simply using addItem function of DropdownBox?

Qualiture
Active Contributor
0 Kudos

Oh, please no, do not ever think of using the addItem() method if you can avoid it Always use data binding

What I meant was using ListItems directly in your DropdownBox:


<commons:DropdownBox items="{/items}">

    <core:ListItem text="{title}" />

</commons:DropdownBox>

and since I take it you are using JSViews, here's the Javascript equivalent:



var oListItem = new sap.ui.core.ListItem({

  text : "{title}"

});

var oDropdown = new sap.ui.commons.DropdownBox().bindItems("/items", oListItem);

return oDropdown;

On a sidenote, I can recommend using XMLViews instead of JSViews. Since you can't write any code in the view, it forces you to write your logic in the controller. It also looks a lot cleaner, and you will find you will write less lines of code as you can see from the two examples

Former Member
0 Kudos

Thanks for your help.

It's helpful for me, and I will try to use XML View.

Former Member
0 Kudos

Hi Robin,

I try this method but there is still error of listBox.

Qualiture
Active Contributor
0 Kudos

Hi Menchi,

As you work for SAP, I assume you know better, quicker ways than me to file a bug report for SAPUI5.

Alternatively, I can also recommend filing a bug report at Issues · SAP/openui5 · GitHub the open source version of SAPUI5.

Issues will be solved rather quickly for OpenUI5, and they tend to make it to SAPUI5 pretty soon as well

0 Kudos

Hi Mengchi,

UpGrade the SAPUI5 libraries, it will work

Answers (0)