Model"

From Documentation
(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…')
 
m
Line 12: Line 12:
 
</source>
 
</source>
  
In additions to implementing these models, you could use one of predefined implementation such as <javadoc>org.zkoss.zul.SimpleListMode</javadoc> and <javadoc>org.zkoss.zul.SimplePieModel</javadoc>.
+
In additions to implementing these models, you could use one of predefined implementation such as <javadoc>org.zkoss.zul.SimpleListModel</javadoc> and <javadoc>org.zkoss.zul.SimplePieModel</javadoc>.
  
 
{{ZKDevelopersReferenceHeadingToc}}
 
{{ZKDevelopersReferenceHeadingToc}}
 
{{ZKDevelopersReferencePageFooter}}
 
{{ZKDevelopersReferencePageFooter}}

Revision as of 02:44, 29 December 2010

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 SimpleListModel and SimplePieModel.




Last Update : 2010/12/29

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