[sapui5] aggregation binding - Use Control Visible instead removeItem or destroyItem

Hi,

You may be working with binding items in table or list, we call it aggregation binding in common.
You may encounter some case where you need to hide some item in the list.
If it's the case, remember to look at my practice: User item's visibility instead of remove or destroy that item in the list.

Because remove or destroy will remove the item from the HTML document, but still leave the Id of the HTML object there. If you make some time to the table that changes the items, the table rebind and you will get id duplication error.

On the other hands, if you just hide the item by using the visible property of ListBaseItem, the control is still there (only hidden). Which leads to no id error.

---V---

Nhận xét

Bài đăng phổ biến từ blog này

Tại sao lại chụp ảnh theo bố cục 1/3 ?

[sapui5] Best Practice in sapui5 development

Implement Search field with case-INSENSITIVE by SAP UI5