
See all 3 parts of the custom component series:
Both the tooltip and Fiori dialog are available for use now. |
2 great colleagues of mine, Niall Comer and Conor Brennan, from the Customer Success’s Center of Excellence in Ireland, created this Fiori-type dialog for SAP Build Apps. It allows you to customize the buttons, label and message, and grays out the screen while the dialog appears. It also centers the dialog, whether you are on the web or on mobile, and re-centers as the web screen is resized.
On mobile it looks like this:
I took what they did and created a custom component, whose token is (in EU10 only):
Qfptkoc4OFmK-fu8M0g1qg
Go to the component Marketplace (EU10 landscape only) and search for this token, and install the component.
To test it, remove all components except for a container, and a button inside the container.
Select the page (click on the canvas), and enable Style → Advanced → Stretch to the viewport height, and clear all the Style → Padding.
To the container, set Style → Padding to 24 pixels on top, left, and right, to restore the padding.
Add the Fiori Dialog component outside the container, at the bottom.
Set the following properties for the Fiori Dialog component:
In addition to the above properties, you need to do the following on the Fiori DIalog component:
Add logic to your button to set your page variable to true, so the dialog appears on button click.
Add event handlers for ClosedSelected and ClosedSelected events to perform the appropriate actions based on the user's actions.
Now it should work like this:
This is just a short summary of what was done to create the custom component.
Inside a container, the following components were added, and then the outer container was converted to a component by clicking Convert to New Component in the Properties tab.
The above created the basic dialog box:
Inside the component template editor, we created the following:
In the inner components, the properties were used to set the corresponding property. For example, the label property set the title of the dialog.
And the events were triggered when a user clicked a button. For example, for the action button, a click sets the property to hide the dialog, and then the ClosedSelected event is triggered, which can be captured in the containing app.
NOTE: Currently there is no way to set certain layout properties on the component itself, so these must done by you, the consumer of the component.
Currently, if you open the component with the component template editor, you will not see the dialog box. To see it, do the following:
Here are some ideas for enhancements:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |