I would like to customise the label text of a dialog box that opens on click of a button (powered by a custom action). The screen has been built with SAP Fiori elements.
To add the custom action, I have added the action (and bound to entity) in my CDS file
Please ignore the namespaces. I have changed them to mimic the situation but hide application specific details.
entity myEntity as projection on internalEntities.myEntity
actions {
@(
cds.odata.bindingparameter.name: '_it',
Common.SideEffects : {TargetProperties: [
'_it/possibleActions',
'_it/processLogEntries'
]}
)
action processAction1(reasonText : String @mandatory @title : '{i18n>action.dialog.reason.label}');
}
The above entity executes an action after accepting parameter reasonText
from the user.
I am using UI annotations (most of which were constructed by the Application Modeler) to present my action in the UI. The corresponding annotation is below
{
$Type : 'UI.DataFieldForAction',
Action : 'my.service.processAction1',
Label : '{someAggregation/actionName}',
}
Here {someAggregation/actionName}
is a field within myEntity
.
The application displays an initial button on the form, onclick of the button it provides a dialog to accept the reason text
and on submission of the dialog it runs the custom action correctly.
The initial button displays correctly and has the label text set to {someAggregation/actionName}
of the bound entity internalEntities.myEntity
. However, the button of the dialog label itself is blank.
I would like to somehow pass the same context of the parent form which houses the initial button to the dialog form.
- I observed that the binding context of the original screen does not match the dialog form.
- The context of the dialog form is always empty
- I have tried some of the principles of example #3 from https://community.sap.com/t5/technology-blogs-by-sap/fiori-elements-a-journey-of-building-an-action-dialog-on-a-list-report/ba-p/13400027#1
- I was also looking at the footer extension logic mentioned here https://ui5.sap.com//#/topic/7619517a92414e27b71f02094bd08d06. I didn’t go too deep here because I felt that the dynamic label text should be supported out of the box and maybe some simple configuration that I might have missed or misconfigured
My apologies, I am a Java Developer working on Front end for the first time and have been exposed to Fiori so a lot of this configuration looks like magic to me. I am happy to provide whatever additional information that you would require and thank you in advance