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.92k stars 1.23k forks source link

sap.m.ColumnListItem custom Detail icon #4028

Open mathlizee opened 3 months ago

mathlizee commented 3 months ago

Hello!

It would be nice if the Detail icon of the sap.m.ColumnListItem control could be customizable rather than being hardcoded to use a pen icon.

My use case is that, for a certain amount of rows (not all) of a sap.m.Table, I would like to add an icon button at the end of the row that the user can press to display more information in a dialog about the chosen row. To achieve this behaviour, I can dynamically hide the Detail button for rows that do not have additional infos to show, but there's no easy way for me to set the Detail icon to an icon that better represent a "show more" action rather than a "edit" action.

I think this feature would had flexibility for other use cases of the Detail type of sap.m.ColumnListItem.

Thanks! Math

NHristov-sap commented 3 months ago

Hello @mathlizee ,

Your request is forwarded to the responsible team for evaluation.

Best Regards, Nikolay Hristov UI5 GitHub Dispatcher

aborjinik commented 3 months ago

Hello @mathlizee,

The type property of the ListItemBase comes with some semantics e.g. there are some custom accessibility descriptions like "is editable" and some keyboard interaction, e.g. Ctrl+E triggers detailPress event. So using the type="Edit" property of list items as a generic row action via different icon is semantically not correct. The good news is we are considering a new "row actions" concept for the m/Table and I believe this will also fit to your requirement better. However for simple row actions you can already today consider to have a column on the right with a button cell template and bind the icon/visible property of the button accordingly. The getSource() method of the press event of Button will give you the button instance that is pressed and the getParent() call of the button instance should give you the list item instance that you need. Would that help?

Best regards, Cahit

simlin commented 3 months ago

FIORITECHP1-23873

mathlizee commented 2 months ago

@aborjinik

Thanks for your response! I ended up using the press event of the ColumnListItem to open a dialog instead.

Math