0

How to render component to ZUL string (ZUML)?

asked 2012-01-10 11:17:12 +0800

szarza gravatar image szarza
72 3
http://balteus.blogspot.c...

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.

delete flag offensive retag edit

4 Replies

Sort by » oldest newest

answered 2012-02-06 11:38:40 +0800

jimmyshiau gravatar image jimmyshiau
4921 5
http://www.zkoss.org/ ZK Team

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

link publish delete flag offensive edit

answered 2012-02-07 23:51:05 +0800

szarza gravatar image szarza
72 3
http://balteus.blogspot.c...

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,

link publish delete flag offensive edit

answered 2012-02-08 12:12:06 +0800

cvarona gravatar image cvarona
554 1 6

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

link publish delete flag offensive edit

answered 2012-02-08 13:06:09 +0800

szarza gravatar image szarza
72 3
http://balteus.blogspot.c...

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

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2012-01-10 11:17:12 +0800

Seen: 174 times

Last updated: Feb 08 '12

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