• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem to save

 
Ranch Hand
Posts: 32
Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!


 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One question...
selectManyCheckbox return a array of String or a List of String?
 
William Flores
Ranch Hand
Posts: 32
Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I solved this problem. I set List of String(List<String>) and now it is working
 
reply
    Bookmark Topic Watch Topic
  • New Topic