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

Portallayout get wrong position when using Executions.createComponents to create panels

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 5.0.11, 6.0.1
    • 5.0.10
    • Components
    • Security Level: Jimmy

      1. Drag panel2 above panel1
      2. position of panel1 should be (0,1), but get (0,0).

      index.zul
      <zk>
      	<zscript><![CDATA[
      		Panel panel1;
      		Panel panel2;
      		void init() {
      			panel1 = createPanel("panel1", "Panel 1");
      			panel2 = createPanel("panel2", "Panel 2");
      			myptl.setPanel(panel1, 0, 0);
      			myptl.setPanel(panel2, 0, 1);
      		}
      		Panel createPanel( String id, String title ) {
      			Panel panel = (Panel) Executions.createComponents("panel.zul", null, null);
      			panel.setId(id);
      			panel.setTitle(title);
      			return panel;
      		}
      	]]></zscript>
      	Position of Panel 1: <label id="lbl" />
      	<portallayout id="myptl" maximizedMode="whole" width="100%">
      		<attribute name="onCreate"><![CDATA[
      			init();
      		]]></attribute>
      		<attribute name="onPortalMove"><![CDATA[
      			int[] position = self.getPosition(panel1);
      			lbl.setValue(position[0] + "," + position[1]);
      		]]></attribute>
      		<portalchildren id="portalchild1" width="50%">
      		</portalchildren>
      	</portallayout>
      </zk>
      
      panel.zul
      <zk>
      	<panel height="300px" border="normal" style="padding-bottom: 10px; padding-right: 10px;">
      		<panelchildren>
      			<label />
      		</panelchildren>
      	</panel>
      </zk>
      

            TonyQ TonyQ
            vincentjian vincentjian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: