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

Window setPosition() does not combine parameters corretly when used with parent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 9.6.2
    • Components
    • None

      Ticket update:

      position="parent" is expected to not be combinable with other positions.

      This is a special use case which is not explained in the Javadoc.

      Updated documentation link: https://www.zkoss.org/wiki/ZK_Component_Reference/Containers/Window#Position

       

       

      Original ticket below

      Steps to Reproduce

       

      According to the javadoc of Window it is possible to specify the position of the Window based on a combination of values e.g. "left,center'.

      https://www.zkoss.org/javadoc/8.0.0/zk/org/zkoss/zul/Window.html#setPosition(java.lang.String)

      However it is impossible to define the position inside the parent element.

      As you can try in the fiddle (https://zkfiddle.org/sample/3phlhus/2-Center-Window-in-Parent#source-2) you can either specify "parent" which places the window in the top left corner of the parent element or "center" which places it in the middle. But the combination to center it inside the parent component does not work "parent,center".

       

      Window win = new Window();
      win.setTitle("Should be centered in parent");
      win.setParent(container);
      win.setPosition("parent,center");
      win.doPopup();

       

      Current Result

      The combination "parent,center" to center it inside the parent component does not work.

      Expected Result

      Window component should be correctly centered inside the parent component.

      Debug Information

       

      Workaround

       

            Unassigned Unassigned
            christian christian
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: