0

Zul GUI + java event/business logic code

asked 2009-02-21 10:58:24 +0800

amercieca gravatar image amercieca
6

Hi,
I'm new to ZK.
Can one write the GUI bits in zul and then write all the event handler/business logic code in java which is compiled (not zscript)?
If yes, can you please give me an example?
Tks.

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2009-02-21 11:12:59 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

@americiea

welcome to ZKoss forum.

have a look at this thread and study the code.
this

What you can see is:
-------------------------------
1. Listbox with Itemrenderer and sorting columns(comparator)
2. Event Handling in java code.
2.1 doubleClick on row opens a dialogWindow (remarked SingleRowClick or IconClick opens Dialog)
3. overhanded parameters from ListPage to DialogPage.
4. CRUD operations in the dialogWindow with readonly/edit modus.

The data comes from a table by a ServiceDAO. You must fill it by your own.

I have updated the sources (zk 3.5.2).

whishes Stephan
PS: Help to prevent the global warming by writing cool software.

link publish delete flag offensive edit

answered 2009-02-21 11:29:13 +0800

natoosandeep gravatar image natoosandeep
45

Yes you can.By using the use attribute of window tab as follows

<window id="win" title="ZK WINDOW" height="520px" width="765px" border="normal" closable="true" use="mypack.MyClass">
You just override the function for Window onCreate()
e.g.
import org.zkoss.zul.*;
public class MyClass extends Window
{
public void onCreate()
{
this.appendChild(new Textbox()); // to add new textbox in your window
// Write your code here to add more components
}
}
// -- Cheers

link publish delete flag offensive edit

answered 2009-02-21 12:38:36 +0800

amercieca gravatar image amercieca
6

ok - that's very good.
Had at the code and I get the idea.

Can you do things the other way round?
Can you create a richlet and then in the richlet load the zul file and call some method which parses the zul file, creates the components etc?

Tks.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-02-21 10:58:24 +0800

Seen: 291 times

Last updated: Feb 21 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More