0 Replies Latest reply on Aug 14, 2007 6:46 AM by Jim Dummy

    Can't make dragIndicator work...

    Jim Dummy Newbie

      Hello!
      I tried many ways just to show an image icon while I drag... No luck :-(

      My environment:
      JBoss 3.2, JSF 1.2-RI, RichFaces 3.01
      The drag and drop works, but it shows default indicator (empty square).
      It looks like it can't find it... (?)
      Another thing is that it is shown UNDER the tab in FF 2 and Opera 9
      In example to point to indicator id there is a ":" separator sometimes (sometimes not). What is it? Should I use just a name as is or calculate the whole path from the root ("form:a:b:c:... indicator")

      In some examples there is a facets "single" in another "default" another suggest to use macro... I'm lost...

      Here is my last version (it works, but no icon).

      <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

      <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
      <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

      <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>

      <f:subview id="retrival_page">
      <rich:dragIndicator id="indicator">
      <f:facet name="default">
      <h:graphicImage value="/img/upload.gif"/>
      </f:facet>
      </rich:dragIndicator>
      <%--
      <f:facet name="single">
      <h:graphicImage value="/img/upload.gif"/>
      </f:facet>

      <rich:dndParam name="reject">
      <h:graphicImage value="/images/reject.png" />
      </rich:dndParam>

      <rich:dndParam name="accept">
      <h:graphicImage value="/img/upload.gif" />
      </rich:dndParam>


      <h:graphicImage value="/img/upload.gif"/>

      </rich:dragIndicator>
      --%>



      <rich:panelBar width="100" height="500">
      <rich:panelBarItem label="Database id">
      <h:dataTable id="starts" value="#{WorkflowForm.startParams}" var="in" >
      <h:column>
      <a4j:outputPanel style="border:1px solid gray; padding:2px;" layout="block">
      <rich:dragSupport dragIndicator="indicator" dragType="inputz">
      <a4j:actionparam name="input_name" value="#{in.name}"/>
      </rich:dragSupport>
      <h:outputText value="#{in.name}"/>
      </a4j:outputPanel>
      </h:column>
      </h:dataTable>
      </rich:panelBarItem>
      <rich:panelBarItem label="Sequences">
      Sequence
      </rich:panelBarItem>
      </rich:panelBar>


      <a4j:outputPanel style="width: 100%; height: 100%; border: 1px solid blue;" layout="block">
      <rich:dropSupport
      dropListener="#{WorkflowForm.dropInput}"
      acceptedTypes="inputz"
      reRender="inputs">
      </rich:dropSupport>
      <h:dataTable id="inputs" value="#{WorkflowForm.inputParams}" var="in" style="height: 100%; border: thin solid gray; padding: 2px 2px 2px 2px">
      <h:column>
      <h:outputText value="#{in.name}"/>
      </h:column>
      </h:dataTable>
      </a4j:outputPanel>



      </f:subview>