You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Kennedy <ji...@gigaheads.com> on 2003/12/18 23:39:24 UTC

DynaValidatorForm and setting initial value for the html-el:text tag

I am using a DynaValidatorForm for one of my forms and would like to initialize the fields to a value that would tend to stick unless changed.  It would follow that if there were errors, any user entered value would replace the value initially set.  It should not revert back to the initial value once changed.

The values to prepopulate the form are in a bean.  However, value="${user.firstName}" inside my <html-el:text> tag does not allow newly entered values to stick.  I'm convinced this has to be possible, but I have not tripped over the right discussion thread with the answer.

Maybe something in my struts config?

Here is the code for my form-bean:

<form-bean name="userEditForm" type="org.apache.struts.validator.DynaValidatorForm">
    <form-property name="id" type="java.lang.String" initial=""/>
    <form-property name="firstName" type="java.lang.String" initial=""/>
    <form-property name="lastName" type="java.lang.String" initial=""/>
    <form-property name="email" type="java.lang.String" initial=""/>
    <form-property name="phoneNumber" type="java.lang.String" initial=""/>
    <form-property name="password" type="java.lang.String" initial=""/>
    <form-property name="passwordRetype" type="java.lang.String" initial=""/>
    <form-property name="companyId" type="java.lang.String" initial=""/>
    <form-property name="roles" type="java.lang.String" initial=""/>
</form-bean>

Thanks