Model

From Documentation
Revision as of 02:40, 29 December 2010 by Tomyeh (talk | contribs) (Created page with '{{ZKDevelopersReferencePageHeader}} The model is the data an application handles. Depending on the application requirement, it could be anything, though usually abstracted as be…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The model is the data an application handles. Depending on the application requirement, it could be anything, though usually abstracted as beans and DAO.

However, many ZK components operates based on an abstract model (a Java interface), such that the view and the model can be separated clearly. For example, Listbox and Grid support ListModel, and Chart supports ChartModel.

For example, assume you have an implementaton called foo.CustomerListModel, then you could use it to drive a listbox as follows.

<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c" ?>
<listbox model="${c:new('foo.CustomerListModel')}"/>

In additions to implementing these models, you could use one of predefined implementation such as SimpleListMode and SimplePieModel.




Last Update : 2010/12/29

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