*
The moose likes JSF and the fly likes Checked SelectManyCheckbox Values are not written to Backingbean Property Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Checked SelectManyCheckbox Values are not written to Backingbean Property" Watch "Checked SelectManyCheckbox Values are not written to Backingbean Property" New topic
Author

Checked SelectManyCheckbox Values are not written to Backingbean Property

Dominik Scholz
Greenhorn

Joined: Mar 30, 2009
Posts: 8
Hi all,
i started with Java and JSF two weeks ago and made quite some progress (at least i think so ) thanks alot to many posters here!

I 'm writing an OnlineQuiz where Questions, Answers and Results are read from a DB and displayed, but now i got a problem
which i can't solve because any example given is just like the way i've written it.

The possible answers are displayed but no matter if the boxes are checked or not the set property is never called only the get

JSF part:


bean part

NewQuiz is an Object of Quiz which has an ArrayList Property with all answers per question as Strings.
When the button is clicked the index of the questions ArrayList is increased and the next question and the answers are written into the properties
and loaded into the form.

Please can anybody help me? I'm stuck here now for for two days trying many possible ways to achieve what i need and i have no ideas left.
I even have written a method to analyze the results already which i never get...

P.S. "Frage" = Question, "Antwort" = Answer and "Ergebnis" = Result
Dominik Scholz
Greenhorn

Joined: Mar 30, 2009
Posts: 8
Done a workaround with a ValueChangeListener but the problem still persists



Log:
12:52:35,461 DEBUG [quiz.quiz.WissensQuizHandler] Mit welchen Fragen kann ich das Gespräch am besten steuern?
12:52:35,461 DEBUG [quiz.quiz.WissensQuizHandler] []OLD
12:52:35,461 DEBUG [quiz.quiz.WissensQuizHandler] [geschlossene Fragen]NEW // the answer i selected
12:52:35,461 DEBUG [quiz.quiz.WissensQuizHandler] j_id_jsp_999753246_15ID

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Remove the immediate attribute from the commandbutton. It makes no sense here. This cause all input values which doesn't have immediate attribute set being skipped during update model values phase.
Dominik Scholz
Greenhorn

Joined: Mar 30, 2009
Posts: 8
17:12:43,915 DEBUG [quiz.quiz.WissensQuizHandler] WissensQuizHandler.setErgebnisse (Ergebnisse schreiben)

You're the best! Thanks a lot!

I knew it would be something stupid...
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
You're welcome.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Checked SelectManyCheckbox Values are not written to Backingbean Property