3 Replies Latest reply on May 28, 2007 1:54 PM by Nick Belaevski

    DnD bug when using multiple accepted types

    Janne Holm Newbie


      I think I found a bug in org.richfaces.renderkit.DnDEventsExchangeMailer.

      The line 134 looks like this:

      DnDValidator.validateAcceptTypes(facesContext, draggable, dropzone, acceptedTypes, dragType);

      but when taking a look at the DnDValidator code, there's

      static void validateAcceptTypes(FacesContext context, Draggable draggable, Dropzone dropzone, Object dragType, Object acceptedTypes) {

      When looking closely, the dragType and acceptedTypes are in wrong order in the DnDEventsExchangeMailer.

      This makes the method validateAcceptTypes() function correctly when there's only one acceptedType, but when using multiple types, the method does not function correctly. Instead this kind or error messages are shown:

      Dropzone [theForm:restrictions:_id560] with accepted types [removeDependency] cannot accept Draggable [theForm:restrictions:_id571:0:_id576] with dragType [removeDependency, removeExclusion]

      Even the error message shows that dragType and accepted types are in wrong order ("accepted type [removeDependency]" and "with dragType [removeDependency, removeExclusion]" when dragType should only contain one element and acceptedTypes should contain the list of types)

      What I am trying to accomplish is that I have three lists of elements, each list being inside a rich:panel. Let's call them lists A, B and C. I want to be able to drag elements in this way:

      from A to B
      from A to C
      from B to A
      from C to A
      NOT from B to C
      NOT from C to B

      - Janne