Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing values to form bean string array

 
Sw Kala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am unable to pass values to form bean string array from a jsp in which I have incorporated dynamically adding of textboxes in javascript.
Please do reply for my query, I need this very urgent .

I posted the query in another forum but did not get any reply
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this question about Struts form beans?? You've not mentioned it but it seems likely to me...
 
Sw Kala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I am talking about struts form bean. Can you help?
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the question is about Struts, it should be the the Struts forum. Please read this...
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there are multiple text boxes in your JSP with the same name i.e. the same value in the name attribute, then it should not be hard to transfer that to the form bean. The form bean just needs to have a String[] with the same name as the name of the text boxes...
 
Sw Kala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have given add/delete row option in the jsp. If there is single row, this is working fine. But after adding a row, I am not able to either do any validations on added textboxes or pass the values to the String array form bean variable.
code snippet:

Please help.
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please Use Code Tags when you post a source code. That way your code looks formatted. Unformatted code is hard to read. You can add code tags by wrapping your code in [code] [/code] tags. You can edit your message using button and then add code tags to it.


Here I hope that you are not applying the onchange event to the newly created input field as you are assigning the onchange event to element4 instead of element5.

As far as my limited knowledge of Struts 1.x goes, it should've worked. I can't say why it didn't work...
 
Sw Kala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Onchange event is not the issue, I am talking about how to pass value of this qty field into string array in form bean.
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this. You've posted the same question here...
 
Sw Kala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did not get any reply there....Can you help on this query??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic