Adding a control to the LiveContent S1000D user interface
Control elements on the LiveContent S1000D are defined in the controls.xml resource file.
About this task
This example shows how to add an icon control element to the LiveContent S1000D user interface. The process is the same for adding a tab or button.
Procedure
- Open the controls.xml file in a text editor.
- Within the root
<controls>section of the file, locate the<set>element corresponding to the area of the interface to which the control will be added. For example, to add a control to the main user interface window, locate the<set id="main">element. In most cases, you will likely be adding and editing controls within the<set id="main">element. - Within the appropriate
<set>element, add markup specifying a unique name for the new control and its type (such as an icon), as in the following example.<control id="CVCtrl_genform" type="icon"> </control> - Within the new control's opening and closing tags, add markup specifying the classes that define the icon images for the control in its enabled and disabled states, respectively, as in the following example.
<control id="CVCtrl_genform" type="icon"> <disabled className="genform_dark"/> <enabled className="genform_iconized"/> </control> - Within the control's opening and closing tags, add markup specifying icon images for the control in its highlighted state as in the following example.
<control id="CVCtrl_genform" type="icon"> <disabled className="genform_dark"/> <enabled className="genform_iconized"/> <highlight className="genform_highlightIcon"/> </control> - Within the control's opening and closing tags, add markup to include a text attribute representing the control's label as in the following example.
In this example, the text attribute is set to<control id="CVCtrl_genform" type="icon"> <disabled className="genform_dark"/> <enabled className="genform_iconized"/> <highlight className="genform_highlightIcon"/> <text>ctrl.genform</text> </control>ctrl.genform, which will correspond to an item defined with that name in your language resource files. At runtime, the control is generated with the corresponding value from the applicable language resource file. - Within the control's opening and closing tags, add markup to include an onclick element containing a valid function call defining the action to be performed when a user clicks the control.
<control id="CVCtrl_genform" type="icon"> <disabled className="genform_dark"/> <enabled className="genform_iconized"/> <highlight className="genform_highlightIcon"/> <text>ctrl.genform</text> <onclick>CVPortal.components.cvDocHandler.loadGenform();</onclick> </control> - Optionally, within the control's opening and closing tags, add markup to include attributes defining conditions to determine when the control is to be:
- shown or hidden
- visible or invisible
- enabled or disabled
- Showing or hiding a control
- Making a control visible or invisible
- Enabling or disabling a control
- Optionally, within the control's opening and closing tags, add markup that restricts access to the control to a specific device (such as a desktop) and/or to a specific user security group.
For information about adding these attributes, refer to the Controlling access to a control topic in the Customizing the LiveContent S1000D user interface section of this documentation.
- Save and close the controls.xml file.
- In the language resource file for each language in which the UI will be displayed, specify the label text for the new control by adding a name/value pair corresponding to the
textattribute you added in step 5, as in the following example in English in the resources-EN.prop file.ctrl.genform=Generic Forms