• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

using h:selectManyCheckbox inside h:dataTable

 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I�m having problems trying to render a selectManyCheckbox from inside dataTable.
After a db query I have a Collection of objects wich I render using dataTable, as follows:


this works as expected... but now I need to put some checkBoxes, one for each entry, so the user can choose some of them to delete or one for update for example.
With this requirenment in mind I�ve been trying to render a selectManyCheckbos given to each one the pk value from the list... it�s not working...

follows the code I�m trying to use:


any help will be appreciated.... tx in advance...
[ June 08, 2005: Message edited by: Marcos Maia ]
 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Marcos,

I was trying to do that same thing a few weeks ago. With the help of some old topics, ranchers and Google, I found out that selectManyCheckbox is not such a good choice. From what I see, you want to select some 'linhaSistema' objects, right? The approach that worked for me was to add a selected (boolean) property to 'linhaSistema' and use selectBooleanCheckbox. Then you iterate over the collection again to check which objects were selected when the page is submited. Regards,
 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Its right to say that we can use <h:selectBooleanCheckbox />
But i am having the problem that how to generate dynamic ids for every checkbox, bacause it should be there so that we can easily differentiate that which checkbox is selected.

Thanks
Gaurav
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
About checkboxes in datatables, here is a useful reference: Using datatablesSelect multiple rows.
 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bauke's solution worked for me. I used h:selectManyCheckbox.
 
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic