Controller"

From Documentation
(Created page with '{{ZKDevelopersReferencePageHeader}} =Version History= Last Update : {{REVISIONYEAR}}/{{REVISIONMONTH}}/{{REVISIONDAY}} {| border='1px' | width="100%" ! Version !! Date !! Conten…')
 
m
 
(29 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{ZKDevelopersReferencePageHeader}}
 
{{ZKDevelopersReferencePageHeader}}
  
=Version History=
+
=Overview=
Last Update : {{REVISIONYEAR}}/{{REVISIONMONTH}}/{{REVISIONDAY}}
+
The ''controller'' is a Java program that is used to glue UI (view) and Data (model) together.
{| border='1px' | width="100%"
+
 
! Version !! Date !! Content
+
A simple UI does not require any controllers. For example, the data of a <javadoc>org.zkoss.zul.Listbox</javadoc> could be abstracted by implementing <javadoc type="interface">org.zkoss.zul.ListModel</javadoc> as described in [[ZK Developer's Reference/MVC/Model|the Model section]].
|-
+
 
| &nbsp;
+
For typical database access, the glue logic (i.e., controller) can be handled by a generic feature called [[ZK Developer's Reference/MVVM/Data Binding|Data Binding]]. In other words, the create, read, update and delete operations (CRUD) can be handled automatically by a generic Data Binding mechanism, and you don't need to write the glue logic at all as described in [[ZK Developer's Reference/MVVM/Data Binding|the Data Binding section]].
| &nbsp;
+
 
| &nbsp;
+
If none of the above fulfills your requirement, you could implement a custom controller (which is called a composer in ZK terminology). In the following sections we will discuss how to implement a custom controller in details.
|}
+
 
 +
{{ZKDevelopersReferenceHeadingToc}}
  
 
{{ZKDevelopersReferencePageFooter}}
 
{{ZKDevelopersReferencePageFooter}}

Latest revision as of 03:27, 29 January 2024

Overview

The controller is a Java program that is used to glue UI (view) and Data (model) together.

A simple UI does not require any controllers. For example, the data of a Listbox could be abstracted by implementing ListModel as described in the Model section.

For typical database access, the glue logic (i.e., controller) can be handled by a generic feature called Data Binding. In other words, the create, read, update and delete operations (CRUD) can be handled automatically by a generic Data Binding mechanism, and you don't need to write the glue logic at all as described in the Data Binding section.

If none of the above fulfills your requirement, you could implement a custom controller (which is called a composer in ZK terminology). In the following sections we will discuss how to implement a custom controller in details.





Last Update : 2024/01/29

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