Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

using h:selectManyCheckbox inside h:dataTable

 
Ranch Hand
Posts: 977
  • 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 ]
 
Ranch Hand
Posts: 92
  • 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,
 
Ranch Hand
Posts: 208
  • 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
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Bauke's solution worked for me. I used h:selectManyCheckbox.
 
Grow your own food... or this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic