• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using h:selectManyCheckbox inside h:dataTable

 
Marcos Maia
Ranch Hand
Posts: 977
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
Henrique Sousa
Ranch Hand
Posts: 92
  • 0
  • Mark post as helpful
  • send pies
  • 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,
 
ram gaurav
Ranch Hand
Posts: 208
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
About checkboxes in datatables, here is a useful reference: Using datatablesSelect multiple rows.
 
Joe Jose
Ranch Hand
Posts: 125
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bauke's solution worked for me. I used h:selectManyCheckbox.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic