Posts belonging to Category ZK



ZK – Communicating with the server

Using Javascript instead of zscript  to calculate a value means you don’t have to communicate with the server until necessary but how do you send data back to the server? I could not find a complete answer so here is my answer below:

In your zul page you will need a textbox (hidden if you want)

<textbox id="serverComm" class="serverComm"></textbox>

Your Javascript put something like this to trigger event

    zk.Widget.$($(".serverComm")).setValue("value to send");
    wid = zk.Widget.$($(".serverComm"));
    zAu.send(new zk.Event(wid, 'onUser', location));

In your “GenericForwardComposer” you need to listen for the event:

	Textbox serverComm;
	public void onUser$serverComm(Event event) throws Exception {
		Event eventx = Events.getRealOrigin((ForwardEvent)event);
		String test = eventx.getData().toString();
		System.out.println(test);
	}

So you don’t make the same mistakes I made:

  • don’t make your on event like “onMyEvent” I think  “onUser” is an event made just for this.
  • I tried sending value without the textbox but it just did not work.

 

ZK, Spring, AOP, Security, Hibernate, Hibernate-Generic-DAO, Jasper

I been looking for a good example that has ZK, Spring, Spring Security and Hibernate and this example looks perfect and it is well documented

http://vs171030.vserver.de/test/pages/index.zul

the sample app is hosted here

http://vs171030.vserver.de/test/

Some more info on ZK with Spring-security

http://www.zkoss.org/smalltalks/zkspringsec1/

ZK studio only works with Eclipse Galileo and I at this time I think i need an older version of Java SDK

http://www.oracle.com/technetwork/java/archive-139210.html

 

Spring, -AOP, -Security, Hibernate, Hibernate-Generic-DAO, Jasper