1 Reply Latest reply on Mar 29, 2011 11:42 AM by pablo53

    <rich:dropTarget>'s dropListener is never fired...

    pablo53

      Hi,

       

      I developed a piece of xhtml like this:

       

      ...

      <h:form id="rootForm">
      <rich:dragIndicator id="ind007" draggingClass="dragging007" acceptClass="accept007" rejectClass="reject007">TEST</rich:dragIndicator>
      <a4j:outputPanel id="opane007" layout="block" ajaxRendered="true">
        <h:outputText value="*** TEST ***" />
        <rich:dragSource dragValue="#{projManager.hashCode}" type="dndtTEST" dragIndicator="ind007" />
      </a4j:outputPanel>
      <a4j:outputPanel id="opaneTrash" layout="block" ajaxRendered="true">
        <h:graphicImage url="/resources/images/kosz.gif" />
        <rich:dropTarget id="dropt007" acceptedTypes="dndtTEST" dropListener="#{projManager.lstnDnDRemoveWNP}" dropValue="#{projManager.hashCode}" />
      </a4j:outputPanel>
      ...
      </h:form>
      ...

       

      with a code behind (within projManager bean of ProjManager class):

       

      ...

      public void lstnDnDRemoveWNP(DropEvent e) {
      Object val = e.getDragValue();
      // TODO
      }
      ...

       

      Dragging & dropping the object in the right area results in sending request to server, but no action is taken (i.e. lstnDnDRemoveWNP is never called). Am I doing something wrong or is this a bug of RF 4.0.0 (snapshot as of Mar 22th  2011)?

       

       

      Regards,

       

        • 1. <rich:dropTarget>'s dropListener is never fired...
          pablo53

          Ok, I found it!

           

          Digging into the source code I came across a piece of code (doDecode mejhod in org.richfaces.renderkit.DropTargetRenderer class) that breaks a process if id property of the <rich:dragSource> tag is missing. After I added missing property everything started working properly.

           

           

           

          Regards,