Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1997

Portallayout drag&drop element to the same position. onPortalMove event provided with wrong data

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 6.5.5
    • 6.5.4
    • None
    • None

      Steps to recreate:
      1. Go to the ZK Drag and Drop demo at http://www.zkoss.org/zkdemo/layout/portal_layout
      2. Put all portal elements into first column (this step is not mandatory)
      2. Make page refresh (f5) to see that the portal view is recreated properly through session
      3. Drag first portal element and drop it to the location it was dragged from (first position)
      4. The view is rendered properly (nothing changes) ,but in onPortalMove event that is handled in method
      @Listen("onPortalMove = #portalLayout")
      public void saveStatus() {
      int i = 0;
      for (Component portalChild : portalLayout.getChildren())

      { List<String> portletIds = new ArrayList<String>(); for (Component portlet : portalChild.getChildren()) portletIds.add(portlet.getId()); Executions.getCurrent().getSession().setAttribute("PortalChildren" + i++, portletIds); }

      }
      the portalLayoutChildren elements (portalLayout.getChildren()) are passed in wrong order -> the dragged element is on the second position in the list, like it was moved one position down.
      This wrong state is saved in session
      5. Now refresh the page (f5) and you will notice that the portallayout view recreated from the session state has changed (the first element is moved to the second position although it shouldn't)

            jumperchen jumperchen
            krzysztofgenge krzysztofgenge
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: