Thursday, August 27, 2015

ADF Table with context menus

We can add ADF Table context menus so user right clicks on a row, the context menu will be displayed.


add a facet to table
<af:table>
        <f:facet name="contextMenu">
           <af:popup id="cmpop" contentDelivery="lazyUncached">
               <af:menu id="cmm1" text="My Context Menu">
                  <af:commandMenuItem text="Do something"
                          id="cmi1"
                          actionListener="#{backingBeanScope.myBean.myActionListener}"/>
               </af:menu>
          </af:popup>
        </f:facet>
</af:table>
 Table has another property:
          contextMenuSelect="true" so this ensures the right click on a row will make the row selected and context menu shows up.

Note:

  • add <af:showPopupBehavior triggerType="contextMenu" popupId="cmpop"/> if you like for table columns for context menu display
  • add partial triggers so UI refreshes after context menu execution.

No comments:

Post a Comment