on 01-17-2023 8:17 AM
Hi,
I wanted to add actions from Behavior Definition inside different drop down menus (Refer image)
I want to group these actions inside (example) three separate drop downs (Refer preferred output)
my current code:
Behavior Definition:
action ( features : instance ) a1 result [1] $self;
action ( features : instance ) a2 result [1] $self;
action ( features : instance ) a3 result [1] $self;
action ( features : instance ) b1 result [1] $self;
action ( features : instance ) b2 result [1] $self;
action ( features : instance ) b3 result [1] $self;
action ( features : instance ) c1 result [1] $self;
action ( features : instance ) c2 result [1] $self;
action ( features : instance ) c3 result [1] $self;
Behavior Projection:
use action a1;
use action a2;
use action a3;
use action b1;
use action b2;
use action b3;
use action c1;
use action c2;
use action c3;
Metadata:
@UI: { lineItem: [ { position: 90 },
{ type: #FOR_ACTION, dataAction: 'a1', label: 'A1' },
{ type: #FOR_ACTION, dataAction: 'a2', label: 'A2' },
{ type: #FOR_ACTION, dataAction: 'a3', label: 'A3' },
{ type: #FOR_ACTION, dataAction: 'b1', label: 'B1' },
{ type: #FOR_ACTION, dataAction: 'b2', label: 'B2' },
{ type: #FOR_ACTION, dataAction: 'b3', label: 'B3' },
{ type: #FOR_ACTION, dataAction: 'c1', label: 'C1' },
{ type: #FOR_ACTION, dataAction: 'c2', label: 'C2' },
{ type: #FOR_ACTION, dataAction: 'c3', label: 'C3' }
],
identification: [ { position: 90 },
{ type: #FOR_ACTION, dataAction: 'a1', label: 'A1' },
{ type: #FOR_ACTION, dataAction: 'a2', label: 'A2' },
{ type: #FOR_ACTION, dataAction: 'a3', label: 'A3' },
{ type: #FOR_ACTION, dataAction: 'b1', label: 'B1' },
{ type: #FOR_ACTION, dataAction: 'b2', label: 'B2' },
{ type: #FOR_ACTION, dataAction: 'b3', label: 'B3' },
{ type: #FOR_ACTION, dataAction: 'c1', label: 'C1' },
{ type: #FOR_ACTION, dataAction: 'c2', label: 'C2' },
{ type: #FOR_ACTION, dataAction: 'c3', label: 'C3' }
] }
Please suggest how to do this.
Regards.
Hello vicky_p,
by using Fiori Elements template "List Report" you cannot achieve what you like to, since every action is represented by separate button.
If you like to have "dropdown" buttons, you must use SAP UI5 Freestyle app. There you use smart filter bar and smart table controls.
Then you can customize smart table with custom toolbar
and insert "menu button" into toolbar
https://sapui5.hana.ondemand.com/#/entity/sap.m.MenuButton/sample/sap.m.sample.MenuButton
On each button event then you can invoke RAP action, depends on ODATA version
ODATA V4: https://sapui5.hana.ondemand.com/sdk/#/api/sap.fe.core.controllerextensions.EditFlow%23methods/invok...
But i think it is lot of custom coding
Br,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marek thanks for your response,
But i think this can be achieved from backend aswell by annotations on behavior projection. I will still consider your feedback.
Example done by SAP: SAP Developers - Guidance for developing RAP applications in ABAP
(Start from 42:10, Also see comment section of the video, SAP Responded it can be done via annotations for Bdef)
Thanks for your inputs 🙂
I see now and i´m curious as well 🙂 what about ask Andre himself.
Hello andre.fischer,
thanks for perfect guidance video into RAP. Me and vicky_p(maybe others aswell) wonder, how we can achieve dropdown button(as create button in video) using cds UI annotations and actions in BD of root entity.
I tried below annotations, but has no success, buttons are separated. Thank you.
@UI.lineItem: [{ position: 10, type: #FOR_ACTION, label: 'test_x', dataAction: 'test_x' },
{ position: 10, type: #FOR_ACTION, label: 'test_y', dataAction: 'test_y' },
{ position: 10, type: #FOR_ACTION, label: 'test_z', dataAction: 'test_z' }]
projection;
define behavior for ZMLBK_C_BOOKSHOP alias BOOKSHOP
{
use create;
use update;
use delete;
use action test as test_x;
use action test2 as test_y;
use action test3 as test_z;
use association _EMPLOYEE { create; }
}
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.