8 Replies Latest reply on Dec 1, 2008 8:24 AM by Ilya Shaikovsky

    ContextMenu + Drag'n'Drop

    eklam Newbie

      Hi,

      I am using a contextMenu in the same component I use a drag and drop support, when I click in a menuItem, the action is performed correctly but the dragSupport gets automatically active, (as if I am dragging it...)

      Could you understand my problem, may I am doing something wrong?

      <h:panelGrid id="arq" style="width:75px; height:75px" columns="1">
       <a4j:outputPanel layout="block">
      
       <!-- Informações de cada arquivo -->
       <a4j:mediaOutput element="img" mimeType="image/jpeg"
       createContent="#{funcoes.paint}" value="#{item}"
       style="width:70px; height:70px;" />
       <h:outputText value="#{item.titulo}" />
       <rich:contextMenu event="oncontextmenu" attachTo="arq" submitMode="ajax">
       <rich:menuItem id="abrirPasta" value="Abrir" reRender="arquivos" action="#{arquivoMB.abrirPasta}" ajaxSingle="true">
       <a4j:actionparam name="idPasta" value="#{item.id}" />
       </rich:menuItem>
       <rich:menuItem id="exluirArquivo" value="Exluir" reRender="arquivos" action="#{arquivoMB.exluirArquivo}" ajaxSingle="true">
       <a4j:actionparam name="idArquivo" value="#{item.id}" />
       </rich:menuItem>
       </rich:contextMenu>
      
       <rich:dragSupport
       dragIndicator=":indicatorArquivo"
       dragType="iarquivo"
       dragListener="#{arquivoMB.processDragArquivo}">
       <rich:dndParam name="label" value="#{item.titulo}" />
       <a4j:actionparam value="#{item.id}" name="draggedArquivoId"/>
       </rich:dragSupport>
      
       <rich:dropSupport
       id="dropSupportArquivo"
       acceptedTypes="#{item.tipoAceito}"
       dropListener="#{arquivoMB.processDropArquivo}"
       reRender="gridArquivos">
       <a4j:actionparam value="#{item.id}" name="droppedPastaId"/>
       </rich:dropSupport>
      
       </a4j:outputPanel>
       </h:panelGrid>


      Thanks!