struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Kumar Saxena" <rahul.sax...@wipro.com>
Subject RE: AW: html:text initial value
Date Tue, 09 Jul 2002 13:21:30 GMT
Satish is quite right, you just call
setTextBoxPropertyName("00.00.0000"); method in the action class which
forwards to your JSP. This will take care of displaying the default
value.So you need not set 00.00.0000 in the value attribute of text
tag.Becuase this always sets the value to 00.00.0000 irrespective to the
value present in the form object. 
For the case of errors, you need not worry at all, Struts will populate
your form properly. 

<bean:define id="geburtsdatum" value="00.00.0000" /> 
<html:text property="geburtsdatum" maxlength="30" />

is same as

<html:text property="birthday" maxlength="30" value="00.00.0000" />

Only difference is that in the first, you are exposing 00.00.0000 value
as geburtsdatum variable.

Rahul.

-----Original Message-----
From: SATISH.T [mailto:satish.terala@wipro.com] 
Sent: Tuesday, July 09, 2002 6:39 PM
To: Struts Users Mailing List
Subject: Re: AW: html:text initial value


hi i meant do a form.setTextBoxPropertyName(value); in ur action class 
and 
in the jsp remove the value="" from the tag. should work. satish

----- Original Message -----
From: "Sann, Stephan" <SSann@bhw.de>
Date: Tuesday, July 9, 2002 6:32 pm
Subject: AW: html:text initial value

> Hello Satish,
> 
> > set the value of the textbox property of the form in ur action
> class
> > before u throw it and also remove the value="" from the tag if u
> want
> > to retain the value if an error is thrown.
> 
> thanx a lot for your answer.
> 
> I tried it this way:
> 
> <bean:define id="geburtsdatum" value="00.00.0000" /> <html:text 
> property="geburtsdatum" maxlength="30" />
> 
> but it didn't worked out for me :-(
> 
> 
> How can I put your tip into practice?
> 
> Thanx
> Stephan
> 
> 
> ----- Original Message -----
> From: "Sann, Stephan" <SSann@bhw.de>
> Date: Tuesday, July 9, 2002 4:05 pm
> Subject: html:text initial value
> 
> > Hello all,
> > 
> > is there a way to give an initial value to a <html:text>-tag
> that
> > is not shown again in an error-case?
> > 
> > Here is an example:
> > 
> > <html:text property="birthday" maxlength="30" value="00.00.0000" />
> > 
> > I put the initial value "00.00.0000" into this text-field to
> show
> > the user the format for the field.
> > 
> > Now there is a user who forgets the last Digit of the year:
> > 
> > > 18.04.197 <
> > 
> > Struts returns the User to the HTML-form where the birthday-
> field
> > is filled with:
> > 
> > > 00.00.0000 <
> > 
> > again. I want it to be filled with
> > 
> > > 18.04.197 <
> > 
> > again, so the user can fullfill his year.
> > 
> > 
> > I found a solution with a scriptlet, but scriptlets are not
> > allowed any more in our applications.
> > 
> > 
> > Thanx for any hints, tips, RTFM(with URL)
> > 
> > Stephan
> > 
> > --
> > To unsubscribe, e-mail:   <mailto:struts-user-
> > unsubscribe@jakarta.apache.org>For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> > 
> > 
> 
> --
> To unsubscribe, e-mail:   <mailto:struts-user-
> unsubscribe@jakarta.apache.org>For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
> 
> 


Mime
View raw message