Documentation Center

Adding an Onclick event to a control

You can add an Onclick event to a UI control object by editing the <onclick> attribute of its corresponding control element in the controls.xml file.

About this task

To control the action LiveContent S1000D performs when a user clicks a UI object such as an icon or button, edit the <onclick> attribute of the element in the controls.xml file corresponding to the object.

Procedure

  1. Open the controls.xml file in a text editor.
  2. In the controls.xml file, locate the control element corresponding to the desired UI object.
    For example, to add an Onclick event to the Home icon, locate the <control id="CVCtrl_home" type="icon" child="true"> tag.
  3. Between the element's opening and closing tags, add or edit the <onclick> attribute to include a valid function call as in the following example.
    <onclick>CVPortal.components.cvDocHandler.loadHome();</onclick>
  4. Save and close the controls.xml file.

Results

The desired action is performed when a user clicks the Home icon.