2 Replies Latest reply on Dec 6, 2007 2:52 AM by Matthias Graehn

    Drag-Drop problem

    Matthias Graehn Newbie


      Modified the drag-n-drop example from the demo a bit and the following question occured:

      How do I find out the drag source (dataTable or panel is or any string) if I drag a panel around?

      I tried to use the actionParameter tag but it is called after the drop event so it will not work this way.
      Every panel should support both drag and drop. I want to put back an element from php stack back
      to the first panel and it should be possible to drop each item into any of the panels. So I need to know
      where the item comes from to remove it from the list.

      <rich:panel styleClass="dropTargetPanel">
       <f:facet name="header">
       <h:outputText value="PHP Frameworks" />
       <rich:dropSupport id="php" acceptedTypes="PHP,CF,DNET" dropValue="PHP"
       dropListener="#{eventBean.processDrop}" reRender="phptable, src">
       <h:dataTable id="phptable" columns="1" value="#{dndBean.containerPHP}" var="fm">
       <a4j:outputPanel style="border:1px solid gray;padding:2px;" layout="block">
       <rich:dragSupport dragType="#{fm.family}" dragValue="#{fm}">
       <rich:dndParam name="label" value="#{fm.name}" />
       <a4j:actionparam name="source" value="PHP-STACK" assignTo="#{dndBean.source}"/>
       <h:outputText value="#{fm.name}"></h:outputText>

      I suppose the solution is quite easy but I do not know how. The setter of the source property
      is called after the processDrop method is called.

      Thanks for every help