-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
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)"/>
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,
Darksu
Asked: 2014-08-04 19:39:52 +0800
Seen: 16 times
Last updated: Sep 26 '14