aspose file tools
The moose likes JSF and the fly likes Using selectManyCheckbox Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Using selectManyCheckbox" Watch "Using selectManyCheckbox" New topic
Author

Using selectManyCheckbox

Viswanath Sriram
Greenhorn

Joined: Jul 20, 2006
Posts: 12
I have used datatable tag to display the rows.For every row a check box will appear with its id.Now i want the list of the selected items in the controller.can any body explain this with code.
Sushma Sharma
Ranch Hand

Joined: Jun 02, 2005
Posts: 139
I think you can use your backing beans's property which should be array. but I am not sure how to do that.

the other way round is to iterate through the request parameters and get the value.

e.g.



where
pr:prForm:prTable - pr is subview id, prForm is Form id and prTable is dataTable id.

chk - is id of check box

cnt - is a counter to keep track of the check box number.

I hope that helps.
Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
use a dataTable to display your checkbox and other controls.

ie.,


thats all you need. you can be assured that when the action method in your backing bean is called, the "someList" will be populated correctly with what the user has selected.


MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Using selectManyCheckbox
 
Similar Threads
Cant use object from another class
Posting to bump up my count...
WA #1.....word association
The x900 effect ?
Text box value is not being completely filled with request attribute