lundi 25 janvier 2021

Check if a Checkbox is checked?

In my Project i have this Checkbox

<g:CheckBox ui:field="answer"></g:CheckBox> <span class="{style.answer-font}">arithmetische Operatoren</span>

and this Button

<g:Button ui:field="abgabe" styleName="{style.button} bg-success text-white">ICH BIN FERTIG!</g:Button>

Now, when the User presses the button and the Checkbox is checked, then there will be a window-alert.

Button abgabe;
CheckBox answer;

@UiHandler("abgabe")
void check(ClickEvent e) {
    if (answer.isChecked()==true)
        Window.alert("HALLO");
}

But why it doesnt work?




Aucun commentaire:

Enregistrer un commentaire