-
1. Re: Render ContextMenu Items based on condition
mcfly83 Jul 19, 2010 11:07 AM (in response to mcfly83)In another thread it was proposed to use the condition value for CSS like this as a workaround:
styleClass="{var.hidden ? 'display-none' : ''}"
But I couldn't get this to work. Does someone else have an idea?
-
2. Re: Render ContextMenu Items based on condition
mcfly83 Jul 20, 2010 4:23 AM (in response to mcfly83)Another approach:
The context menu is activated via rich:componentControl
<rich:componentControl disableDefault="true" event="oncontextmenu" for="cm" operation="show">
<f:param ... />
</rich:componentControl>Now I'm trying to set the current item in a bean by using a4j:actionparam instead of f:param, but it seems as if you can't use an actionparam inside a rich:componentControl. Is that right?
-
3. Re: Render ContextMenu Items based on condition
ilya_shaikovsky Jul 21, 2010 7:42 AM (in response to mcfly83)workaround with styleClass - the only I think which will work completelly on the client. I'm afraid all the other solution - to show the menu via ajax with reRendering(to draw items in new states) and calling show in oncomplete.
Try something like that again please(actually I do not tested this yes):
<menu> ... <item styleClass="{hidden? 'displayNoneClass' : '' }" ... <menu> <rich:componentControl disableDefault="true" event="oncontextmenu" for="cm" operation="show"> <f:param name="hidden" value="#{..some node expression which returns boolean flag for this node}"/> </rich:componentControl>