Hello Everyone:

I've come across an interesting issue that I'd like to share with everyone
with the hopes that someone might be able to provide an explanation or
solution.

I have a form with a bunch of text fields. One of these fields I want to
have disabled (disabled="true"). So using the struts tag library I have the
following:

<html:text property="role" size="16" maxlength="16" disabled="true" />

When I first load this form, everything is prepopulated as it should be in
the form. I submit the form leaving some fields blank so that I can ensure
my validation works. The validation works fine as the I am redirected back
to the form with the appropriate error messages. However, the text field
mentioned above (role), is no longer prepopulated. Everything else is except
that text field. I took out the disabled="true" and submitted the form again
and the next time around the text field WAS prepopulated. I put back
disabled="true" and the field WAS NOT prepopulated. So I realized that
disabled="true" is causing a glitch somewhere.

After scratching my head for a while I decided to put the Visual Age
Debugger to use to see if I could see what was going on. This is what I
found out:

When I go to the form the very first time, the setRole(String role) method
in my form bean is getting called and therefore that property gets set. But
when I submit the form and I have disabled="true" in the text field, the
setRole(String role) method never gets called therefore the property never
gets set. A very interesting thing is that I looked inside the request
object with the VAJ debugger and the role parameter is not there when I
submit my form to my validation action with disabled="true" in the text
field. When I took out the disabled="true" the role parameter was inside the
request. So the problem boils down to the fact that the parameter is not
included in the request object when using disabled="true" and therefore does
not get set.

If anyone has seen this problem and has a fix or suggestion, please let me
know.

Thanks in advance

**********************************************
Juan Alvarado
Internet Developer -- Manduca Management
(786)552-0504
[EMAIL PROTECTED]
AOL Instant Messenger: [EMAIL PROTECTED]


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to