Configure detailed definition for table column widget
In XUI Editor, users could follow the same style to describe a column widget just like common widget definition. For facility in this extension sample, we have copied the xml definition file of link widget (Link.xml) in UNICOM® Digital Transformation Toolkit (UDTT™) and make some modification on it on below steps:
1 Rename the file with ‘ColumnLink.xml’ and put it into the folder ‘widgets’.
2 Remove the ‘functions’ and ‘events’ sections from the xml file.
3 Add a tag named ‘columnWidget’ to indicate this widget will be used for table column
<columnWidget editable="false"/>
These are the attributes for the ‘columnWidget’ tag
name
The attribute to identify the column widget. It is optional and the widget name registered in extended plug-in will be used if this attribute is not defined.
editable
The available values are ‘true’ and ‘false’ which indicate whether the widget could be chosen as a editable one or not for a table. Besides, it is optional and the widget could be chosen from both editable and read-only widget list in table properties view.
addTypeInfo
This attribute is optional and asks for a Boolean value. It will be used if the widget needs to be bound with UDTT typed data. If it is set to true, the generated jsp tag of the widget will contain the attribute named ‘type’.
The sample code snippet of this column widget definition is listed below.
4 Add or remove ‘property’ tag in the ‘properties’ block to indicate the properties of the widget.
These are the attributes for the ‘columnWidget’ tag:
name
The property name. It is required; otherwise this property will be ignored during generation.
type
Indicates which property editor will be used for this property. The value of it should equals with one of the registered property editor ID in existing UDTT tooling. It is required; otherwise the property editor will be disabled in editor.
default
Indicates the default value of this property. The generated JSP tag will contain this default value attribute if it is defined. It is an optional one.
showInColumn
Asks for a Boolean value which defines whether this property is available when this widget is used for a table column.
The sample code snippet of this column widget definition is listed below.