Macro Component

From Documentation
Revision as of 07:14, 8 November 2010 by Tomyeh (talk | contribs)

There are two ways to implement a component. One is to implement a component in a Java class, extending from other component or one of skeletal implementations, with an optional JavaScript class. It is flexible and, technically, able to implement any functionality you wants. For more information please refer to ZK Component Development Essentials.

On the other hand, we could implement a new component by using the others and composing them in a ZUML page. In other words, we define a new component by expressing it in a ZUML page. It works like composition, macro expansion, or inline replacement.

For sake of convenience, we call the first type of components as primitive components, while the second type as macro components. In this section we will discuss the details about how to implement a macro component and how to use it.


There is a similar concept called composite components. It is more a way to utilize ZK rather than a feature. For more information please refer to the Composite Component section.

Definition, Declaration and Use

It is straightforward to adopt macro components to an application:

  1. Define (aka., Implement) a macro component in a ZUML page.
  2. Declare the macro component in the page or the whole application that is going to use the macro component.
  3. Use the macro components. The use of a macro component is the same of using primitive components. There is no difference at all.

Version History

Last Update : 2010/11/8

Version Date Content

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.