aspose file tools*
The moose likes JSF and the fly likes call a method to all checkboxs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "call a method to all checkboxs" Watch "call a method to all checkboxs" New topic
Author

call a method to all checkboxs

Haythem Ben Yahia
Greenhorn

Joined: Nov 29, 2012
Posts: 14
hi,
i have to import a csv file and show its components in a datatable.and then i must select all items(checkbox) and click a button witch call a methods that takes parameter everey checkbox that is checked.
how can i do that, please
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15662
    
  15

You will need a file upload page to allow the user to send the file to the webapp. You will need a CSV parser to convert the CSV data into java components.

On the display page:

To display the CSV plus checkboxes in a dataTable, you'll need to define a suitable row model object, which can be something like an aggregation of a binary property and a row of the converted CSV data. These row models would then be assembled into a collection, which would then be wrapped with a JSF DataModel object (such as a ListDataModel). Pre-checking the checkboxes can be done by simply setting their corresponding row model object properties to "true".

You do NOT send parameters from the checkboxes. JSF is designed to work with server-side Model objects, not parameters on the View. If you want a button on the webpage that does a "select all" function on the checkboxes, write an action method for a commandButton and make that action method enumerate the row models and set their boolean checkbox value properties to true.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: call a method to all checkboxs
 
Similar Threads
How to checked CheckBox in JList only when user click on CheckBox's Tile?
CheckBox()
Begginer question, assigning a java string the value of a passed parameter
Problem with checkbox
select and unselecting checkboxes based on clicking a check box