openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

sap.m.Table ListMode Delete for table cannot be used in drag and drop because selection of a row is not permitted

Open albertbolt1 opened this issue 1 year ago • 2 comments

OpenUI5 version: 1.123

Browser/version (+device/version): chrome latest

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

URL (minimal example if possible): https://openui5.hana.ondemand.com/entity/sap.m.Table/sample/sap.m.sample.TableDnD/code

User/password (if required and possible - do not post any confidential information here):

Steps to reproduce the problem:

  1. https://openui5.hana.ondemand.com/entity/sap.m.Table/sample/sap.m.sample.TableDnD/code
  2. Change the mode of tables to Delete
  3. Select the row in table and try to move it up and down
  4. It doesn't happen because rows cannot be selected during the delete mode

What is the expected result? Expected result is that there should be a way to select the rows in the delete mode so that we can move the rows in the delete mode

What happens instead? If we press the row then it wont get selected so I wont be able to move it up and down. There should be a way to trigger the press event in case we press the row when the table is in delete mode.

Any other information? (attach screenshot if possible)

https://experience.sap.com/fiori-design-web/responsive-table/

I went through this and its suggested that "Delete is a mode of the responsive table and therefore cannot be used together with single selection or multiselection." but what if we want to select the row in the table during delete mode and move it up and down.

albertbolt1 avatar May 07 '24 08:05 albertbolt1

I am a bit confused by the problem to be honest.

As I've understood correctly, you're trying use "Delete" in combination with Drag & Drop, right? When changing the mode of both tables to "Delete", you are still able to press on a row and drag it somewhere else, even though selection is not possible.

If you are solely referencing the buttons ("Move Up", etc.), that logic is completely custom. In this case there is a controller function moveUp and moveDown, which moves the items accordingly. That logic is not part of the Drag & Drop API.

One could overcome this issue, by also providing another button, which switches Delete mode to selection.

But in the end, that is up to the application itself.

Drag & Drop API works as expected (dragging and dropping works) in combination with Delete. And if you'd want to enable the sample coding with Delete mode, to allow for button usage as well, the custom logic would need a modification.

Or am I missing your point?

DonkeyCo avatar May 07 '24 15:05 DonkeyCo

@DonkeyCo Hi, You have understood it rightly, The problem is not with the drag and drop, like you said we can have a delete button which switches the delete mode but lets say I want to use "move up" and "move down" when the table is in Delete mode then its not possible because I wont be able to select a row to move it up and down.

Issue: The table is in delete mode and I want to select a row to move it up and down, during delete mode this is not possible, is there a way this can be achieved without switching the mode of the table from delete to single select master.

albertbolt1 avatar May 08 '24 08:05 albertbolt1

Hello @albertbolt1,

Thank you for sharing this finding. I've created an internal incident DINC0203716. The status of the issue will be updated here in GitHub.

Regards, Gergana

GerganaKremenska avatar Jul 08 '24 08:07 GerganaKremenska

Hi @albertbolt1,

as already mentioned by @DonkeyCo this 'Move up / down' is a custom implementation. Based on the API it is not possible to have multiple 'Modes' active at the same time.

This is how the ListBase / Table is actually designed.

What you could do is to add a separate column containing buttons with custom actions you need and leave the mode of the table to 'SingleSelectMaster'.

As there is either a real issue with D&D nor with the Table itself I'm closing this case.

Thank you best regards, Marco (SAPUI5 Development)

marco-chiaradonna avatar Jul 08 '24 15:07 marco-chiaradonna