0

Setting disable button before call method

asked 2015-03-17 13:27:31 +0800

emreturka gravatar image emreturka
9 2

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?

delete flag offensive retag edit

2 Answers

Sort by » oldest newest most voted
0

answered 2015-03-19 13:41:18 +0800

korko gravatar image korko
16
http://www.latwasplata.ne...

good job !

link publish delete flag offensive edit
0

answered 2015-03-18 15:31:02 +0800

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

Try to put the needed logic in the zul file:

<button autodisable="true"/>

best Stephan

link publish delete flag offensive edit
Your answer
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
1 follower

RSS

Stats

Asked: 2015-03-17 13:27:31 +0800

Seen: 28 times

Last updated: Mar 19 '15

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