0 Replies Latest reply on Feb 6, 2008 6:04 AM by venkata reddy

    Facing render problem using drop:support........

    venkata reddy Newbie

      Hi.....
      I am trying to do Drag and Drop in a rich:dataGrid and displaying the data from an array...and here we are taking the Dragged and Dropped index from the array and removing the data at Dragged index and Adding data Dropped index in the array..
      but here upto this it is fine but after changed in the array it have to render but it is not rendering the data..whichever we changed..

      What is the problem i am unable to trace could any body trace it out....pls..

      the Code:
      public void moveFramework(Object drag, Object drop)
      {
      int ind1=0;
      int ind=0;
      try
      {
      int x,y,z;
      for(int i=0;i<frameworks.size();i++)
      {
      x=frameworks.get(i).getId();
      y=((Users) drag).getId();
      z=((Users) drop).getId();
      if(x==y)
      {
      ind1 = i;
      }
      if(x==z)
      {
      ind=i;
      }
      }
      frameworks.remove(ind1);
      frameworks.add(ind,(Users) drag);
      setFrameworks(frameworks);
      }

      this is moving the data dragged to dropped location....

      and the below code related to UI

      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:s="http://jboss.com/products/seam/taglib"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j"
      template="layout/template.xhtml">
      <ui:define name="body">
      <rich:dragIndicator id="indicator" />
      <a4j:form id="form">
      <rich:dataGrid value="#{dBean.frameworks}" var="fm" id="out" columns="#{dBean.frameworks.size()}" elements="3">
      <a4j:outputPanel layout="block" style="cursor: move">
      <rich:dragSupport dragIndicator=":indicator" dragType="value" dragValue="#{fm}">
      <rich:dndParam name="label" value="#{fm.firstName}" />
      </rich:dragSupport>
      <h:panelGrid>
      <h:outputText value="#{fm.id}"></h:outputText>

      <h:outputText value="#{fm.organization.id}"></h:outputText>

      <h:outputText value="#{fm.userId}"></h:outputText>

      <h:outputText value="#{fm.firstName}"></h:outputText>

      <h:outputText value="#{fm.lastName}"></h:outputText>

      <h:outputText value="#{fm.emailId}"></h:outputText>

      <h:outputText value="#{fm.active}"></h:outputText>

      <h:outputText value="#{fm.userType}"></h:outputText>

      <h:outputText value="#{fm.lastLoginDate}">
      <f:convertDateTime dateStyle="short"/>
      </h:outputText>

      <h:outputText value="#{fm.createdBy}"></h:outputText>

      <h:outputText value="#{fm.createdDate}">
      <f:convertDateTime dateStyle="short"/>
      </h:outputText>

      <h:outputText value="#{fm.modifiedBy}"></h:outputText>

      <h:outputText value="#{fm.modifiedDate}">
      <f:convertDateTime dateStyle="short"/>
      </h:outputText>
      </h:panelGrid>
      <rich:dropSupport acceptedTypes="value" dropValue="#{fm}" dropListener="#{EBean.processDrop}">
      <a4j:support event="oncomplete" reRender="out"></a4j:support>
      </rich:dropSupport>
      <rich:panel id="Hii" rendered="#{dBean.test}">
      <h:outputText value="Check for Render"></h:outputText>
      </rich:panel>
      </a4j:outputPanel>
      </rich:dataGrid>
      </a4j:form>
      </ui:define>
      </ui:composition>

      thanks in advance.....