0

how do I get zul source code?

asked 2013-03-11 02:02:35 +0800

sydd gravatar image sydd
63 1

updated 2013-03-11 04:05:29 +0800

I am generating a Zul Grid in Java. I would like to get the Zul source code for it so that I can pass it to another application.(Edit: The application is an iPad app that will parse the Zul XML into a set of data). Does anyone know how to do this? The object that I am trying to transform into Zul source code is:

    Window window = new Window();
    Grid grid = new Grid();
    grid.setParent(window);
    Columns columns = new Columns();
    Column column1 = new Column();
    column1.setLabel("Column Header");
    column1.setParent( columns);
    columns.setParent(grid);
    Rows rows = new Rows();
    rows.setParent(grid);
    Row row1 = new Row();
    row1.setParent(rows);
    Label label1 = new Label();
    label1.setParent(row1);
    label1.setValue("Label");

I tried to serialize the code into XML using XStream

    XStream xstream = new XStream();
    String xml = xstream.toXML(window);

but ended with something like the following useless piece of code:

<__auxinf> <__annots class="linked-hash-map"> ZKBIND <__name>ZKBIND <__attrs class="linked-hash-map"> RENDERER rowRenderer:org.zkoss.bind.impl.BindRowRenderer <__loc class="org.zkoss.xml.Locators$Loc"> <__path>jar:file:...lang-addon.xml <__lnno>498 model ZKBIND <__name>ZKBIND <__attrs class="linked-hash-map">...

What I would like to get is something like:

   <grid>
        <auxhead>
            <auxheader colspan="4" label="Contributor of ZK International Message(Part)" />
        </auxhead>
        <columns>
            <column hflex="5">Language</column>
            <column hflex="6">Contributor</column>
            <column hflex="3">Charset</column>
            <column hflex="4">Comment</column>
        </columns>
        <rows sclass="narrow">
            <row>
                <label value="Arabic (ar)" />
                <label value="Ayman Elgharabawy" />
                <label value="iso-8859-6" />
                <textbox />
            </row>...
delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-03-11 03:47:39 +0800

rdgrimes gravatar image rdgrimes
735 7

updated 2013-03-11 03:49:13 +0800

To be honest, I haven't done what you're trying to do. But, I would approach it from a different perspective. What it sounds like you're attempting to do might be better done via clustering. It seems to me that it would make a lot more sense to set up clustering so that all participating nodes are aware of each other's session data. See link. Once this is accomplished, you should be able to pass the Grid, or any other component, via a session attribute.

It's one option anyway. As part of this, or as an alternative, you might want to do something like this, wherein you define a custom scope for an event queue. Scroll down to "Extend Event Queue" section at given link.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2013-03-11 02:02:35 +0800

Seen: 26 times

Last updated: Mar 11 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More