This example illustrates the the plug-in concept.
This example is for education purposes only. Productive UI extension plug-ins should use the example described in the section Implementing a UI Plug-In as template.
For activating the plug-in, create a target mapping with the configuration below, then assign the catalog to a role.
Field |
Value |
---|---|
Semantic Object |
Shell This value is mandatory and needs to be written exactly like this. |
Action |
plugin This value is mandatory and needs to be written exactly like this. |
Application Type |
SAPUI5 Fiori App |
Title |
Hello World UI Plug-in |
URL |
/sap/bc/ui5_demokit/test-resources/sap/ushell/demoapps/HelloWorldPluginSample |
Component |
sap.ushell.demo.HelloWorldPluginSample |
Information |
|
Device Types |
All device types must be selected. |
Parameters |
None |
The simple example above can be extended by passing a greeting string and the duration of the message toast as parameters to the component. In the component implementation, this set of parameters can be accessed with the getComponentData() method.
_sayHello: function() { var oConfig = this.getComponentData().config, sMessage = (oConfig && oConfig.message) || "Hello World from SAP Fiori launchpad plug-in", iDuration = oConfig && oConfig.duration; sap.m.MessageToast.show(sMessage, { duration: iDuration }); }
In your target mapping, you can define values for the configuration parameters as follows:
Name |
Default Value |
---|---|
message |
Hello World from SAP Fiori launchpad plug-in |
duration |
5000 |