File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Problem to save Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Problem to save" Watch "Problem to save" New topic
Author

Problem to save

William Flores
Ranch Hand

Joined: Dec 14, 2011
Posts: 30

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

Joined: Jun 25, 2001
Posts: 16303
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
William Flores
Ranch Hand

Joined: Dec 14, 2011
Posts: 30

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

Joined: Dec 14, 2011
Posts: 30

One question...
selectManyCheckbox return a array of String or a List of String?
William Flores
Ranch Hand

Joined: Dec 14, 2011
Posts: 30

I solved this problem. I set List of String(List<String>) and now it is working
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem to save