5 Replies Latest reply on May 15, 2009 6:55 AM by ilya_shaikovsky

    Dragsupport on scrolled DIV has wrong position

      When using a HtmlDragsupport on a Scrolled Div the position of the dragger is not right. I can reproduce this with the following code.

      HtmlAjaxOutputPanel panel = new HtmlAjaxOutputPanel();
      HtmlPanelGrid grid = new HtmlPanelGrid();
      grid.setColumns(20);

      panel.setId("gp");
      panel.setLayout("block");
      panel.setStyle("width: 500px; height: 200px; overflow: auto; border: 1px solid red;");

      for(int i =0; i<20; i++){
      HtmlAjaxOutputPanel resizepanel = new HtmlAjaxOutputPanel();
      resizepanel.setLayout("block");
      resizepanel.setStyle("height: 100px; width: 35px; cursor: e-resize; background-color: yellow;");
      HtmlDragSupport dragger = new HtmlDragSupport();
      dragger.setDragType("item");
      resizepanel.getChildren().add(dragger);
      grid.getChildren().add(resizepanel);
      }
      panel.getChildren().add(grid);
      this.getChildren().add(panel);

      To reproduce the problem, scroll the div all the way to the right and then drag one of the yellow blocks, you will see that the dragger has the wrong position on the screen. I hope you can fix this.

      Thx in advance.

        • 1. Re: Dragsupport on scrolled DIV has wrong position
          ilya_shaikovsky

          Seems can't reproduce at 3.3.1 snapshot. Could you check please?

          • 2. Re: Dragsupport on scrolled DIV has wrong position

            It is reproducable in 3.3.1 CR1 scroll the div to the right and drag the yellow blocks

            • 3. Re: Dragsupport on scrolled DIV has wrong position
              ilya_shaikovsky

              I'm using not CR1 but some more latest snapshot.. But actually it seems for me should be no difference.. Checked within FF3, IE and opera. Still can't confirm. I've scrolled the container both using vertical and horizontal scrolls and see the indicator under cursor.

              • 4. Re: Dragsupport on scrolled DIV has wrong position

                I still have problems with dragcomponents on a scrolled div, it can also be reproduced by the following code.

                <a4j:outputPanel id= "mainPanel" layout="block" style="height: 90px; width: 500px; overflow: auto;">
                <h:panelGrid columns="25">
                <a4j:outputPanel layout="block" style="width: 30px; height: 40px; background-color: yellow; padding: 10px;"><rich:dragSupport dragType="item"></rich:dragSupport></a4j:outputPanel>
                <a4j:outputPanel layout="block" style="width: 30px; height: 40px; background-color: yellow; padding: 10px;"><rich:dragSupport dragType="item"></rich:dragSupport></a4j:outputPanel>
                <a4j:outputPanel layout="block" style="width: 30px; height: 40px; background-color: yellow; padding: 10px;"><rich:dragSupport dragType="item"></rich:dragSupport></a4j:outputPanel>
                <a4j:outputPanel layout="block" style="width: 30px; height: 40px; background-color: yellow; padding: 10px;"><rich:dragSupport dragType="item"></rich:dragSupport></a4j:outputPanel>
                <a4j:outputPanel layout="block" style="width: 30px; height: 40px; background-color: yellow; padding: 10px;"><rich:dragSupport dragType="item"></rich:dragSupport></a4j:outputPanel>
                <a4j:outputPanel layout="block" style="width: 30px; height: 40px; background-color: yellow; padding: 10px;"><rich:dragSupport dragType="item"></rich:dragSupport></a4j:outputPanel>
                <a4j:outputPanel layout="block" style="width: 30px; height: 40px; background-color: yellow; padding: 10px;"><rich:dragSupport dragType="item"></rich:dragSupport></a4j:outputPanel>
                <a4j:outputPanel layout="block" style="width: 30px; height: 40px; background-color: yellow; padding: 10px;"><rich:dragSupport dragType="item"></rich:dragSupport></a4j:outputPanel>
                <a4j:outputPanel layout="block" style="width: 30px; height: 40px; background-color: yellow; padding: 10px;"><rich:dragSupport dragType="item"></rich:dragSupport></a4j:outputPanel>
                <a4j:outputPanel layout="block" style="width: 30px; height: 40px; background-color: yellow; padding: 10px;"><rich:dragSupport dragType="item"></rich:dragSupport></a4j:outputPanel>
                <a4j:outputPanel layout="block" style="width: 30px; height: 40px; background-color: yellow; padding: 10px;"><rich:dragSupport dragType="item"></rich:dragSupport></a4j:outputPanel>
                <a4j:outputPanel layout="block" style="width: 30px; height: 40px; background-color: yellow; padding: 10px;"><rich:dragSupport dragType="item"></rich:dragSupport></a4j:outputPanel>
                </h:panelGrid>
                </a4j:outputPanel>

                • 5. Re: Dragsupport on scrolled DIV has wrong position
                  ilya_shaikovsky

                  yup.. could see this with your code. strange because used almost the same.. :)

                  https://jira.jboss.org/jira/browse/RF-7156

                  thanks!