This content has been marked as final.
Show 3 replies
-
1. Re: Asking for help on rich:contextMenu & rich:componentCont
nbelaevski Oct 22, 2008 9:14 AM (in response to stefand)Hi,
1. Can you please post page code you use for DnD so we can check?
2. String parameters should be enough to customize menu as you wish. E.g. use style="display: {itemDisplay}" with 'block' and 'none' values to show/hide some items.
3. You can show contextMenu using JavaScript:document.getElementById('form:menuId').component.show(event, {})
UseEvent.element(event)
prototype.js function to obtain element that fired event. -
2. Re: Asking for help on rich:contextMenu & rich:componentCont
stefand Oct 23, 2008 3:49 PM (in response to stefand)Thanks for the feedback. I have attached the DnD code below (stripped to the bare essentials).
Apart from that version, I have also tried to move the menu out of the enclosing rich:dragSupport and instead attachTo the draggable item in the dataTable, but the result is the same: When I select an action from the context menu, I find myself dragging the item that the menu is attached to."nbelaevski" wrote:
Hi,
1. Can you please post page code you use for DnD so we can check?<h:form> <rich:panel> <rich:dropSupport id="dropZone" acceptedTypes="#{myBean.acceptedTypes}" dropListener="#{myBean.drop}"> </rich:dropSupport> <rich:dataTable id="myDataTable" value="#{myBean.tableContent}" rows="10" var="f"> <h:column> <rich:dragSupport dragType="#{f.dragType}" dragValue="#{f}" dragIndicator=":indicator"> <rich:dndParam name="label" value="#{f.label}"/> <a4j:outputPanel rendered="#{myBean.renderCondition}"> <a4j:commandLink action="#{myBean.selectAction(f)}" value="#{f.label}"> </a4j:commandLink> <!-- CONTEXT MENU --> <rich:contextMenu id="myContextMenu" hideDelay="0" event="oncontextmenu" submitMode="ajax"> <rich:menuItem action="#{myBean.menuActionOne(f)}" value="Action ONE"> </rich:menuItem> <rich:menuItem action="#{myBean.menuActionTwo(f)}" value="Action TWO"> </rich:menuItem> </rich:contextMenu> </a4j:outputPanel> </rich:dragSupport> </h:column> </rich:dataTable> </rich:panel> </h:form>
Stefan -
3. Re: Asking for help on rich:contextMenu & rich:componentCont
ilya_shaikovsky Oct 24, 2008 5:42 AM (in response to stefand)<rich:column> <f:facet name="header"> Make </f:facet> <a4j:outputPanel id="draggable"> <rich:dragSupport dragType="tye" dragIndicator=":indicator"></rich:dragSupport> <h:outputText value="#{car.make}"/> <rich:contextMenu event="oncontextmenu"> <rich:menuItem value="123123" onmousedown="Event.stop(event)"></rich:menuItem> </rich:contextMenu> </a4j:outputPanel> </rich:column>
this seems works as you need. You could drag the item but the drag will be disabled within menu.