-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I want to set disable a button before calling a method.In a word I want to execute some codes as linear.Here is the codes;
@Listen("onClick = #kodIsteButtonId")
public void kodIste() {
k = kd.findKisiByKullaniciadi(kullaniciadiId.getValue());
if (k == null) {
Messagebox.show("Böyle bir kullanıcı bulunamadı!", "Hata Mesajı",
0, Messagebox.ERROR);
} else {
kodIsteButtonId.setDisabled(true);
countDown(10, 6, k);
}
}
private void countDown(int fromToZero, int sleepTime, Kisiler k) {
tempPassword = rasgeleYeniSifre();
sendEposta(k.getEposta(), tempPassword);
alert("Güvenlik kodu e-postanıza gönderildi.");
while (fromToZero > 0) {
try {
Thread.sleep(sleepTime * 1000);
} catch (Exception e) {
e.printStackTrace();
}
fromToZero--;
}
sifreAlButtonId.setDisabled(false);
clearButtonId.setDisabled(false);
kodId.setDisabled(false);
}
When I click to the button I want to see the button disable.But After countDown() method it is disabling.What can be reason?
good job !
Try to put the needed logic in the zul file:
<button autodisable="true"/>
best Stephan
Asked: 2015-03-17 13:27:31 +0800
Seen: 28 times
Last updated: Mar 19 '15