-
1. Re: rich:contextMenu and layout behavior
ilya_shaikovsky Aug 9, 2010 4:29 AM (in response to cassionandi)context menu actually not inserted into <a> childs but encoded after the link and attached usign script. So as div - block element - next link placed below.
B.t.w. general advice (which will actualy solve your problem in the same time). Do not iterate menus - just use single shared once. Except solving your problem - it will also be resulted in better performance. check http://livedemo.exadel.com/richfaces-demo/richfaces/componentControl.jsf second sample.
-
2. Re: rich:contextMenu and layout behavior
cassionandi Aug 10, 2010 8:52 AM (in response to ilya_shaikovsky)Okay Ilya, so my code has changed but I don't understand HOW it works completely.
<a4j:repeat value="#{test.keyword}" var="keyword">
<a4j:commandLink id="link"> L I N K</a4j:commandLink>
</a4j:repeat>
<rich:componentControl event="oncontextmenu" for="id_context_menu" operation="show">
<f:param value="#{keyword}" name="keyword_param"/>
</rich:componentControl>
<rich:contextMenu id="id_context_menu" submitMode="ajax">
<rich:menuItem value="Edit" id="test_edit"></rich:menuItem>
</rich:contextMenu>How the componentControl is bounded to the commandLink without the attachTo attribute? If the componentControl is inside the commandLink, the event="oncontextmenu" dons't work, but the onclick yes.
Another question. The f:param can see the var="keyword"?
-
3. Re: rich:contextMenu and layout behavior
ilya_shaikovsky Aug 11, 2010 8:16 AM (in response to cassionandi)1) if not works in link - wrap the link to div and attach CC to it.
2) to use var - place CC in iteration.
so should be
<a4j:repeat value="#{test.keyword}" var="keyword"> <a4j:outputPanel layout="block"> <a4j:commandLink id="link"> L I N K</a4j:commandLink> <rich:componentControl event="oncontextmenu" for="id_context_menu" operation="show"> <f:param value="#{keyword}" name="keyword_param"/> </rich:componentControl> </a4j:outputPanel> </a4j:repeat> <rich:contextMenu id="id_context_menu" submitMode="ajax"> <rich:menuItem value="Edit" id="test_edit"></rich:menuItem> </rich:contextMenu>