![]() |
RTView®
User Guide |
Extending the Context Menu
This section describes how to extend items in the RTView
context menu. The context menu appears when you right-click on an object. The
context menu can be extended for a table object (obj_table02), heatmap object (obj_heatmap), grid object (obj_objectgrid)
or
tree control (obj_c1tree). Configure the context menu if you want to click
an element on a tabular object (for example, a row in a table, a cell in a heatmap or grid,
or a node in a tree control) and then choose one of several possible actions from a menu.
The context menu appears when you right-click on an
object (illustrated in the following figure).
The extended context menu is not supported in the Thin Client in iOS Safari (iPad/iPhone). To configure the context menu, you create a button for each of the possible actions (for example, an Ack button, an Unack button and an Own button) and edit button control properties (menuItemIndex, menuItemGroup and menuItemSubmenu). You also edit properties on the table, heatmap or grid object (menuItemGroup and rightClickActionFlag), which are referred to as the target object. The buttons in the menuItemGroup define the items that are added to the context menu, when the target object with the same menuItemGroup value on the same display is right-clicked. The context menu items are, effectively, shortcuts to the buttons. The buttons are not affected by the properties of the associated target object. Context menu items can be organized into submenus. The target object can be configured to invoke the first associated menu item when the user double-clicks on the object. Summary of Steps
Example To illustrate the how to configure the context menu, consider a display containing a table object. NOTE: A heatmap object is configured similarly to a table object, and has the same behavior when a cell in the heatmap is right-clicked or double-clicked. In our example, the table object shows the RTView AlertTable. A list of actions (Ack, Unack and Own) are associated with each row in the table. The display also contains three buttons labeled Ack, Unack and Own which execute different alert commands. A single left-click on a row could select the corresponding alert, or be followed by a click on the Ack (or Unack) button to acknowledge (or unacknowledge) the selected alert, or a click on the Own button could set the alert's owner to the current RTView username. To configure the above described behavior, the table object's drillDownColumnSubs property is configured to set a substitution variable, $alertID, that is equal to the value of the ID column for the selected row. The table object's command property is configured to drill-down to the current display window. This simply means that each click on a row stores the ID of the selected alert in the $alertID substitution variable. Also, the actionCommand property of the Ack button is configured to execute an Acknowledge Alert on ID = $alertID. The actionCommand for the Unack and Own buttons is configured similarly. If necessary, the enabledFlag of each button is attached to a function that determines whether the button's action is appropriate for the current selection. When an extended context menu is configured on the display:
The extra menu items appear at the top of the menu. One extra item appears in the menu for each button object (obj_c1button) on the display that meets these requirements:
If multiple buttons meet the requirements above, they
also appear in the
context menu, ordered by the menuItemIndex property in increasing
order. 1. Ensures that the substitutions for the right-clicked row are set before the menu is opened. 2. Enables the following double-click behavior on a table row:
To summarize, configuring the table and buttons as described in our example, the table object behaves as follows:
Optionally, the extra menu items on the context menu can be organized into
one or more submenus. This is done by assigning the same value to the
menuItemSubmenu property of each button whose item is to appear in
the same submenu. For example, to have the Ack,
Unack, and Own menu items appear in a submenu (rather than
the top-level context menu), we set the menuItemSubmenu
property of the Ack, Unack, and Own buttons to (for example) "Alerts". This adds an item labeled "Alerts
->" to the top-level of the context menu, and selecting that item opens a cascading submenu with the Ack, Unack, and Own
menu
items. The extended context menu is not supported in the
Thin Client in iOS Safari (iPad/iPhone).
All of the new properties (rightClickActionFlag, menuItemIndex,
menuItemGroup, menuItemSubmenu) are ignored by the Thin
Client on iOS
Safari, therefore no menu items are added to the context menu and no double-click
actions are supported. In particular, if a button is configured
on the display so that it is off-screen but has a nonzero menuItemIndex,
the button's command is not accessible on iOS Safari. |
|
|
|