on 12-23-2014 3:12 AM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.