-
FEATURED COMPONENTS
First time here? Check out the FAQ!
We have a Java application with ZK 5.0. Actually, we are doing a Migration to ZK 8.
We have a problem with the events, some times, they are called Twice.
For example, in this line we send an Event to the Controller from JavaScript:
zAu.send(new zk.Event(zk.Widget.$(this), 'onMakePackageOnWebDav', JSON.stringify(data)));
And, in the Controller the method onMakePackageOnWebDav is executed, and when is finished, is ejecuted again.
It's happen in other objects, for example, the ComboBox in the zul files.
<combobox cols="7" id="combStates" readonly="true" tabindex="4" selectedItem="window$composer.state"/>
When a item is selected from this Comboox, the setter for the variable is called twice, one with the value selected in the Combo and again with a null value.
Someone knows why this problem can occur?
Hello,
You should check what events are sent, and also if multiple events are associated with the controller.
Also please find below a working example:
http://zkfiddle.org/sample/3u18u31/7-Use-zAu-send-to-send-data-to-server-from-client#source-1
Best,
Darksu
Another example.
<cell>
<hlayout sclass="z-valign-midlle">
<button id="previsualizarButton" iconSclass="z-icon-search" />
</hlayout>
</cell>
When do click in the button, this method is called twice:
public void onClick$previsualizarButton() {
----CODE CODE CODE ETC...----
}
We have a problem with the events, some times, they are called Twice. For example, in this line we send an Event to the Controller from JavaScript:
zAu.send(new zk.Event(zk.Widget.$('$windowDashboard'), 'onShowVuongmac', {'madonvi' : 'ALL','type' : 'ALL'}, {toServer:true}));
@Listen("onShowVuongmac=#windowDashboard")
public void onShowVuongmac(Event evt) {
JSONObject jsonObject = (JSONObject) evt.getData();
String donvi = jsonObject.get("madonvi").toString();
}
Asked: 2017-06-15 19:53:46 +0800
Seen: 29 times
Last updated: Jun 19 '17