Example
To understand how the @mention component works, consider a scenario where you're composing a new email in Microsoft Outlook for Office 365. As soon as you type @ you get a list of users in your organization and the user that you select gets added to the To list. You also get additional information about the user, such as name, email address, and a display picture if available, which helps you identify the correct user when there are multiple users of the same name.
As a scenario specific to Remedy, if an incident manager is working with an incident, the incident manager can type @ in the activity notes to get a list of agents. This helps the incident manager select a particular agent from the list of available agents.
To support the @mention component for Progressive views, the following properties are added in Developer Studio :
| Property name | Property type | Property values | Description |
|---|---|---|---|
| Enable Menu Hotkeys | Boolean |
| Specifies if the menu hotkeys are to be enabled. To define menu hotkeys, you must set the value of this property to True. |
| Menu Hotkeys | String | A string | Use this property to define hotkey definitions. By default, the text "No Hotkey Defined" is displayed as the value for this property. |
To configure the @mention component
- On the Progressive view of a form, double-click a Character field.
- On the Properties panel, under the Display property group, for the Enable Menu Hotkeys property, select the True value.
- In the Value column for the Menu Hotkeys property, click the ellipsis button.
The Menu Hotkeys dialog box is displayed. Click Add, and then perform the following steps:
Column Step Hotkey Click the first row in this column, and then select a character from the list. Menu Name Click the first row in this column, and then click the ellipsis button to select a menu from the Menu Selector dialog box. Active Link Click the first row in this column, and then click the ellipsis button to select an active link from the Active Link Selector dialog box.
The active link that you attach to a hotkey must be an existing one and associated with the current form.
Labels Click the first row in this column, and then in the box, type in labels that are separated by a semicolon. Auto Complete Key Stroke # Enter an integer value.
Click OK.
Parameters for hotkey definition
The following parameters can be a part of any hotkey definition:
| Parameter | Description |
|---|---|
| Hotkey | When you press this character key, the @mention component is executed based on the other parameters that you've provided in the hotkey definition. This parameter is the mandatory part of any @mention definition. |
| Menu Name | This is a name of the menu that is used to populate the popup. This parameter is the mandatory part of any @mention definition. |
| Active Link | This is a name of the active link that gets executed when you select an item from the popup. This parameter is an optional part of any @mention definition. |
| Labels | This is a set of labels that are defined for a menu. This parameter is an optional part of any @mention definition. You can add any text or you can add $menuLabel$ where the label gets replaced by the menu label value during execution. menuLabel represents the label that is selected when using a search menu. |
| Auto Complete Key Stroke # | You can enter an integer value value for this parameter. For example, if you enter the value 3, a drop-down list appears after you type three characters in the menu. If you enter the value zero (0), the drop-down list appears as soon as type a hotkey character key. |
There are scenarios when you want the users of your application to have the option of selecting the type of content that they see in an autosuggest list when using @mention. You can create such a search field by using the CHANGE_HOTKEY_MENU command.
To enable users to select the type of content displayed in @mention
In the following example scenario, as an application developer, you add the CHANGE_HOTKEY_MENU command to enable the application users to decide the type of content in the @mention list. However, note that real-world implementations can vary considerably depending on your business needs.
Example:
Problem
Apex Global wants to have a ticketing application in which one of the fields requires the application users to be able to use @mention to add mentions of either people or assets. The default behavior is that both assets and people are displayed in the @mention autosuggestion list. Apex Global wants the application users to be able to select an option to see only assets or only people for ease of use.
Solution
Seth, the application developer, creates two buttons right next to the field. Users can click one button to make @mention suggest only assets or click the other button to make the @mention show only usernames. Seth uses a run process CHANGE_HOTKEY_MENU fieldID key menuName in an active link in each of the buttons so that the content displayed by the @mention autosuggest list is replaced by the content specified in the active link.
Before you begin
Make sure that you fulfil the following conditions before you perform the steps for creating fields where users can switch between @mention content.
- In Developer Studio , you must have a form that contains usernames and a form that contains asset names.
- You must have predefined search menus of type Search.
Process for creating fields where users can switch between @mention content
The following diagram shows a high-level overview of the steps required to create fields where users can switch between different types of @mention content:
Create two buttons and a character field. The character field consists of a default @mention menu. The buttons are assigned active links and menus which should replace the default @mention menu when the buttons are clicked by application users.
The following animation explains a high-level concept of the use case:
To create the field and buttons
In this procedure, we create a character field with a default menu, two buttons that contain an active link that uses the CHANGE_HOTKEY_MENU.
- In Developer Studio , create a New Regular Form.
Create a Progressive View.
Steps (2)
- Form > Create New View.
The Create New View dialog box opens. - In the View Type list, select Progressive.
- Form > Create New View.
- Add two buttons to the view.
- Name the buttons as Assets Only and Users Only.
- (Optional) Add a new section panel.
Steps (2)
- In Outline, right-click the section panel holder and select Add New Panel.
- In the Properties tab, select the Sub Panel Holder, and in Properties, click Display > Orientation and select Horizontal.
This changes the orientation to show the new section panel to the right of the section with the buttons.
- In Outline, right-click the section panel holder and select Add New Panel.
To define the hotkey for the character field
Add a character field and add a hotkey associated with a search menu to it.
- From the Palette, drag Character into the view or the section panel.
Developer Studio assigns it a default name such as Character Field_c. - Select the character field and rename it to Character Field.
- In the Properties tab, click Display > Enable Menu Hotkey and select True.
This enabled you to set a hotkey for the character field. - Below the Enable Menu Hotkey property, click the ellipsis () button next to Menu Hotkeys.
The Menu Hotkeys dialog opens. - Click Add.
Developer Studio adds @ in the Hotkey column. - In the Menu Name column, click the ellipsis () button.
The Menu Selector dialog opens. - Find the search menu that lists usernames and assets you want to associate with the hotkey and click OK.
- In the Auto Complete Key Stroke # column, add 3.
The autosuggest is activated when application user types at least three characters.
- From the Palette, drag Character into the view or the section panel.
- Save the form with a name.
- In this example name the form as ChangeHotkeyMenu.
- Create a new search menu.
- Select AR System Navigator > aRServerName > All Objects > Menus > New Search Menu.
The hotkey supports only search menus. - Click the ellipsis () button next to Form Name.
The Form Selector dialog opens. - Find and add the user form that contains all usernames, and click OK.
- Save the search menu.
In this example, name the menu as ChangeHotkeyMenuM1.
- Create another search menu and name it as ChangeHotkeyMenuM2.
This menu must list all asset names. - Click the ellipsis () button next to Form Name.
The Form Selector dialog opens. - Find and add the form that contains all asset names, and click OK.
- In the Label Fields section, click Add.
The Field Selector dialog opens. - Select Asset Name, and click OK.
- Save the search menu.
In this example, name the menu as ChangeHotkeyMenuM2.
To create an active link for the Users Only button
Create an active link for the Users Only button named ChangehotkeymenuAL1.
- Select New > Active Link.
Add the following settings to the active link:
Setting Value, selection, or function Additional details Associated Forms > Add ChangeHotkeyMenu Execution Options > Button/Menu Field Users This is the button that triggers the active link. Run If Qualification 1=1 This triggers the run process in the If Actions without exception. If Actions > Add action > Run Process CHANGE_HOTKEY_MENU fieldID @ changehotkeymenuM1 $NULL$ $NULL$ 3Make sure that there is a single space between each attribute.
fieldIDis the ID of Character Field.changehotkeymenuM1is not dynamic and must always be hardcoded (static). This active link runs when you type three characters, that is, when you type @ in the Character Field and it fetches information from the ChangehotkeymenuM1 search menu.
To create an active link for the Assets Only button
Create another active link for the Assets Only button named ChangehotkeymenuAL2.
- Select New > Active Link.
Add the following settings to the active link:
Setting Value, selection, or function Additional details Associated Forms > Add ChangeHotkeyMenu Execution Options > Button/Menu Field Assets This is the button that triggers the active link fetches and uses it to replace the default menu of the character field. Run If Qualification 1=1 This triggers the run process in the If Actions without exception. If Actions > Add action > Run Process CHANGE_HOTKEY_MENU fieldID @ changehotkeymenuM2 $NULL$ $NULL$ 3Make sure that there is a single space between each attribute.
fieldIDis the ID of Character Field.changehotkeymenuM2is not dynamic and must always be hardcoded (static) with the menu name. This active link runs when you type three characters, that is, when you type @ in the Character Field and it fetches information from the ChangehotkeymenuM2 search menu.- Save the changes.
Validating the character field in PWA
View the form in the progressive web application screen to check whether it works as intended.
- In a browser, log in to PWA.
For example, <serverName>:8080/arsys/pwa/#/login - Change the URL to include the Progressive View form that you created in Developer Studio .
<serverName>:8080/arsys/pwa/#/forms/<serverName>/<formName>/<progressiveViewName> - The PWA screen displays the character field and the buttons.
In Character Field, type @ followed by three characters.
The field displays users and assets.- Click Users Only and type @ followed by three characters.
The field displays usernames. - Click Assets Only and type @ followed by three characters.
The field displays assets names.
Where to go from here
Learn more about the syntax and additional options within the process command in the Process commands topic.