The moose likes Struts and the fly likes please help me to pass form bean values to the script function Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply locked New topic
Author

please help me to pass form bean values to the script function

suresh sai
Ranch Hand

Joined: Jul 16, 2007
Posts: 62
Hi All.,

I need to pass the form bean (struts) String array values to the script function.I have tried all the ways which I know.But I didnt get the solution.Here I am showing the scenario in short.

MyForm.java
-------------

private String records[]; and their getters and setters.

MyJsp.jsp
------------
<script>
function toDoList(records)
{
..........
return true;
}
</script>
<body onloadfunction="return toDoList(records)">
<html:form>
<html:hidden property="records">
</html:form>
</body>
for this one I am getting java script error---- records undefined.
and also
<body onloadfunction="return toDoList(<%= session.getAttirbute("records")%> ">
for this one I am getting java script error---- ] expected at <body>
but the values are setting in to the bean in both ways
and in another one I am getting null like that.
Please help me to solve the problem.
Thanks in advance.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35249
    
    7
Duplicate of http://www.coderanch.com/t/57535/Struts/please-help-me-pass-form.


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: please help me to pass form bean values to the script function
 
Similar Threads
please help me to pass form bean values to the script function
JavaScript Validation in struts
How to submit multiple records in one trip
Having trouble with javascript ...
JavaScript & JSP Please help