Assuming this is about T5 as I know nothing of earlier versions, I would personally have the done as follows:

@Persist
private YourQuestionObj actualQuestion;

@SetupRender
private void setup() {
   actualQuestion = genereateSimpleMathQuestion();
}

SetupRender is only called to prepare for render and thus is not called on a form submit, only again once the formAction would decide to forward to the same page again.

Cheers,
Joost

Tomasz Dziurko wrote:
It didn't solved my problem, but I found another way of doing it.

Simplfied code:

onActivate() {
    oldSimpleMathQuestion = new
SimpleMathQuestion(actualQuestion.question, actualQuestion.answer));
    actualQuestion = genereateSimpleMathQuestion();
}

onSuccess {
    if(oldSimpleMathQuestion.answer==getUserInput()) {
        // do normal action
    }
    else
      // perform error message, etc.
}



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to