1 Reply Latest reply on Feb 2, 2011 4:40 AM by Ilya Shaikovsky

    Drag-And-Drop to rich:dataTable

    Peter Schütt Newbie

      Hallo,

      I have a problem with Drag-And-Drop to rich:dataTable.

       

      ...

      <a4j:outputPanel ajaxRendered="true">

                          <rich:dragSource type="myType"

                                           dragValue="#{rolesBean.userGroupSelectedId}" />

                          <h:outputText id="userGroupSelection" style="vertical-align:middle;border-width:thin;border-style:solid"

                 value="#{rolesBean.userGroupSelectedId}"/>

      </a4j:outputPanel>

      ....

      <rich:dataTable value="#{rolesBean.roleList}" var="role" id="rolesTable">

                      <rich:column sortable="false" label="#{roles.name}" id="roleNameColumn">

                          <f:facet name="header">

                              <h:outputText value="#{roles.name}" />

                          </f:facet>

                          <rich:inplaceInput id="roleNameInput" value="#{role.name}" disabled="#{!role.nameChangable}" render="roleNameInput" immediate="true"/>

                      </rich:column>

      ...

                      <rich:column sortable="false" label="#{roles.assigned}" id="roleAssignedColumn">

                          <f:facet name="header">

                              <h:outputText value="#{roles.assigned}" />

                          </f:facet>

                          <rich:dropTarget acceptedTypes="userGroup,groupUser" dropValue="#{role.name}"

                                           dropListener="#{rolesBean.dropListener}" render="rolesTable,roleMenu">

                          </rich:dropTarget>

      ....

                      </rich:column>

      ...

                  </rich:dataTable>

       

       

          public void dropListener(DropEvent dropEvent)

          {

              String myValue = (String)dropEvent.getDragValue();

              if (myValue == null)

              {

                  return;

              }

              String roleName = (String)dropEvent.getDropValue();

                ...

        }

       

      The dropListener is called for every line in the table if I try to drag-and-drop.

       

      dropEvent.dragSource == null

      dropEvent.dropTarget == null

      dragValue == expected value

      dropValue == iterated through all lines of the table

       

      Thanks for any hint.

       

      Ciao

        Peter Schütt