Re: How to pass a javascript array to formbean array ?

2007-05-16 Thread Aviskaos

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.

input type=hidden name=myelement[0].name value=Name /
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]



How to pass a javascript array to formbean array ?

2007-05-15 Thread Aviskaos

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]



Re: How to pass a javascript array to formbean array ?

2007-05-15 Thread Aviskaos

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]