Re: How to pass a javascript array to formbean array ?
Thank you for your help. It works fine for me! Thomas Ramapuram escribió: We do this quite often. We have a method which goes through the array and inserts the elements as new dom input objects of type hidden and name the name of the element in the form bean with an array index. eg. do this for all the properties for each element in your array and you will have them in your from bean. Frank W. Zammetti wrote: You seem to be mixing server-side and client-side concepts... if I understand you correctly, you have a Javascript array ON THE CLIENT that you want to populate in the form bean ON THE SERVER. If that's not correct, could you explain it further? If that is correct, you need to pass the array back to the server as part of your form submission (or AJAX request, if your going that route). Rememeber that at the point your JSP is evaluated, it's on the server, and Javascript has not executed yet. Seems like you might be making that mistake, although I'm not sure. Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to pass a javascript array to formbean array ?
We do this quite often. We have a method which goes through the array and inserts the elements as new dom input objects of type hidden and name the name of the element in the form bean with an array index. eg. do this for all the properties for each element in your array and you will have them in your from bean. Frank W. Zammetti wrote: You seem to be mixing server-side and client-side concepts... if I understand you correctly, you have a Javascript array ON THE CLIENT that you want to populate in the form bean ON THE SERVER. If that's not correct, could you explain it further? If that is correct, you need to pass the array back to the server as part of your form submission (or AJAX request, if your going that route). Rememeber that at the point your JSP is evaluated, it's on the server, and Javascript has not executed yet. Seems like you might be making that mistake, although I'm not sure. Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to pass a javascript array to formbean array ?
You seem to be mixing server-side and client-side concepts... if I understand you correctly, you have a Javascript array ON THE CLIENT that you want to populate in the form bean ON THE SERVER. If that's not correct, could you explain it further? If that is correct, you need to pass the array back to the server as part of your form submission (or AJAX request, if your going that route). Rememeber that at the point your JSP is evaluated, it's on the server, and Javascript has not executed yet. Seems like you might be making that mistake, although I'm not sure. Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of "Practical Ajax Projects With Java Technology" (2006, Apress, ISBN 1-59059-695-1) and "JavaScript, DOM Scripting and Ajax Projects" (2007, Apress, ISBN 1-59059-816-4) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! On Tue, May 15, 2007 2:53 pm, Aviskaos wrote: > Sorry the var name in the jsp is > var myArray = new Array() > > > > Aviskaos escribió: >> Hi! >> In my formbean i have this property: >> private String[] values; >> >> public String[] getValues() { >> return values; >> } >> >> public void setValues(String[] values) { >> this.values = values; >> } >> >> Late, in my jsp, i have a global javascript var, an array: >> var myValues = new Array(); >> >> that i populate correctly, whit the same dimension, and then when i do >> the submit, i want to do this: >> document.myformbean.values = myArray >> >> But that doesnt work. I try this so: >> document.myformbean.values.value = myArray >> and lots of combinations, but nothing. I got a null pointer. >> >> Is this possible ? >> How could i do this correctly ? >> >> Thank you very much ! > > > - > 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: How to pass a javascript array to formbean array ?
Sorry the var name in the jsp is var myArray = new Array() Aviskaos escribió: Hi! In my formbean i have this property: private String[] values; public String[] getValues() { return values; } public void setValues(String[] values) { this.values = values; } Late, in my jsp, i have a global javascript var, an array: var myValues = new Array(); that i populate correctly, whit the same dimension, and then when i do the submit, i want to do this: document.myformbean.values = myArray But that doesnt work. I try this so: document.myformbean.values.value = myArray and lots of combinations, but nothing. I got a null pointer. Is this possible ? How could i do this correctly ? Thank you very much ! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to pass a javascript array to formbean array ?
Hi! In my formbean i have this property: private String[] values; public String[] getValues() { return values; } public void setValues(String[] values) { this.values = values; } Late, in my jsp, i have a global javascript var, an array: var myValues = new Array(); that i populate correctly, whit the same dimension, and then when i do the submit, i want to do this: document.myformbean.values = myArray But that doesnt work. I try this so: document.myformbean.values.value = myArray and lots of combinations, but nothing. I got a null pointer. Is this possible ? How could i do this correctly ? Thank you very much ! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]