Skip to content

Latest commit

 

History

History
312 lines (204 loc) · 4.99 KB

provide-the-design-time-metadata-for-the-addiframe-action-eb25d59.md

File metadata and controls

312 lines (204 loc) · 4.99 KB

Provide the Design-Time Metadata for the AddIFrame Action

Provide the design-time metadata and the meta functions needed when the addIFrame action is performed.

The name of the design-time metadata file is <control>.designtime.js. The module returns an object literal with the following properties:

Property

(Level 1)

Property

(Level 2)

Property

(Level 3)

Property

(Level 4)

Property

(Level 5)

Description

aggregations: <object>

->

->

->

->

Describes the aggregations of the element.

<aggregationName: <object>

->

->

->

Describes the aggregation called <aggregationName>.

... other possible properties ...

->

->

For more information, see Providing Design-Time Metadata.

childNames: <object> | <function> (mandatory)

->

->

Provide or compute a name for the controls inside the aggregation, which is understandable for the key user. This is needed for the addIFrame action to show the container title in the context menu (Embed Content to: <singular>) . Currently only singular is required, but adding a value for the plural makes the implementation future-proof.

Name your control based on the general UI concept and follow the SAP Fiori Design Guidelines. Example: Key users don't care about the difference between a smart, mobile, or responsive version of a form - they just call it "form".

"singular": <string> | <function>

->

i18n key from library resource bundle or function returning the translated text if library resource bundles aren't used.

"plural": <string> | <function>

->

i18n key from library resource bundle or function returning the translated text if library resource bundles aren't used.

actions: <object> (mandatory)

->

->

Describes the actions that can be applied to the element:

"addIFrame": <object> | <function>

->

Provides or computes the design-time metadata specific to the createContainer action for an element as an object with the following properties.

changeType: <string> (mandatory)

Provides the value of changeType from the previous step.

text: <string> (mandatory)

Provides the text to be shown in the context menu. It will be used after Embed Content: <text>. As there's no fallback, this has to be implemented.

isEnabled: <function> | <boolean> (optional)

Default is true. The isEnabled value or function is used to decide whether the createContainer action is available in SAPUI5 flexibility. You get the selected SAPUI5 element as a function parameter.

If under some boundary conditions you can't create containers inside, it returns false.

getCreatedContainerId: <function> (optional)

Defaults to the ID of the newly created container.

If the newControlId isn't the real container that was created (but maybe only a wrapper around the control that really represents the newly created container), you must return these IDs.

Here's an example:

Sample Code:

<control>.designtime.js

sap.ui.define(["sap/ui/core/Lib"], function(Lib) {
    "use strict";
    return {
        aggregations: {
            headerContent: {
                childNames : {
                    singular : function(){
                        return Lib.getResourceBundleFor("sap.uxap").getText("HEADER_CONTROL_NAME");
                    }
                },
                actions : {
                    addIFrame: {
                        changeType: "addIFrame"
                    }
                }

            }
        }
    };
});