Skip to end of metadata
Go to start of metadata

This function creates a new base widget from scratch.  The implementation of the widget will require advanced JavaScript coding.

Parameter:

  • config object - JavaScript object containing configuration properties

Configuration Options:

  • name - the new base widget name; also referred to as the "field type"
  • newId - the default id prefix - used to assign id's when the element is first created; for example if the newId is "Map", new elements created will have id's of Map1, Map2, Map3, etc.
  • menuName - pull-down menu name for the widget
  • defaults - an object with name/value pairs for default property settings for this base widget; these values can overridden by the pui.toolbox.add() function
  • propertySetters - an object representing a set of functions that are triggered when a particular widget property is changed; the "field type" function can be used as the main function to construct the widget; each function will receive a configuration parameter with the following properties:
    • originalValue - original value before the property was changed
    • newValue - new value (before scripting evaluation)
    • value - new value (after scripting evaluation)
    • properties - object representing the current property names and values for the widget
    • dom - reference to the main DOM element for the widget
    • oldDom - reference to the old DOM element (this will only be different from dom if the change to the widget property required the dom element to be changed or recreated)
    • propertyName - the name of the widget property being changed
    • design - flag that specifies whether the widget property is being changed at design time or at run time 
    • designItem - reference to the design item object for this widget
    • resizer - reference to the resizer object for this widget
    • evalProperty - function that can be used to evaluate scripted properties
  • globalPropertySetter - a global function that is triggered every time any widget property is changed
  • tag - the tag of the main DOM element; if omitted, "div" tag is assummed
  • inputType - if the "input" tag is specified, this option specifies the input type, such as "text", "checkbox", "radio", "password", etc.
  • resizable - if false is specified, the widget cannot be resized in the designer
  • canBelongToGrid - if false is specified, the widget cannot be dragged into a subfile grid
  • dependencies - Array of strings containing URLs pointing to JavaScript or CSS files. At run time, these will be loaded into your session (if not there already) only if your widget is used on the current format.  At design time, they are loaded when the Visual Designer is loaded. (Note that this configuration option is available starting with Profound UI Version 5, Fix Pack 8.0)

Example:

The following code creates a "google maps" base widget.

Labels
  • No labels