Use Actions and Menus
Use Actions and Menus
Technologies / User Interface Add-Ins / Assemblies with Multiple Panels / Find-Manage with Categories
Main Actions
If there is one action that you expect the user to click on in typical work scenarios, define it as a prominent main action, such as the Create New Request action in the below image.
To define a main action, add the
mainAction
property to the action element:
<action id="createRequest"
mainAction="true">
Menus for Secondary Actions
Do not display rarely used actions in the panel. Instead, hide them in a drop-down menu.
Define a top-level panel action to hold the menu, and nest actions for menu items inside the top-level action. The
id
property is required for the menu:
Custom HTML content can be used to replace a field input control. The field can still display its title.
<panel type="tree" ...>
<!-- The menu button. -->
<action type="menu" id="addMenu">
<title>Add New</title>
<!-- First menu item. -->
<action id="addDv">
<title>Division</title>
</action>
<!-- Second menu item. -->
<action id="addDp">
<title>Department</title>
</action>
</action>
For panels that have common data export actions - export to XLS, export to DOCX, data transfer – define all actions in a menu, and use the Archibus Export icon instead of the menu title:
<action type="menu"
imageName="/schema/ab-core/graphics/icons/view/export.png"
>
<!-- Specify no title -->
<title></title>
<action id="exportXLS">
<title>Export to XLS</title>
</action>
<action id="exportDOCX">
<title>Export to DOCX</title>
</action>
</action>
For panels that have customization/options actions, such as Select Fields, define actions in a menu, and use the Archibus gear icon instead of the menu title:
<action type="menu"
imageName="/schema/ab-core/graphics/icons/view/gear.png"
>
<!-- Specify no title -->
<title></title>
<action id="selectFields">
<title>Select Fields</title>
</action>
</action>
If you defined a menu in the view, you can dynamically add actions to it from Java Script, or clear all actions from the menu:
var addMenu = this.tree.actions.get('addMenu');
// clean all menu actions
addMenu.clear();
// add a menu action
addMenu.addAction('addEmployee', getMessage('addEmployee'),
this.onAddEmployee.createDelegate(this));
You can use the
imageName
property to specify icons for menus as well as for individual drop-down menu items.