org.zkoss.mil

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » zk » org.zkoss.mil 
org.zkoss.mil
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">
  • Specifies a script that shall be interpret when executing this page.
  • If you want to pre-compile Java codes, you could do
    <zscript>
    import com.MyCompany.MyPackage.MyClass;
    MyClass.doThis();
    MyClass.doThat();
    .</zscript>
  • Predefined variables:
    self
    The component itself
    self.parent
    The parent component, if any
    page
    The page (org.zkoss.zk.ui.Page)
    session
    The session (org.zkoss.zk.ui.Session)
    this
    The BeanShell namespace to interpret the script defined in this component. Advanced users only.
    super
    The BeanShell namespace to interpret the script defined in the parent component, if any. Advanced users only.
  • If you specify the id attribute for a component, a variable the same as the specified ID is created automatically.
  • If you want to resolve the EL's variables, such as a parameter, use page.resolveVariable(). Example: page.getELVariable('param').get('some')

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.
NameDescriptionFrom ScriptFrom EL
self The current component that script/EL is interpreted upon.
It is the same as this in Java.
YesYes
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.
YesYes
desktopScope The attributes defined in the current desktop.
It is the same as this.getPage().getAttributes(name,DESKTOP_SCOPE) in Java.
YesYes
pageScope The attributes defined in the current page.
It is the same as this.getPage().getAttributes() in Java.
YesYes
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. YesYes
componentScope The attributes defined in the current component. It is the same as this.getAttributes() with COMPONENT_SCOPE in Java. YesYes
arg A map of parameters that are passed to Execution.createComponents(...).
It is the same as desktop.getExecution().getArg() in Java.
YesYes

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

Java Source File NameTypeComment
Command.javaClass A command on the Mobile.
Datebox.javaClass Datebox for date, time, and date time entry.
Decimalbox.javaClass Decimal input box.
Displayable.javaClass Root components that can be directly kids of a Page.
Frame.javaClass A generic Frame.
GenericMobileRichlet.javaClass Defines a genric richlet for ZK Mobile.
Image.javaClass The Image item component that can be layout under the Frame .
Intbox.javaClass A integer input box.
Item.javaClass Generic Item component under the Frame component.
Label.javaClass
Listbox.javaClass The Listbox item component that can be layout ouder Frame.
Listitem.javaClass The Listitem that can be located under Listbox only.
MilComponent.javaClass Super class of MIL component.
Screen.javaInterface A marker interface that distinguish those Displayable components from Canvas (which is not a Screen component).
Textbox.javaClass A generic text box.
Version.javaClass The version of the ZK MIL component set.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.