John, Thanks for your reply. This is a standard way of using multiple check boxes(i.e.html:multibox). If you read my earlier e-mail the requirement is little bit different.Just explaining in brief again. say for example I have a list with 10 objects. I am displaying a list on a page with a check box. the object has a boolean property . depending on the value of the property the check box should be checked or unchecked initially.( In case of Multibox all of them are unchecked initially). Now I can check and uncheck the check boxes my self on that page and when I submit the page the result should be displayed on the next page. Let me know if anybody has come across this scenario with struts1.1. This is a user requirement and we really don't know how do it. We tried both using html:checkbox and html:multibox but could not make it work if anybody can give their expert comments then it will be a good help, Thanks, Jignesh
[EMAIL PROTECTED] wrote: To use a multibox, you need a getter and setter method in your form-bean that returns/sets a String array. Each element in this String array corresponds to the value of a checked check-box. Let's say you have a multibox coded like this: ie 1) myFormBean has a method 'getDataBaseRecords' that returns a collection. 2) Each object in the 'getDataBaseRecords' collection has a method 'getDescription', which is used to set the value of (and display against) the checkbox. 3) myFormBean has methods 'get/setSelectedDataBaseRecords' coded as follows: private String[] selectedDataBaseRecords = new String[0]; public String[] getSelectedDataBaseRecords() { return selectedDataBaseRecords; } public void setSelectedDataBaseRecords(String[] value) { selectedDataBaseRecords = value; } The effect of the above will be to generate html as follows: [input] 1]" name=selectedDataBaseRecords> [input] 2]" name=selectedDataBaseRecords> [input] 3]" name=selectedDataBaseRecords> [input] 4]" name=selectedDataBaseRecords> etc. Initially none of the check-boxes are checked because I've coded 'getSelectedDataBaseRecords' to return a zero length array. If you were to check the second and third check-boxes and submit the form, 'getSelectedDataBaseRecords' would then return an array of 2 elements, with the values '[description 2]' and '[description 3]'. Regards, John [EMAIL PROTECTED] Ph (09) 372-5010 |---------+-------------------------------> | | Jignesh Kapadia | | | | | @yahoo.com> | | | | | | 18/08/2004 12:33 PM | | | Please respond to | | | "Struts Users | | | Mailing List" | | | | |---------+-------------------------------> >--------------------------------------------------------------------------------------------------------------| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: multiple checkboxes | >--------------------------------------------------------------------------------------------------------------| Hi , I have a scenario in our aplication which we are developing with Struts1.1. on first screen we are displaying bunch of records retrieved from database. Each record will have checkbox in first column. This check box wil be initially checked or unchecked depending upon the value of a bean attribute. A user can chsnge this .He/She can check or uncheck any check boxes for any records.On the next screen it should show me the updated records. i.e. records which are unchecked on previous page should be seen as unchecked and records which are checked on previous page should be shown as checked. I tried this using can somebody give a suggestion on this? It will be good help from your side if you can give your expert feedback ASAP. Thanks, Jignesh Kapadia --------------------------------- Do you Yahoo!? Y! Messenger - Communicate in real time. Download now. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------- Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages!