Revision history [back]

click to hide/show revision 1
initial version

asked 2008-11-13 20:11:35 +0800

huubf gravatar image huubf

synchronise serverside and clientside code

I have this:

<button id="openreportbutton" action="onclick:openReport()" onclick="storeChoices()" label="Show Report"/>

First the choices are stored in session in a serverside method, than clientside openReport is executed, which does window.open("another.zul") that picks up the values from the session. But storeChoice also checks choosen values.

Now if something was missed, i want to set something in the page, e.g. a label turns to red, and only afterwards first check the color of the value in the javascript function before launching the other zul.

How can i synchronise both calls: so first an Ajax call from ZK, change the labelcolor, then call openReport, to check $("${label.uuid}").getStyle("color")

eh, i see that a short timeout does the trick, but is there an exact method?

  <button id="openreportbutton" action="onclick:setTimeout('openReport()',100)" onClick="storeChoices()"  label="Show Report" />

Regards, Huub

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