Widgetname.js Details

The <widgetname>.js defines the rendering component definitions and other JavaScript functions, which are required for the widget. The default create function is called from the UIBuilder framework. The syntax of the create function is as follow:
com.tibco.mdm.uibuilder.WidgetBuilder.createMywid1 = function(selector, config)
{
	// Write widget creation and other configuration code
}
  • com.tibco.mdm.uibuilder.WidgetBuilder - is a unique name space used to access the UI Builder's widgetbuilder object.
  • create - is the method which is invoked during the html dom ready state.
  • Mywid1 - is the widget name for which the create method is invoked. Note that, the create method name will be of the form create<widgetname>, where widgetname's first character will be in uppercase. For example if the widget name is 'mywid1' then method name will be 'createMywid1'. Similarly if the widget name is 'myWid1' then method name will be 'createMyWid1'.
  • selector - It is the widget id specified in the designer. At run time this will be used to access the container generated as an initial markup.
  • config - It is a json object specified in the properties and its values which are captured during design time.

After completing the widget js file it needs to be include in MDM Studio > Window > Preferences > UI Builder > Setup > JS Files.