First page Back Continue Last page Graphics

Creating Context Menus


Creating Context Menus

ADF Faces client behavior tags provide declarative solutions to common client operations that you would otherwise have to write yourself using JavaScript, and register on components as client listeners. In this release, ADF Faces supports the client behavior af:showPopupBehavior to use in place of a client listener. You perform the following steps to use af:showPopupBehavior to create a context menu for a component:

1. Create a pop-up menu with af:popup, af:menu, and af:commandMenuItem components.

2. Give the pop-up menu an ID.

3. Create a component to use the context menu.

4. Drag the af:showPopupBehavior operation to the component and set properties:

popupId: Specify the ID of the af:popup component whose contents you want to

display in a pop-up.

alignId: Specify the ID of the component to align the pop-up contents with.

align: Specify an alignment position that is relative to the component identified by alignId.

triggerType: Specify the event type to use to trigger the pop-up. Default is action, because typically, you would associate af:showPopupBehavior with a command component. When the command component is clicked, an action event is