openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

sap.m.Table event selectionChange is not called when method removeSelections is executed

Open endrx opened this issue 8 years ago • 3 comments

OpenUI5 version: 1.60.1

Browser/version (+device/version): Chrome

Any other tested browsers/devices(OK/FAIL): Firefox: FAIL

URL (minimal example if possible): https://jsbin.com/muzopuv/edit?html,output

Steps to reproduce the problem:

  1. Run sample with JS
  2. Select with check first row of table - alert appears (table selectionChange event)
  3. Press button "clear selection" (executes table method removeSelections) - alert do not appear

What is the expected result? alert appears in both cases: selectionChange is called when removeSelections is executed

What happens instead? alert do not appears when removeSelections is executed: selectionChange is not called

endrx avatar Nov 30 '18 09:11 endrx

Hello @endrx , Thank you for sharing this finding. I've created an internal incident 1870497632. The status of the issue will be updated here in GitHub. Regards,

GeorgiValkanov avatar Nov 30 '18 12:11 GeorgiValkanov

Isn't this in line with UI5s guideline for change events?

Very early in the development of UI5 we had to decide whether change events should be fired only for immediate user interaction (keyboard input, pointer events, ...) or also for changes applied via API calls (setValue, ...).

Both approaches are reasonable, but we decided for the first one.

There are a few exceptions from this (design bugs), but in general this is how change events in UI5 are meant to work.

codeworrior avatar Nov 30 '18 13:11 codeworrior

this is also similar with (most of the) DOM APIs; setting the value property of the HTMLInputElement does not fire the input event. The caller of the API should know what is changed.

aborjinik avatar Nov 30 '18 14:11 aborjinik