Gabe Hicks, the author of this article has put together a Groovy builder for ZK after uncovering the inconvenience of integrating ZK with Grails. Read the article
to see how to build efficient Groovy on ZK with the aid of Groovy builder!
1.All the basic Zul and Zhtml elements as of 3.52 (Not all tested yet). Where there is a namespace collision, prefix html on zhtml elements to get the html version: htmlLabel or htmlDiv.
2.The first string argument to any builder is the components id. The component can be accessed by that id from that point on in the builders. See the use of actionBox in the onClick handler.
3.Properties of the component / object are set using the Groovy map syntax as an argument to its method call: listbox(visible: false)
4.The component / object produced by the builder is available as the argument to its closure. This allows for more complex initialization of an object than attributes alone will allow.
5.The event listener creation syntax allows access to all components / object created with ids. It also has a builder that produces components that are not set to the parent object. This allows you to create components in event listeners that can be attached to any id based component and not just the parent.
6.Event listeners can also be assigned through the map syntax. If these events are not closures they have to use the standard ZK way to access other components.