To enable a control for design-time usage, follow the steps described here.
The library containing the control needs to be enabled for design-time usage. See Enable a Library for Design-Time Usage.
All design-time metadata must be contained in one special folder within the library. The location is <lib_namespace>/designtime. If there are sub-namespaces in the library, the sub-namespace needs to be present within the designtime folder.
For example, if you have a sap.m.semantic.SemanticPage control, you need a sap/m/designtime/semantic/SemanticPage.designtime.js file.
-
Move all existing
<control>.designtime.jsfiles into thedesigntimefolder.If the library contains subfolders, repeat their structure within the
designtimefolder. -
In the
designtimefolder, in the subfolder for your control, create the following files:File
Description
<control>.designtime.jsFile containing the design-time metadata. For more information, see Providing Design-Time Metadata.
<control>.icon.(resolution).pngIcons for controls in different resolutions (small, medium, large)
<control>.icon.svgIcon for controls that are scalable to different resolutions
-
In the
<control>.jsfile, in the metadata of the control, set thedesigntimeproperty to the name of the module.Here's an example:
Button.js
var Button = Control.extend("<lib_namespace>.Button", { metadata: { ... aggregations: {...}, properties : {...}, designtime : "<lib_namespace>/designtime/Button.designtime" } });