• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem to save

 
William Flores
Ranch Hand
Posts: 32
Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys!
I have problem with selectManyCheckbox. Not is saving my object selected on selectManyCheckBox.
I have a selectManyCheckBox in my view and the values from database.

"alunoController.alunoMotivo" is a List of AlunoMotivo. AlunoMotivo is a bean class of a relationship NxN.
Below is a piece of my controller class AlunoController.


"alunoMotivo.get(i).getCodMotivo()" is null, I don't know why. But "alunoMotivo.get(i)" has the value. So I can't save them.
Do you undestand my problem?
Thanks for while!


 
Tim Holloway
Saloon Keeper
Pie
Posts: 17616
38
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I read that correctly, you are attempting to use a scalar JDBC function (setInt) to store a vector object (collection of ints). That doesn't work, JSF or not.
 
William Flores
Ranch Hand
Posts: 32
Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I have a collection of AlunoMotivo and I did that "for" to insert id of aluno one per one "ps.setInt(2, alunoMotivo.get(i).getCodMotivo())"

That "getCodMotivo()" return a int, follow below my class AlunoMotivo.
 
William Flores
Ranch Hand
Posts: 32
Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One question...
selectManyCheckbox return a array of String or a List of String?
 
William Flores
Ranch Hand
Posts: 32
Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I solved this problem. I set List of String(List<String>) and now it is working
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic