openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

sap.m.tree - getSelectedItems() do not return unfolded selected items

Open Munatas opened this issue 7 years ago • 4 comments

OpenUI5 version: 1.64

Browser/version (+device/version): Chrome

Steps to reproduce the problem:

  1. In a Tree, select a child node then fold and select a parent node.

image

What is the expected result? "getSelectedItems()" method returns 2 items.

What happens instead? "getSelectedItems()" method returns only 1 item. image

Any other information? ( If we unfold, the "getSelectedItems()" returns 2 items. image

Munatas avatar May 29 '19 10:05 Munatas

Hi, I will ask the responsible team/colleagues to get back to you on this.

Thanks

Pavan-SAP avatar Jun 07 '19 07:06 Pavan-SAP

hello @Munatas,

thanks for your report. The getSelectedItems() currently only returns the visible items.

The Tree control is based on the treebinding, which currently only support the visible items count.

If there is any updated plan for this control, we will come back to you.

Best, Wenqian

awui avatar Jun 07 '19 08:06 awui

I've created an internal incident 2380070422. The status of the issue will be updated here in GitHub.

flovogt avatar Jun 15 '23 16:06 flovogt

Hi, the answer was given already above. The selection APIs of the Tree only consider the visible items as of now - the indices but also the item instances. Both ways are not ideal to express selections of items which are currently not available. I think for such a purpose a complete new selection API (e.g. key based) would be necessary. The Tree control is currently not in scope of our internal plans or roadmap. So I do not expect enhancements here in the upcoming future. Therefore I close this requirement for now.

simlin avatar Mar 13 '24 12:03 simlin