The <set-property name="" value="" /> sub element of the <form-bean .../>
element does not seem to set the property of my form bean although the
Struts log statements seem to indicate it does.
I have a form with a boolean data member called "subscribe". For a
particular action mapping I would like to display the HTML checkbox element
which corresponds to the subscribe data member as "checked".
Here is the form definition in the struts-config.xml:
<form-bean name="myForm" type="com.company.actions.MyActionForm">
<set-property property="subscribe" value="true" />
</form-bean>
The Struts log (system.out):
26 14:17:19 EDT 2002] Pop org.apache.struts.action.ActionFormBean
[Fri Apr 26 14:17:19 EDT 2002] New org.apache.struts.action.ActionFormBean
[Fri Apr 26 14:17:19 EDT 2002] Set org.apache.struts.action.ActionFormBean
properties
[Fri Apr 26 14:17:19 EDT 2002] Set org.apache.struts.action.ActionFormBean
property subscribe to true
[Fri Apr 26 14:17:19 EDT 2002] Call
com.company.servlet.BaseControllerServlet.addFormBean(ActionFormBean[myForm]
)
Yet when the checkbox is rendered, it is not checked.
I placed debug statements in my mutator method and it did not print anything
to the log.
When I set the subscribe data member to true in the form constructor, the
check box renders as checked. I would like to avoid this, as I may have
situations where I want a different action mapping to use the same form, but
have the checkbox unchecked.
I'm using Struts 1.0, Apache, and ServletExec4.1, on Win2k.
I looked through the mail-archives, but I must have missed something.
robert
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>