SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.9k stars 1.23k forks source link

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

Closed albertbolt1 closed 12 hours ago

albertbolt1 commented 2 months ago

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.

DonkeyCo commented 2 months ago

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?

albertbolt1 commented 2 months ago

@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.

GerganaKremenska commented 19 hours ago

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

marco-chiaradonna commented 12 hours ago

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)