You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Lo...@aol.com on 2003/04/18 23:00:40 UTC
DynaActionForm property
Hi,
I need to generate Javascript on the fly (the javascript code will vary depending on conditions). I do this within an Action. I use a DynaActionForm (MyForm) in the app, and thought I could eliminate some coding by doing the following:
1. In MyAction (extends ForwardAction)
- Create a String (jsCode) containing all the javascript functions for the page.
- dynaform.set("jsCode", jsCode)
2. In the jsp page, I use:
<bean:write name="MyForm" property="jsCode"/>
This works when I have "jsCode" defined as a <form-property>. However, since I have a ton of jsp's I don't want to create a form-property for each jsp's javascript.
So I removed the <form-property>jsCode, since I thought that the dynaform.set would allow subsequent access. But I get an error "No getter method for property jsCode of bean MyForm" after the action forwards to the Jsp.
If I replace the <bean:write> with a dummy javascript function, so that I can proceed, I see the property in the form (using the Eclipse debugger).
I'd appreciate someone's insight to this.
Thanks,
-Lou
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org