O'Reilly logo

ZK Developer's Guide by Markus Stauble, Hans-Jurgen Schumacher, Jurgen Schumacher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Macro Components

Beyond the possibility of customizing existing components with the help of CSS files, it's also possible to create new components based on existing ones. In our sample login page, we used a label followed by a textbox component. Now we will replace that component with a component that has a label, and a textbox.

<specialLabel value="${labelPassword}" />
<a:bind value="user.password" />
<textbox type="password" id="password" constraint="no empty"/>

Now we start creating a macro component, and use that component in the page. The interesting thing about the macro component itself is the usage of annotation-based data binding in the macro component.

The first step is to create the macro ZUL file.

<zk xmlns="http://www.zkoss.org/2005/zul" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required