0 Replies Latest reply on Jul 8, 2008 2:12 PM by aleqi200

    DropEvent doesn´t return a value

    aleqi200

      I hava the following code for the dropZone:

      //ommited
      <rich:treeNode type="tarefa" id="treeNode">
       <rich:dropSupport id="dropTarefas" acceptedTypes="user" dropValue="TAREFA" dropListener="#{tarefaController.processDrop}">
       <a4j:support id="suport" action="#{tarefaController.saveAfterDrop}" event="ondrop" >
       <f:setPropertyActionListener value="#{item.tarefa}" target="#{tarefaController.tarefa}" />
       </a4j:support>
       </rich:dropSupport>
      //ommited
      


      And for the dragValue the following:

      <rich:dataList value="#{usuarioController.usuarios}" var="user">
       <a4j:outputPanel layout="block">
       <rich:dragSupport id="dragPerson" dragIndicator=":indicator" dragValue="#{user}" dragType="user">
       <rich:dndParam name="label" value="#{user.nome}" type="drag">
       </rich:dndParam>
       </rich:dragSupport>
       <h:outputText value="#{user.nome}"/><h:outputText value=" - " />
       <h:outputText styleClass="bold" value="#{i18n.lblCargo} :"/> <h:outputText value="#{user.cargo}"/>
       </a4j:outputPanel>
       </rich:dataList>
      


      The problem is, when the dropEvent happens, the dragValeu obtainned by the ManagedBean is null, as I present now

      public void processDrop(DropEvent event) {
       Object dragValue = event.getDragValue();
       if(dragValue instanceof Usuario){
       System.out.println("setted");
       setToAssociate((Usuario) dragValue);
       }
       System.out.println("Droped");
       }
       public void saveAfterDrop(){
       System.out.println("gone");
       }
      

      Is there any idea for what is happening.

      Thanks.

      ---------------------------------------
      Alexandre - Software Developer
      ----------------------------------------