2 Replies Latest reply on Jun 15, 2009 12:40 PM by Mark LoSacco

    rich:contextMenu - icon check to show current selection

    Mark LoSacco Newbie


      I am using a shared rich:contextMenu that is popped up from a dataTable. When the contextMenu is displayed I want to show an icon (check mark) to show which of the items in the menu is currently enabled/disabled.

      I am using f:param to pass the menu setting to the menu via rich:componentControl. Within the menu, however, I am having trouble using the parameter macro {} within the icon attribute of rich:menuItem.

      The following code does not work (syntax error to place macro within #{}), but is it possible to use the macro within a #{} in some other way to achieve my desired result?:

      <rich:contextMenu attached="false" id="menu" submitMode="ajax">
       <rich:menuItem icon="#{{value1} eq 'YES' ? '/img/check.png' : '/img/blank.png'}">
       Setting 1

      where value1 is passed in via:

      <h:graphicImage id="img_#{rowid}_#{colid}"
       <rich:componentControl id="cc_#{rowid}_#{colid}"
       event="onclick" for="menu" operation="show">
       <f:param name="value1"

      I am not sure where to look for information on using these {} macros - I haven't seen anything in example code that would show me how to use one within context of making a logic decision.