ICEfaces
  1. ICEfaces
  2. ICE-5865

Add support for autoscroll inside a scrollable div while drag operation active in panelGroup

    Details

      Description

      I had the same error as vicky49.
      In my case I use a tree as an Explorer to cut and paste nodes with drag and drop.
      Example:
      <ice:panelGroup scrollHeight="500px" id="scroll_id">
      <ice:tree ...
      <ice:treeNode>
      ...
      <ice:panelGroup draggable="true"
      dropTarget="true"
      dropTargetScrollerId="scroll_id"
      ...
      >
      ...
      </ice:panelGroup>
      </ice:treeNode>
      </ice:tree>
      </ice:panelGroup>

      The tree is located, as shown above, in a Scrollable Div. The scroll bars will be shown, if the nodes are expanded. In order to drop a node in another unseen node you have to scroll the area. Actually you can only do it with the arrow keys. An autoscroll is not implemented.

      After copious research, I found the "scroll" attribute in the Draggable function in the script.aculo.us framework. This enables the auto scroll function using drag and drop. If a node is hovered over the bottom of the Scrollable Div, the area is automatically scrolled down.

      In order to add this feature, I changed the GroupRenderer.java and DragDrop.java class and used 'dropTargetScrollerId' as scroll id.
      I overloaded the DragDrop.addDragable and called them in the GroupRenderer as you can see in the following lines:

      String scrollid = (String) uiComponent.getAttributes().get("dropTargetScrollerId");
                  if (scrollid != null && scrollid.trim().length() > 0) {
                      calls += DragDrop.addDragable(uiComponent, uiComponent.getClientId(facesContext), handleId,
                              dragOptions, dragMask, facesContext);
                  } else {
                      calls += DragDrop.addDragable(uiComponent.getClientId(facesContext), handleId, dragOptions, dragMask,
                              facesContext);
                  }

      In the DragDrop class I get the correct part of the id:
      String scrollid = (String) uiComponent.getAttributes().get("dropTargetScrollerId");
              if (scrollid != null && scrollid.trim().length() > 0) {
                  UIComponent scroller = D2DViewHandler.findComponentInView(facesContext.getViewRoot(), scrollid);
                  if (scroller != null) {
                      scrollid = scroller.getClientId(facesContext);
                  }
              }

      And add the id as an attribute to the JavaScript function:
      if (scrollid != null && scrollid.trim().length() > 0) {
                  ea.add("scroll", scrollid);
              }

      Could you implement a similar feature in the next version, please?
      In version 2.0 it is also not implemented.

        Issue Links

          Activity

          Karl Kaminski created issue -
          Hide
          Bertrand Zermatten added a comment -

          Hi,
          Sorry to ask that but can you share your complete changed files please? I also need the autoscroll functionality.
          Thank you
          Bertrand

          Show
          Bertrand Zermatten added a comment - Hi, Sorry to ask that but can you share your complete changed files please? I also need the autoscroll functionality. Thank you Bertrand
          Arran Mccullough made changes -
          Field Original Value New Value
          Salesforce Case [5007000000DZzkR]
          Arran Mccullough made changes -
          Salesforce Case [5007000000DZzkR] [5007000000DZzkR, 5007000000GuzIk]
          Ken Fyten made changes -
          Fix Version/s EE-1.8.2.GA_P03 [ 10251 ]
          Fix Version/s EE-2.0.0.GA_P01 [ 10271 ]
          Fix Version/s 2.1 [ 10241 ]
          Assignee Priority P1
          Assignee Arturo Zambrano [ artzambrano ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #24685 Tue May 24 17:18:58 MDT 2011 art.zambrano ICE-5865 created branch
          Files Changed
          Commit graph ADD /icefaces/scratchpads/ICE-5865
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #24697 Wed May 25 15:55:38 MDT 2011 art.zambrano ICE-5865 removing branch... need to recreate using a previous revision
          Files Changed
          Commit graph DEL /icefaces/scratchpads/ICE-5865
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #24701 Wed May 25 16:03:03 MDT 2011 art.zambrano ICE-5865 recreated branch, using a previous revision (24605)
          Files Changed
          Commit graph ADD /icefaces/scratchpads/ICE-5865
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #24727 Mon May 30 16:42:53 MDT 2011 art.zambrano ICE-5865 removing branch (need to recreate, couldn't merge trunk)
          Files Changed
          Commit graph DEL /icefaces/scratchpads/ICE-5865
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #24728 Mon May 30 16:46:38 MDT 2011 art.zambrano ICE-5865 re-created branch
          Files Changed
          Commit graph ADD /icefaces/scratchpads/ICE-5865
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #24729 Mon May 30 17:34:23 MDT 2011 art.zambrano ICE-5865 prototype check-in
          Files Changed
          Commit graph MODIFY /icefaces/scratchpads/ICE-5865/core/src/com/icesoft/faces/context/effects/DragDrop.java
          Commit graph MODIFY /icefaces/scratchpads/ICE-5865/samples/component-showcase/common-web/WEB-INF/includes/examples/custom/tree.jspx
          Commit graph MODIFY /icefaces/scratchpads/ICE-5865/core/src/com/icesoft/faces/context/effects/CurrentStyle.java
          Commit graph MODIFY /icefaces/scratchpads/ICE-5865/component/src/com/icesoft/faces/component/ext/renderkit/GroupRenderer.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #24733 Tue May 31 15:17:56 MDT 2011 art.zambrano ICE-5865 committed to trunk
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/renderkit/GroupRenderer.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/effects/DragDrop.java
          Hide
          Arturo Zambrano added a comment -

          This feature was added but it's only supported for regular panelGroup's at the moment. It is not supported for panelGroup's inside trees nor for panelPositioned, as the implementation in these two cases is not straight-forward. These two cases will be addressed in ICE-6924 and ICE-6925, respectively.

          Show
          Arturo Zambrano added a comment - This feature was added but it's only supported for regular panelGroup's at the moment. It is not supported for panelGroup's inside trees nor for panelPositioned, as the implementation in these two cases is not straight-forward. These two cases will be addressed in ICE-6924 and ICE-6925 , respectively.
          Arturo Zambrano made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #24749 Wed Jun 01 16:30:05 MDT 2011 art.zambrano ICE-5865 fixed (2.0 maintenance branch)
          Files Changed
          Commit graph MODIFY /icefaces2/branches/icefaces-2.0.x-maintenance/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/renderkit/GroupRenderer.java
          Commit graph MODIFY /icefaces2/branches/icefaces-2.0.x-maintenance/icefaces/compat/core/src/main/java/com/icesoft/faces/context/effects/DragDrop.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #24750 Wed Jun 01 17:08:57 MDT 2011 art.zambrano ICE-5865 fixed (2.0 trunk)
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/compat/components/src/main/java/com/icesoft/faces/component/ext/renderkit/GroupRenderer.java
          Commit graph MODIFY /icefaces2/trunk/icefaces/compat/core/src/main/java/com/icesoft/faces/context/effects/DragDrop.java
          Ken Fyten made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Arturo Zambrano made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Link This issue depends on ICE-6913 [ ICE-6913 ]
          Ken Fyten made changes -
          Summary Autoscroll in scrollable div with drag and drop doesn´t work Add support for autoscroll inside a scrollable div while drag operation active in panelGroup
          Issue Type Bug [ 1 ] Improvement [ 4 ]
          Component/s Bridge [ 10011 ]
          Ken Fyten made changes -
          Fix Version/s 2.1-Beta [ 10291 ]
          Fix Version/s 2.1 [ 10241 ]
          Ken Fyten made changes -
          Fix Version/s 3.0 [ 10241 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Arturo Zambrano
              Reporter:
              Karl Kaminski
            • Votes:
              3 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: