(Quick Reference)

1 Introduction - Reference Documentation

Authors: groovyquan

Version: 0.5.1

1 Introduction

ZK UI plugin,the same as the ZKGrails plugin, seamlessly integrates ZK with Grails' infrastructures.

The difference is it uses the Grails' infrastructures more, such as gsp, controllers rather than zk's zul.

ZK UI Grails plug-ins brings powerful features as follows

1.1 Taglib

Use Tag Libraries
<z:window title="My First ZK UI Application" border="normal">
    Hello World!
</z:window>

1.2 Composer

Provides a Composer Artefacts simplify the integration between grails and zk

Usage:

grails create-composer [name]

1.3 Builder

A groovy way to create zk components, following groovy Builder paradigm

Controller

def index = {
    def window = new Window(title: "listbox demo", border: "normal")
    window << {
        listbox {
            listhead(sizable: true) {
                listheader(label: "name", sort: "auto")
                listheader(label: "gender", sort: "auto")
            }
            listitem {
                listcell(label: "Mary")
                listcell(label: "FEMALE")
            }
            listitem {
                listcell(label: "John")
                listcell(label: "MALE")
            }
            listitem {
                listcell(label: "Jane")
                listcell(label: "FEMALE")
            }
            listitem {
                listcell(label: "Henry")
                listcell(label: "MALE")
            }
            listfoot {
                listfooter {
                    label(value: "This is footer1")
                }
                listfooter {
                    label(value: "This is footer2")
                }
            }
        }
    }
    [window:window]
}

View

<z:render comp="${window}"/>

1.4 Selector

Provides a very convenient API for extracting and manipulating zk component, using the jquery-like methods.

View

<z:window id="window">
    <z:textbox name="t1" value="value1"/>
    <z:textbox id="t2" value="value2"/>
    <z:textbox value="value3"/>
</z:window>

Selector code

assert 3 == window.select("textbox").size()
assert "value2" == window.select("#t2")[0].value
assert "value1" == window.select("textbox[name='t1']")[0].value