-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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>...
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.
Asked: 2013-03-11 02:02:35 +0800
Seen: 26 times
Last updated: Mar 11 '13
composite component help [closed]
EL in a forEach @command not working?
Different template for each grid row
Cardlayout animation is broken
Grid RowRender slow using 6.5.1 and sizable=true
setVisible(false), component will load or not
Decimalbox and doublebox value rounded on iPad
history management with page status