Re: html:multibox and bean:write
hi i tried this but this gives a error that the getKey() method not found. In my code styleData is hashtable and i tried to put a key value in the checkbox value. Please help me to find out the solution - Original Message - From: Sri Sankaran [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, February 28, 2003 9:50 PM Subject: RE: html:multibox and bean:write You cannot emded a tag inside another tag. You can achieve what you are trying as follows value=%=styleData.getKey()% Sri -Original Message- From: shashi_struts [mailto:[EMAIL PROTECTED] Sent: Friday, February 28, 2003 7:23 AM To: Struts Users Mailing List Subject: html:multibox and bean:write hi hi i am using multibox and in the value i want a data comes from the logic:iterate and write through the bean:write but it gives a problem logic:iterate id=styleData name=style property=styleData indexId=index tr td valign=middle width=83 html:multibox name=style property=styleID value= bean:write name=styleData property=key// /td td width=167 br bean:write name=styleData property=value//td /tr /logic:iterate - this is my code please consider this and help me Shashi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:multibox and bean:write
You cannot emded a tag inside another tag. You can achieve what you are trying as follows value=%=styleData.getKey()% Sri -Original Message- From: shashi_struts [mailto:[EMAIL PROTECTED] Sent: Friday, February 28, 2003 7:23 AM To: Struts Users Mailing List Subject: html:multibox and bean:write hi hi i am using multibox and in the value i want a data comes from the logic:iterate and write through the bean:write but it gives a problem logic:iterate id=styleData name=style property=styleData indexId=index tr td valign=middle width=83 html:multibox name=style property=styleID value= bean:write name=styleData property=key// /td td width=167 br bean:write name=styleData property=value//td /tr /logic:iterate - this is my code please consider this and help me Shashi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:multibox and arrays in the ActionForm
I don't understand why you say you can't use logic:iterate to populate cells in a table logic:iterate id=item property=items tr td html:multibox property=selectedItems bean:write name=item/ /html:multibox bean:write name=item/ /td !-- Maybe more cells -- /tr /logic:iterate What am I missing? Sri -Original Message- From: Charles H. Baker [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 6:35 PM To: Struts Users Mailing List Subject: html:multibox and arrays in the ActionForm I have been using the most excellent ``Struts in Action'' by Ted Husted et. al., but I need a little clarification. There is a code snippet from an ActionForm: private String[] selectedItems = {}; private String[] items = {UPS,FedEx,Airborne}; public String[] getSelectedItems(){ return this.selectedItems; } public void setSelectedItems(String[] selectedItems){ this.selectedItems = selectedItems; } The JSP code snippet is this: logic:iterate id=item property=items html:multibox property=selectedItems bean:write name=item/ /html:multibox bean:write name=item/ /logic:iterate The html code in my case was produced by DreamWeaver and the checkboxes must go in table cells which are of irregular size, so I cannot just iterate over the items array. Do I need the selectedItems and items arrays? What's an alternate way of addressing the items array if I don't use the logic:iterate tag that will still be palatable to Struts if not a ``best practice.'' If I don't use the JSP code above, will the proper array be populated by Struts? BTW, I'm using Struts 1.02 on Tomcat 4.1.18. The people I'm working with are not ready to move to a Struts 1.1 beta. -- Charles H. Baker [EMAIL PROTECTED] http://www.charleshbaker.com/ http://www.charleshbaker.com/~chb/ Perl is designed to give you several ways to do anything, so consider picking the most readable one. -- Larry Wall in the perl man page - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:multibox and arrays in the ActionForm
What i figured out is that multibox works only against an array, not a collection - call it useful or not, i wished it works against a collection. -Original Message- From: Sri Sankaran [mailto:[EMAIL PROTECTED]] Sent: Dienstag, 04. Februar 2003 15:56 To: Struts Users Mailing List Subject: RE: html:multibox and arrays in the ActionForm I don't understand why you say you can't use logic:iterate to populate cells in a table logic:iterate id=item property=items tr td html:multibox property=selectedItems bean:write name=item/ /html:multibox bean:write name=item/ /td !-- Maybe more cells -- /tr /logic:iterate What am I missing? Sri -Original Message- From: Charles H. Baker [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 6:35 PM To: Struts Users Mailing List Subject: html:multibox and arrays in the ActionForm I have been using the most excellent ``Struts in Action'' by Ted Husted et. al., but I need a little clarification. There is a code snippet from an ActionForm: private String[] selectedItems = {}; private String[] items = {UPS,FedEx,Airborne}; public String[] getSelectedItems(){ return this.selectedItems; } public void setSelectedItems(String[] selectedItems){ this.selectedItems = selectedItems; } The JSP code snippet is this: logic:iterate id=item property=items html:multibox property=selectedItems bean:write name=item/ /html:multibox bean:write name=item/ /logic:iterate The html code in my case was produced by DreamWeaver and the checkboxes must go in table cells which are of irregular size, so I cannot just iterate over the items array. Do I need the selectedItems and items arrays? What's an alternate way of addressing the items array if I don't use the logic:iterate tag that will still be palatable to Struts if not a ``best practice.'' If I don't use the JSP code above, will the proper array be populated by Struts? BTW, I'm using Struts 1.02 on Tomcat 4.1.18. The people I'm working with are not ready to move to a Struts 1.1 beta. -- Charles H. Baker [EMAIL PROTECTED] http://www.charleshbaker.com/ http://www.charleshbaker.com/~chb/ Perl is designed to give you several ways to do anything, so consider picking the most readable one. -- Larry Wall in the perl man page - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:multibox no selection (Struts 1.1b2)
In reset method of your ActionForm, set default value of checkbox. Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Johan Kumps [mailto:[EMAIL PROTECTED]] Sent: January 31, 2003 4:47 PM To: Struts mailing Subject: html:multibox no selection (Struts 1.1b2) Hi all, It seems that my setXxx method in my form bean is not called when I do not check any checkboxes in the multibox. Please consider following code : ... html:multibox name='configForm' property='myHandlers' bean:write name='handler'/ /html:multibox bean:write name='handler'/ ... ... private String[] myHandlers = {}; ... public void setMyHandlers (String[] myHandlers) { this.myHandlers = myHandlers; } public String[] getMyHandlers() { return this.myHandlers; } ... Am I doing somthis wrong here? Please help me with this one. Kind regards, Johan --- This mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:multibox no selection (Struts 1.1b2)
I do not have a default value. The user can choose between two options. He can select both checkboxes, one of both or none. What is going wrong? Johan -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Verzonden: vrijdag 31 januari 2003 22:49 Aan: [EMAIL PROTECTED] Onderwerp: RE: html:multibox no selection (Struts 1.1b2) In reset method of your ActionForm, set default value of checkbox. Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Johan Kumps [mailto:[EMAIL PROTECTED]] Sent: January 31, 2003 4:47 PM To: Struts mailing Subject: html:multibox no selection (Struts 1.1b2) Hi all, It seems that my setXxx method in my form bean is not called when I do not check any checkboxes in the multibox. Please consider following code : ... html:multibox name='configForm' property='myHandlers' bean:write name='handler'/ /html:multibox bean:write name='handler'/ ... ... private String[] myHandlers = {}; ... public void setMyHandlers (String[] myHandlers) { this.myHandlers = myHandlers; } public String[] getMyHandlers() { return this.myHandlers; } ... Am I doing somthis wrong here? Please help me with this one. Kind regards, Johan --- This mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 --- This mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:multibox no selection (Struts 1.1b2)
Then set unchecked value. Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Johan Kumps [mailto:[EMAIL PROTECTED]] Sent: January 31, 2003 4:53 PM To: Struts Users Mailing List Subject: RE: html:multibox no selection (Struts 1.1b2) I do not have a default value. The user can choose between two options. He can select both checkboxes, one of both or none. What is going wrong? Johan -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Verzonden: vrijdag 31 januari 2003 22:49 Aan: [EMAIL PROTECTED] Onderwerp: RE: html:multibox no selection (Struts 1.1b2) In reset method of your ActionForm, set default value of checkbox. Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Johan Kumps [mailto:[EMAIL PROTECTED]] Sent: January 31, 2003 4:47 PM To: Struts mailing Subject: html:multibox no selection (Struts 1.1b2) Hi all, It seems that my setXxx method in my form bean is not called when I do not check any checkboxes in the multibox. Please consider following code : ... html:multibox name='configForm' property='myHandlers' bean:write name='handler'/ /html:multibox bean:write name='handler'/ ... ... private String[] myHandlers = {}; ... public void setMyHandlers (String[] myHandlers) { this.myHandlers = myHandlers; } public String[] getMyHandlers() { return this.myHandlers; } ... Am I doing somthis wrong here? Please help me with this one. Kind regards, Johan --- This mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 --- This mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:multibox no selection (Struts 1.1b2)
Sorry, Can you give an example? Johan -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Verzonden: vrijdag 31 januari 2003 22:57 Aan: [EMAIL PROTECTED] Onderwerp: RE: html:multibox no selection (Struts 1.1b2) Then set unchecked value. Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Johan Kumps [mailto:[EMAIL PROTECTED]] Sent: January 31, 2003 4:53 PM To: Struts Users Mailing List Subject: RE: html:multibox no selection (Struts 1.1b2) I do not have a default value. The user can choose between two options. He can select both checkboxes, one of both or none. What is going wrong? Johan -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Verzonden: vrijdag 31 januari 2003 22:49 Aan: [EMAIL PROTECTED] Onderwerp: RE: html:multibox no selection (Struts 1.1b2) In reset method of your ActionForm, set default value of checkbox. Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Johan Kumps [mailto:[EMAIL PROTECTED]] Sent: January 31, 2003 4:47 PM To: Struts mailing Subject: html:multibox no selection (Struts 1.1b2) Hi all, It seems that my setXxx method in my form bean is not called when I do not check any checkboxes in the multibox. Please consider following code : ... html:multibox name='configForm' property='myHandlers' bean:write name='handler'/ /html:multibox bean:write name='handler'/ ... ... private String[] myHandlers = {}; ... public void setMyHandlers (String[] myHandlers) { this.myHandlers = myHandlers; } public String[] getMyHandlers() { return this.myHandlers; } ... Am I doing somthis wrong here? Please help me with this one. Kind regards, Johan --- This mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 --- This mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 --- This mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:multibox no selection (Struts 1.1b2)
You override the reset method to set unchecked value. 1. You know how many elements in your array, so instantiates your array. 2. You know the unchecked value of each element, so do a loop and set default value to each element. Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Johan Kumps [mailto:[EMAIL PROTECTED]] Sent: January 31, 2003 4:58 PM To: Struts Users Mailing List Subject: RE: html:multibox no selection (Struts 1.1b2) Sorry, Can you give an example? Johan -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Verzonden: vrijdag 31 januari 2003 22:57 Aan: [EMAIL PROTECTED] Onderwerp: RE: html:multibox no selection (Struts 1.1b2) Then set unchecked value. Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Johan Kumps [mailto:[EMAIL PROTECTED]] Sent: January 31, 2003 4:53 PM To: Struts Users Mailing List Subject: RE: html:multibox no selection (Struts 1.1b2) I do not have a default value. The user can choose between two options. He can select both checkboxes, one of both or none. What is going wrong? Johan -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Verzonden: vrijdag 31 januari 2003 22:49 Aan: [EMAIL PROTECTED] Onderwerp: RE: html:multibox no selection (Struts 1.1b2) In reset method of your ActionForm, set default value of checkbox. Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Johan Kumps [mailto:[EMAIL PROTECTED]] Sent: January 31, 2003 4:47 PM To: Struts mailing Subject: html:multibox no selection (Struts 1.1b2) Hi all, It seems that my setXxx method in my form bean is not called when I do not check any checkboxes in the multibox. Please consider following code : ... html:multibox name='configForm' property='myHandlers' bean:write name='handler'/ /html:multibox bean:write name='handler'/ ... ... private String[] myHandlers = {}; ... public void setMyHandlers (String[] myHandlers) { this.myHandlers = myHandlers; } public String[] getMyHandlers() { return this.myHandlers; } ... Am I doing somthis wrong here? Please help me with this one. Kind regards, Johan --- This mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 --- This mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 --- This mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:multibox no selection (Struts 1.1b2)
Thanks for your help. It's working fine now. Kind regards -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Verzonden: vrijdag 31 januari 2003 23:03 Aan: [EMAIL PROTECTED] Onderwerp: RE: html:multibox no selection (Struts 1.1b2) You override the reset method to set unchecked value. 1. You know how many elements in your array, so instantiates your array. 2. You know the unchecked value of each element, so do a loop and set default value to each element. Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Johan Kumps [mailto:[EMAIL PROTECTED]] Sent: January 31, 2003 4:58 PM To: Struts Users Mailing List Subject: RE: html:multibox no selection (Struts 1.1b2) Sorry, Can you give an example? Johan -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Verzonden: vrijdag 31 januari 2003 22:57 Aan: [EMAIL PROTECTED] Onderwerp: RE: html:multibox no selection (Struts 1.1b2) Then set unchecked value. Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Johan Kumps [mailto:[EMAIL PROTECTED]] Sent: January 31, 2003 4:53 PM To: Struts Users Mailing List Subject: RE: html:multibox no selection (Struts 1.1b2) I do not have a default value. The user can choose between two options. He can select both checkboxes, one of both or none. What is going wrong? Johan -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Verzonden: vrijdag 31 januari 2003 22:49 Aan: [EMAIL PROTECTED] Onderwerp: RE: html:multibox no selection (Struts 1.1b2) In reset method of your ActionForm, set default value of checkbox. Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Johan Kumps [mailto:[EMAIL PROTECTED]] Sent: January 31, 2003 4:47 PM To: Struts mailing Subject: html:multibox no selection (Struts 1.1b2) Hi all, It seems that my setXxx method in my form bean is not called when I do not check any checkboxes in the multibox. Please consider following code : ... html:multibox name='configForm' property='myHandlers' bean:write name='handler'/ /html:multibox bean:write name='handler'/ ... ... private String[] myHandlers = {}; ... public void setMyHandlers (String[] myHandlers) { this.myHandlers = myHandlers; } public String[] getMyHandlers() { return this.myHandlers; } ... Am I doing somthis wrong here? Please help me with this one. Kind regards, Johan --- This mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 --- This mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 --- This mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 --- This mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:multibox question/problem
Ilya, I was fighting the same problem yesterday, and finally got it working. Here's a pretty good example from the new Struts in Action book (I found this snipet on-line). Take a look at http://husted.com/struts/tips/007.htmlhusted.com/struts/tips/007.html. --- good luck --- Larry Young At 10:47 PM 12/27/02 -0500, you wrote: Can someone point me to an example of using an html:multibox. I've posted earlier with no response:-), hoping maybe I can catch someone's attention this time. A search on google, brought up nothing useful and the two books, one by Manning, have no examples of that either. I'd like to see how to use html:multibox with values and labels, which are different. I tried an example which was the only one I found at... http://www.jguru.com/faq/view.jsp?EID=756568 but that returns an error... java.lang.NullPointerException at java.util.Hashtable.get(Hashtable.java:329) though I'm not using the Hashtable, evidentaly it requires it, though I don't understand where:-) Sorry if this is obvious. Thanks. Ilya -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Larry Young The Dalmatian Group www.dalmatian.com
Re: html:multibox question/problem
Check out http://www.husted.com/struts/ and http://www.husted.com/struts/tips. Ted has at least one tip (if memory serves) which deals specifically with using a multi-box. HTH, Eddie Sterin, Ilya wrote: Can someone point me to an example of using an html:multibox. I've posted earlier with no response:-), hoping maybe I can catch someone's attention this time. A search on google, brought up nothing useful and the two books, one by Manning, have no examples of that either. I'd like to see how to use html:multibox with values and labels, which are different. I tried an example which was the only one I found at... http://www.jguru.com/faq/view.jsp?EID=756568 but that returns an error... java.lang.NullPointerException at java.util.Hashtable.get(Hashtable.java:329) though I'm not using the Hashtable, evidentaly it requires it, though I don't understand where:-) Sorry if this is obvious. Thanks. Ilya -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: html:multibox question/problem
Thanks, I found it and testing:-) Ilya -Original Message- From: Eddie Bush [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 28, 2002 12:19 AM To: Struts Users Mailing List Subject: Re: html:multibox question/problem Check out http://www.husted.com/struts/ and http://www.husted.com/struts/tips. Ted has at least one tip (if memory serves) which deals specifically with using a multi-box. HTH, Eddie Sterin, Ilya wrote: Can someone point me to an example of using an html:multibox. I've posted earlier with no response:-), hoping maybe I can catch someone's attention this time. A search on google, brought up nothing useful and the two books, one by Manning, have no examples of that either. I'd like to see how to use html:multibox with values and labels, which are different. I tried an example which was the only one I found at... http://www.jguru.com/faq/view.jsp?EID=756568 but that returns an error... java.lang.NullPointerException at java.util.Hashtable.get(Hashtable.java:329) though I'm not using the Hashtable, evidentaly it requires it, though I don't understand where:-) Sorry if this is obvious. Thanks. Ilya -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: html:multibox values not populated in the form bean
I figured out one of my problems. Now, it calls the setter method in a form bean, but when it gets to the action class, the String[] variable for storing multibox selection is empty. Do you know what I'm missing? Thanks, Tuan -Original Message- From: Tuan H. Le Sent: Tuesday, December 03, 2002 9:42 AM To: Struts Users Mailing List (E-mail) Subject: html:multibox values not populated in the form bean Hi, I'm having a problem that the setter method in the form bean does not get called when I submit an HTML form with a html:multibox to an action class. I read some of previous related posts in the archives, but I couldn' t find a solution to this problem. Please advise on how to troubleshoot this problem. Thanks! Here's my code --- JSP code --- html:form action=/approveSubmit name=approveSubmitForm type=com.phs.ezhr.presentation.form.ApproveSubmitForm method=post target=_parent ... logic:present name=employeeList scope=session logic:iterate id=employee name=employeeList scope=session type=com.phs.ezhr.business.vo.EmployeeVO indexId=idx offset=offset length=25 td html:multibox property='approveList' value='%=employeeId%' onclick='selectChoice( this.form, this )' /html:multibox /td ... /logic:iterate /logic:present /html:form -- Generated HTML code - form name=approveSubmitForm method=post action=/focaltool/approveSubmit.do target=_parentinput type=hidden name=org.apache.struts.taglib.html.TOKEN value=3eaa663392c1d65f7d5dbcd81f5498a4 table cellspacing=0 cellpadding=0 border=0 width=100% height=100% tr td bgcolor=#F9B949 width=17nbsp;/td td valign=top table cellspacing=0 cellpadding=0 border=0 !-- Iterate over the results of the query. Max of 25 records per page -- tr td rowspan=500 width=9nbsp;/td td input type=checkbox name=approveList value=01 /td tdnbsp;nbsp;nbsp;nbsp;nbsp;/td ... Form bean -- private String[] approveList; /** * Set the approve checkbox list array * @param anApproveList */ public void setApproveList( String[] anApproveList ) { System.out.println( Setter method for approve list get called!! ); this.approveList = anApproveList; } public String[] getApproveList() { return this.approveList; } public void reset( ActionMapping mapping, HttpServletRequest request ) { } File: ATT43476.txt -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: html:multibox
This behavior is easily acheived by using radio buttons instead of checkboxes. Is that an option? David From: Tuan H. Le [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List (E-mail) [EMAIL PROTECTED] Subject: html:multibox Date: Mon, 4 Nov 2002 17:54:17 -0800 Hi, I need to pass in the select box index to a JavaScript function. Is there a way to do that in html:multibox tag?. I have tried JSP scripting (%=...%), but that does not work. I have two multiboxes in a form and I need to select/unselect the checkbox between those two multiboxes via calling my selectChoice() JS function below JavaScript: function selectChoice( field, i ) { if ( field[i].checked == true ) { // unselect other check box index } } JSP: logic:present logic:iterate id=employee name=employeeList indexId=idx length=25 offset=%= +count % tr td html:multibox property=rejectList onclick=selectChoice( this.form.rejectList, NEED TO PASS IN CHECKBOX INDEX HERE ) bean:write property=employeeId name=employee/ /html:multibox /td /tr /logic:iterate /logic:present Thanks, Tuan winmail.dat -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org _ Unlimited Internet access -- and 2 months free! Try MSN. http://resourcecenter.msn.com/access/plans/2monthsfree.asp -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: html:multibox
David, Thanks for your response! In our app, it's required to have select all and deselect all features. I'm not sure that radio buttons can fullfil this requirement. Am I right? Thanks, Tuan -Original Message- From: David Graham [mailto:dgraham1980;hotmail.com] Sent: Monday, November 04, 2002 6:00 PM To: [EMAIL PROTECTED] Subject: Re: html:multibox This behavior is easily acheived by using radio buttons instead of checkboxes. Is that an option? David From: Tuan H. Le [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List (E-mail) [EMAIL PROTECTED] Subject: html:multibox Date: Mon, 4 Nov 2002 17:54:17 -0800 Hi, I need to pass in the select box index to a JavaScript function. Is there a way to do that in html:multibox tag?. I have tried JSP scripting (%=...%), but that does not work. I have two multiboxes in a form and I need to select/unselect the checkbox between those two multiboxes via calling my selectChoice() JS function below JavaScript: function selectChoice( field, i ) { if ( field[i].checked == true ) { // unselect other check box index } } JSP: logic:present logic:iterate id=employee name=employeeList indexId=idx length=25 offset=%= +count % tr td html:multibox property=rejectList onclick=selectChoice( this.form.rejectList, NEED TO PASS IN CHECKBOX INDEX HERE ) bean:write property=employeeId name=employee/ /html:multibox /td /tr /logic:iterate /logic:present Thanks, Tuan winmail.dat -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org _ Unlimited Internet access -- and 2 months free! Try MSN. http://resourcecenter.msn.com/access/plans/2monthsfree.asp -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: html:multibox
I'm confused by what you want to do. html:multibox will be generating a bunch of checkboxes with the same name and different values like: input type=checkbox name=rejectList value=12 input type=checkbox name=rejectList value=11 input type=checkbox name=rejectList value=128 So do you have a list of checkboxes like this? Do you want 2 other checkboxes that say Select All and Deselect All? The onclick event would call your function that would loop through all form elements named rejectList and deselect/select them. David From: Tuan H. Le [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: html:multibox Date: Mon, 4 Nov 2002 18:49:56 -0800 David, Thanks for your response! In our app, it's required to have select all and deselect all features. I'm not sure that radio buttons can fullfil this requirement. Am I right? Thanks, Tuan -Original Message- From: David Graham [mailto:dgraham1980;hotmail.com] Sent: Monday, November 04, 2002 6:00 PM To: [EMAIL PROTECTED] Subject: Re: html:multibox This behavior is easily acheived by using radio buttons instead of checkboxes. Is that an option? David From: Tuan H. Le [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List (E-mail) [EMAIL PROTECTED] Subject: html:multibox Date: Mon, 4 Nov 2002 17:54:17 -0800 Hi, I need to pass in the select box index to a JavaScript function. Is there a way to do that in html:multibox tag?. I have tried JSP scripting (%=...%), but that does not work. I have two multiboxes in a form and I need to select/unselect the checkbox between those two multiboxes via calling my selectChoice() JS function below JavaScript: function selectChoice( field, i ) { if ( field[i].checked == true ) { // unselect other check box index } } JSP: logic:present logic:iterate id=employee name=employeeList indexId=idx length=25 offset=%= +count % tr td html:multibox property=rejectList onclick=selectChoice( this.form.rejectList, NEED TO PASS IN CHECKBOX INDEX HERE ) bean:write property=employeeId name=employee/ /html:multibox /td /tr /logic:iterate /logic:present Thanks, Tuan winmail.dat -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org _ Unlimited Internet access -- and 2 months free! Try MSN. http://resourcecenter.msn.com/access/plans/2monthsfree.asp -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org _ Surf the Web without missing calls! Get MSN Broadband. http://resourcecenter.msn.com/access/plans/freeactivation.asp -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: html:multibox ...again.
David, could you try the Struts test application (in struts-test.war)? It has a page that exercises the html:multibox tag, and might give you some clues about what you are doing differently. Craig Firmin David wrote: "William Jaynes" wrote: The following line in the jsp work fine as is. That is, it produces the expected html. html:multibox property="checkbox" value="%=candidate.getCandidateId()%"/ My problem occurs when the form is submitted. The "checkbox" array property in my ActionForm is not populated with the values that have been checked. I have this problem too. I get NullPointers a-plenty when I try and validate the values from the checked boxes in my bean's String[]. Anyone any ideas they might like to share as to why these fields aren't getting populated when the form is submitted? I'm clueless..! Thanks in advance... Rgds David The information in this email is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorised. If you are not an intended recipient, you must not read, use or disseminate the information contained in the email. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of The Capital Markets Company. http://www.capco.com ***