First page Back Continue Last page Graphics


Notes:

Creating Menus (continued)

Type: Specify a type for this menu item. When a menu item type is specified, ADF Faces adds a visual indicator (such as a checkmark) and a toggle behavior to the menu item. At run time, when the user selects a menu item with a specified type (other than default), ADF Faces toggles the visual indicator or menu item label. Use one of the following acceptable type values:

check: Toggles a check mark next to the menu item label. The check mark is displayed when the menu item is selected.

radio: Toggles an option button next to the menu item label. The option button is displayed when the menu item is selected.

antonym: Toggles the menu item label. The value set in the selectedText attribute is displayed when the menu item is selected, instead of the menu item defined by the value of text or textAndAccessKey (which is what is displayed when the menu item is not selected). If you select this type, you must set a value for the selectedText attribute.

default: No type is assigned to this menu item. The menu item is displayed in the same manner whether or not it is selected.

Selected: Set to true to make this menu item selected. By default, a menu item is not selected. The selected attribute is supported for check, radio, and antonym type menu items only.

SelectedText: Set the alternate label to display for this menu item when the menu item is selected. The type attribute for the menu item must be set to antonym.

Action: Use an EL expression that evaluates to an action method in an object (such as a managed bean) to be invoked when this menu item is activated by the user. The expression must evaluate to a public method that takes no parameters, and returns a java.lang.Object. If you want to cause navigation in response to the action generated by commandMenuItem, instead of entering an EL expression, enter a static action outcome value as the value for the action attribute. You then need to either set partialSubmit to false, or use a redirect.

actionListener: Specify the expression that refers to an action listener method that will be notified when this menu item is activated by the user. This method can be used instead of a method bound to the action attribute, allowing the action attribute to handle navigation only. The expression must evaluate to a public method that takes an ActionEvent parameter, with a return type of void.