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

Panelchildren fail to serialize in Panel

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 5.0.8
    • 5.0.7.1
    • Clustering
    • Security Level: Jimmy
    • None

      <zk>
      <zscript><![CDATA[
      import java.io.*;
      int cnt = 0;
      ]]></zscript>
      <vlayout id="vb">
      <panel id="panel">
      <panelchildren>
      <button label="is the same panelchildren?">
      <attribute name="onClick"><![CDATA[
      Component pl = self.getParent().getParent().getPanelchildren();
      alert(pl ", "(pl == self.parent));
      ]]></attribute>
      </button>
      </panelchildren>
      </panel>
      <button label="Clone div by Serialization">
      <attribute name="onClick"><![CDATA[
      ByteArrayOutputStream boa = new ByteArrayOutputStream();
      new ObjectOutputStream(boa).writeObject(panel);
      byte[] bs = boa.toByteArray();
      Object l = new ObjectInputStream(new ByteArrayInputStream(bs)).readObject();
      l.setId("dst" + ++cnt);
      vb.insertBefore(l, self);
      vb.insertBefore(new Label(bs.length+" bytes copied"), self);
      ]]></attribute>
      </button>
      </vlayout>
      </zk>

            SimonPai SimonPai
            jimmyshiau jimmyshiau
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: