create componant from raw content specified into zull

asked 2014-08-04 19:39:52 +0800

elmetni gravatar image elmetni
145 7

updated 2014-08-05 18:17:31 +0800

Hello everyone

i m working on a ZK project using hibernate , what i want to do is read a String from my database like

MyString =  "<Label value=\"something\"></label> <a href=\"something.zul\" label=\"a link\"></>"

and use this String to create LABEL and A directly into my zul

like Execution.createComponentsDirectly but i dont want to use a controler just for this one , is there a componant that can take raw content specification (String) and create my componant based on that string ?

i dont know if this possible in ZK , if it s , please provide me with a MVVM example for it , and thank you so much

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted

answered 2014-09-26 02:24:21 +0800

hawk gravatar image hawk
3185 1 5
http://hawkphoenix.blogsp... ZK Team

updated 2014-09-26 05:36:26 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8

The one of the ways to create components dynamically in MVVM is to bind Include component's src.

You may write raw string into a zul file first, e.g. content.zul, then change a include component src to that file

<include src="@load(vm.contentZul)"/>
link publish delete flag offensive edit


yea that s exactly what i want :) , thx

elmetni ( 2014-09-26 14:21:59 +0800 )edit

answered 2014-08-09 15:37:37 +0800

Darksu gravatar image Darksu
1991 1 4

updated 2014-09-26 05:36:49 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8

Hello elmetni,

If I may suggest, you could create a label component in your zul page and in the controller and set visible = false.

Then you will read your string from the database, and will perform a small string processing by using specific tags such as value, href, etc.

Finally you will set in the controller the label's properties using the sub-string elements that where obtained.

This can also be applied using various sources such as jason, or a simple text file.

Best Regards,


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

1 follower



Asked: 2014-08-04 19:39:52 +0800

Seen: 16 times

Last updated: Sep 26 '14

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