Example

Defining a name in the “Your name”-field and then pressing the “Say Hello!” button will create a corresponding output in the result line.

HelloWorld

Layout

The layout is kept in an XML layout definition file – which can be created using the WYSIWYG-Layout-Editor of the CaptainCasa tool set or which can be directly edited with a text editor:

HelloWorldXML

Control attributes in the layout definition are either directly defined or are referencing a Java program’s properties and methods: the field for the first name binds to “#{d.HelloWorldUI.name}”, the button binds to “#{d.HelloWorldUI.onSayHelloAction}” and the label for the result binds to “#{d.HelloWorldUI.result}”.

Code

The Java program is:

HelloWorldJAVA

That’s it! – An XML layout definition and a simple Java program. Both the XML file and the Java program are residing on server-side. From the Java program you can access any Server-side logic that you want – it is the “view entrance” into your server-side application processing.

Re-use, dynamic content

The “HelloWorld” dialog implementation now can be used by other dialogs – and e.g. may be embedded into them. A complex, “big” dialog is assembled out of corresponding sub-dialogs, which can easily interact by simple Java APIs.

In the example we used a static XML definition as layout definition. You can easily mix in dynamic layout definitions, in which then the control arrangement is defined by a corresponding object tree that is dynamically built up by some Java logic.

CaptainCasa GmbH
Hindedmithweg 13
D-69245 Bammental
Phone: +49 6223 484147
Mail: info@CaptainCasa.com

Contact
Impressum