ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

How to render component to ZUL string (ZUML)?

szarza
10 Jan 2012 11:17:12 GMT
10 Jan 2012 11:17:12 GMT

Hello:
I want to load a zul page, manage it dynamically (remove, change attributes, reorder components...) and save updates on file. I can use Executions.createComponents* for load... but for render/saving?

Any ideas? Thanks.

jimmyshiau
6 Feb 2012 11:38:40 GMT
6 Feb 2012 11:38:40 GMT

Hi szarza,
You can store the status into DB, and restore the status from DB.

szarza
7 Feb 2012 23:51:05 GMT
7 Feb 2012 23:51:05 GMT

Thank you, but my question is not about where to save the state, but to get zul code from zul objects. For example, if I have a label l, a Button b and a Textbox t in a Window and is modified by l.setValue l ("new label"). How do you get, from these instances, the code "<label value="new label><button ...><textbox ...>"?

Regards,

cvarona
8 Feb 2012 12:12:06 GMT
8 Feb 2012 12:12:06 GMT

I think you're asking for a zul serializer; I'm currently needing something very similar. To the best of my knowledge zk does not include such an utility, and unfortunately there is no way to fully serialize any given component. Just think about it: what abound bound beans? bound variables? list models?

I've managed to write a simple serializer that manages "simple" components (input boxes, checkboxes, structural components, containers...) and that could be easily expanded to take into account non-model listboxes, trees and the like. However I don't think it's very practical, but for very specific purposes.

With kind regards

César Varona

szarza
8 Feb 2012 13:06:09 GMT
8 Feb 2012 13:06:09 GMT

You're absolutely right, César. Indeed, that's just what I'm looking for. I'm working in an application where user can create and modify components on the fly and then serialize to a .zul file.

Regards,

Samuel