MIL Component Set in RMIL(
MIL component set that are used for RMIL-based clients.
Table of Contents
What is ZK Mobile?
ZK Mobile is a JavaME program that runs as a thin client on mobile device. It interacts with
the ZK server to display the RMIL page sent from ZK server and sent event triggered by the user
back to server and so on.
What is MIL?
MIL is abbreviated from Mobile Interactive Language. It represents a set of components specifically
for ZK Mobile thin client. A ZK Mobile to MIL is like a HTML browser to ZUL.
What is RMIL?
RMIL is abbreviated from Raw Mobile Interactive Language. It is a set of "low level" XML
elements used to instruct ZK Mobile thin client how to "draw" a MIL page. A ZK Mobile to RMIL is like a HTML browser to HTML.
Components of MIL in RMIL
Introduction
The implementation of MIL components for ZK.
Directive Elements
page
<?page [id="..."] [title="..."] [language="mil"]?>
- The language must be
mil .
- The title is not used in MIL.
- The id is used for ID Space navigation.
- It must be at the same level as the root element.
Special Elements
zk
Due to XML's syntax limitation, we can only specify one document root.
Thus, if you have multiple root components, you must use <zk>
as the document root to group these root components.
In other words, <zk> is not a component and it, if used,
must be the document root.
zscript
<zscript>...</zscript>
<zscript src="/WEB-INF/xx/yy.bs">
Simple Elements
Common Attributes
<xxx [id="..."] [use="..."]/>
- If id is not specified, it is generated automatically.
If specified, it must be unique in the whole page.
- The class attribute defines the CSS class that this component
shall refer.
- The use attribute defines the Java class to use instead of
the Java class defined in zk-xul-*.xml
textbox
<textbox [id="..."] [use="..."]
[onChange="script"] [onChanging="script"] [value="value"] [type="|password"]
[maxlength="0|num"] [readonly="false|true"] />
- The onChange attribute is called after the value is really set.
- Note: the script of the onChange attribute is called
only if user input a different value.
On the other hand, the setValue method is called either by a program
or by user's input (if by a program, the value might not be changed).
- The onChanging attribute is called when a user is chaning its content.
onChanging won't cause the content being set. It is simply used to notify
server for implementing auto-completion and other features.
frame
<frame [id="..."] [use="..."] [title="..."] [border="normal|none"]/>
- The title attribute defines the frame title.
Implicit Objects
Depending on invoking from a script or from an EL expression, different
implicit objects might be used.
Name | Description | From Script | From EL |
self |
The current component that script/EL is interpreted upon.
It is the same as this in Java. |
Yes | Yes |
spaceOwner |
The owner of the ID space that the current component belongs to
(See What is an ID space").
It is null, if the current component doesn't belong to any space.
It is the same as self.getSpaceOwner() in script, self.root in EL and
this.getSpaceOwner() in Java. |
Yes | Yes |
desktopScope |
The attributes defined in the current desktop.
It is the same as this.getPage().getAttributes(name,DESKTOP_SCOPE) in Java. |
Yes | Yes |
pageScope |
The attributes defined in the current page.
It is the same as this.getPage().getAttributes() in Java. |
Yes | Yes |
spaceScope |
The attributes defined in the ID space that the current component belongs to
(See What is an ID space").
It is the same as this.getAttributes() with SPACE_SCOPE in Java. |
Yes | Yes |
componentScope |
The attributes defined in the current component.
It is the same as this.getAttributes() with COMPONENT_SCOPE in Java. |
Yes | Yes |
arg |
A map of parameters that are passed to Execution.createComponents(...).
It is the same as desktop.getExecution().getArg() in Java. |
Yes | Yes |
How to browse components
In Java
Each frame forms an independent ID space.
To get a component from an ID space, use Component.getFellow against
any component in the same ID space. If a frame, say C, is a child of
another frame, say P, then C belongs the ID space of P, but descendants
of C don't. Rather, descendants of C belong to the ID space of C.
Notice: C belongs to the ID spaces of both C and P.
A page is also an independent ID space, Page.getFellow is used to
retrieve a fellow in it.
- To get the current page, use Component.getPage().
- To get another page (in the same desktop), use Component.getPage(String).
- To get a component of a page, use Page.getFellow(String) -- assuming
the component is not a descendant of any frame..
- To get a child component of frame, use
Window.getFellow(String).
- To get a fellow component, use Componnet.getFellow(String).
All components belongs (aka., child or descendant of) to the same frame
are called fellows. If a frame, say X, belongs to another frame, say Y,
then X, like other type of components, is a fellow of Y. However,
children and descendants of X are NOT fellow of Y because they belong
to X's space. Only X belongs to both X's and Y's spaces.
In Script and EL
Components that are specified with the id attribute (i.e., you have assign an ID)
can be accessed directly by the value of the id attribute.
For example,
<label id="label" value="Not good enough?"/>
<button label="Change label" onClick="label.value = label.value + 'A'"/>
The scope of visibility, same as in Java, is controlled by the ID space.
In other words, each frame has an independent ID space.
When you specified an ID, only the current ID space is searched.
Events
|