cancel
Showing results for 
Search instead for 
Did you mean: 

Sap.m.tree - Events are not working

former_member193947
Participant
0 Kudos

Hello,

Events associated with sap.m.tree are not working. We are using 1.44.11 UI5 library and when we tried to associate event for 'selectionChange', the event is not fired on expanding node or selecting node text or collapsing node. Also, sap.ui.commons library got depreciated, where the events were working. Few more people raised such questions in forums, but never got resolved.

If anybody have implemented events for sap.m.tree control, please share the logic/code used.

It will be of great help, if you can point some working code through frameworks like jsbin or jsfiddle.

Should we go for extending the control with custom event handling ? Or use commons library control, which got depreciated ?

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

I would say the issue is that you did not implement the property mode on the sap.m.Tree. Since sap.m.ListMode.Node is the default, your events will not be fired. You should implement as follows if you want the entire row to be selectable (note: SingleSelect puts a selectable radio button on the control).

<Tree id="testedControls" items="{ path: '/controls'}" mode="SingleSelectMaster" selectionChange=".onTreePress"> <StandardTreeItem title="{name}" press=".onTreePress" /> </Tree>

archisman92
Participant
0 Kudos

"selectionChange" event will suffice here. The "Press" event is not triggered when the mode of the tree is "SingleSelectMaster".

SergioG_TX
Active Contributor
0 Kudos

what events are you referring to? the sap.m.Tree control is still working (as per the url below)

https://openui5.hana.ondemand.com/#/entity/sap.m.Tree

some events did get deprecated but not all of them

https://openui5.hana.ondemand.com/#/api/sap.m.Tree

are you looking for one specifically?