Configuring a Context Menu

The following is an example of how to configure a context menu using custom code:

  1. Select the tgv_part Presentation Configuration Item, right click tgv_part_context in the Command Bar Section grid and select Open in the context menu.

Figure 48.

The tgv_part_context_menu Item appears.

Figure 49.

  1. Click to edit the tgv_part_context_menu Item.
  2. Click Create New Presentation Configuration. The Presentation Configuration Item appears.
  3. Enter tgv_part in the Name field and select the orange color.

Figure 50.

  1. Click the New Command Bar button in the Command Bar Section to add a new related Item.
  2. Enter tgv* in the Name cell of the search grid and add both tgv_part_toolbar and tgv_part_ContextMenu Items.

Figure 51.

  1. Make sure to add the Items to the Relationships grid.

Figure 52.

  1. Add an identity in the For Identity column. This Identity determines which users will have access to the buttons/menus.
  2. Click to save the tgv_part Presentation Configuration Item.
  3. Right-click tgv_part_toolbar and select Open from the context menu.

Figure 53.

The tgv_part_toolbar Presentation Configuration Item appears. It contains the tgv_view button.

Figure 54.

  1. Click the New Command Bar button in the Command Bar Item tab. The Select Item Type dialog appears.

Figure 55.

  1. Select Menu and click OK. It appears in the Command Bar Item tab.
  2. Right-click the Menu ItemType and click Open in the context menu.
  3. Right-click tgv_part_menu in the Command Bar Item grid and select View Command Bar Item. The tgv_part_menu Presentation Item appears.

Figure 56.

The rb_viewItemInitHandler Method is used to determine whether or not the data template is valid.