Skip to content

Latest commit

 

History

History
298 lines (194 loc) · 4.8 KB

provide-the-design-time-metadata-for-the-createcontainer-action-a3ecf41.md

File metadata and controls

298 lines (194 loc) · 4.8 KB

Provide the Design-Time Metadata for the CreateContainer Action

Provide the design-time metadata and the meta functions needed when the createContainer 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 createContainer action to show the container title in the context menu (Create <singular>) and to show the default title when a new container is created (New <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.

"createContainer": <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.

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([], function() {
    "use strict";
    return {
        aggregations: {
            groups: {
                childNames: {
                    singular: "GROUP_CONTROL_NAME" // mandatory
                    plural: "GROUP_CONTROL_NAME_PLURAL" // recommended
                    },
                actions: {
                    createContainer:  {
                        changeType: "addGroup" // mandatory
                    }
                }
            }
        }
    };
});