2025 Nov 06 1:32 PM - edited 2025 Nov 06 1:34 PM
Dear Community,
I have created a Fiori Elements application using the List Report template. After generating the app, I added the required configuration in the manifest.json to enable multi-row selection. However, the row-selection column still does not appear, and multi-selection is not working.
Regards,
Karthik
Request clarification before answering.
After adding an action to the behavior definition, you need to add annotations for adding the action button on the table toolbar. Please see the sample below:
@UI.lineItem: [
{
type:#FOR_ACTION,
label: 'Change Criticality (#ActionInLineItem)',
dataAction: 'changeCriticality',
position: 10
}
]
LastChangedAt;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, @MioYasutake!
1)Could you please share how to add multiple buttons? I tried adding several, but only the last action in the list is being displayed.
2)If I understood correctly, we need to define the buttons as you mentioned and set the selection mode to ‘multi’ in the controller extension to enable multiple selection, as also suggested by @junwu, is that right?
I’m asking again because, at one point, multi-selection worked even without adding anything in the controller extension, but it suddenly stopped working. So I’m trying to understand what might be causing this inconsistent behavior.
1) You can add as many actions as you want, like the example below:
@UI.lineItem: [
{
type:#FOR_ACTION,
label: 'Change Criticality (#ActionInLineItem)',
dataAction: 'changeCriticality',
position: 10
},
{
type:#FOR_ACTION,
label: 'Second Action',
dataAction: 'secondAction',
position: 20
}
]
LastChangedAt;2) You can enable multi-selection in the manifest.json file as shown below (no need for a controller extension):
"SalesOrderManageList":{
"type":"Component",
"id":"SalesOrderManageList",
"name":"sap.fe.templates.ListReport",
"options":{
"settings":{
"contextPath":"/SalesOrderManage",
"controlConfiguration":{
"@com.sap.vocabularies.UI.v1.LineItem":{
"tableSettings":{
"type":"ResponsiveTable",
"selectionMode":"Multi"
}
}
}
}
}
}https://sapui5.hana.ondemand.com/#/topic/116b5d82e8c545e2a56e1b51b8b0a9bd
Thank you, @MioYasutake! Do you see any issue in the below Behavior definition and annotations in the consumption view ? as I get to see only last action 'One Click Action' on the UI. Also, the actions are not appearing in the metadata and despite re-publishing the service binding several times, it still does not work.
Annotations in Consumption view:
define view entity Z_C_BP_CONTACTS
as select from Z_I_BP_CONTACTS
{
@UI.lineItem: [
{ position: 10, importance: #HIGH },
{ type: #FOR_ACTION, position: 10, dataAction: 'action_x', label: 'Action X' },
{ type: #FOR_ACTION, position: 20, dataAction: 'print_y', label: 'Print Y' },
{ type: #FOR_ACTION, position: 30, dataAction: 'print_z', label: 'Z' },
{ type: #FOR_ACTION, position: 40, dataAction: 'send_payment', label: 'Send Payment' },
{ type: #FOR_ACTION, position: 50, dataAction: 'one_click_action', label: 'One Click Action' }
]
@UI.selectionField: [{ position: 20 }]
@UI.identification: [{ position: 20 }]
@EndUserText.label: 'Service Id'
key ServiceId,
Behavior Definition:
unmanaged implementation in class zcl_i_bp_contacts unique;
strict ( 2 );
define behavior for Z_I_BP_CONTACTS
//late numbering
lock master
authorization master ( instance )
//etag master <field_name>
{
create ( authorization : global );
update;
// delete;
field ( readonly ) ServiceId;
action action_x result [1] $self;
action print_y result [1] $self;
action print_z result [1] $self;
action send_payment result [1] $self;
action one_click_action result [1] $self;
}
So far, I have created a root view CDS(Z_I_BP_CONTACTS) to define the BO and also created a behavior definition for this CDS. Later, I created another view entity CDS(Z_C_BP_CONTACTS) on top of Z_I_BP_CONTACTS to maintain UI annotations. After this, I have created List report app using (Z_C_BP_CONTACTS). On the UI, only the first action defined in the action list is being displayed ignoring the rest. I have not created or used any behavior projection.
look like you have readonly entity, that's why they didn't render the selection box
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @junwu ! Although this is a read-only entity, we still need to trigger certain actions. I tried adding a Create operation as well as an action in the behavior definition, but the row selection is still not enabled.You mentioned using setSelectionMode("Multi"). Just to confirm, should this be added in the List Report controller extension?
| User | Count |
|---|---|
| 11 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.