To each his own I guess.

If you want to retain a value, such as an id for a row, but only allow
read-only access to it.
Don't use html:text with disabled, it doesn't work in NS 4.7 and a few
others.

You can use html:hidden and it will:
  a) create a <hidden name="blah blah"....
  b) write out the value in plain text (you just can't get more
     'read-only' than that)
  c) when the form is submitted, because you had a hidden form field, struts
     will re-populate that field correctly for you.

Like I said before, if you don't care to retain the value.....use bean:write


James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://www.open-tools.org/struts-atlanta




> -----Original Message-----
> From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 23, 2002 1:27 PM
> To: 'Struts Users Mailing List'
> Subject: RE: How to write an ActionForm property as just plain text
>
>
> You're just trying to write out the property as text?  Why mess
> around with
> <html:hidden>?  Like I said, <bean:write> works perfectly fine.
> http://jakarta.apache.org/struts/userGuide/struts-bean.html
>
>
> ~ Keith
> http://www.buffalo.edu/~kkamholz
>
>
>
> -----Original Message-----
> From: David Wood [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 24, 2002 1:24 AM
> To: Struts Users Mailing List
> Subject: Re: How to write an ActionForm property as just plain text
>
>
> html:hidden seems to only support name, property, and value attributes
>
> Are you sure that hidden has a setting to write out as text?
>
> -- dave
>
> James Mitchell wrote:
>
> >Take a look at the html:hidden tag, there's an attribute to
> specify having
> >the text written.
> >
> >Example:
> ><html:hidden property="someField" write="true"/>
> >
> >James Mitchell
> >Software Engineer\Struts Evangelist
> >Struts-Atlanta, the "Open Minded Developer Network"
> >http://www.open-tools.org/struts-atlanta
> >
> >
> >
> >
> >
> >
> >>-----Original Message-----
> >>From: David Wood [mailto:[EMAIL PROTECTED]]
> >>Sent: Wednesday, July 24, 2002 1:00 AM
> >>To: [EMAIL PROTECTED]
> >>Subject: How to write an ActionForm property as just plain text
> >>
> >>
> >>Suppose you wanted to have an entry screen, then a confirmation screen.
> >>The entry screen could have one field (email address) for example.  In
> >>my jsp, I'll use <html:text property="email> to accomplish this.
> >>
> >>The user enters an email address and submits the form.  I want the
> >>Action to then forward the request to a confirmation page.  On that
> >>page, I want to just write out the email address they entered.  I could
> >>use <html:text property="email" disabled="true"> to put a disabled text
> >>box, and struts would fill in the value of the email address.  But, what
> >>if you want to just put out the email address in plain text?
> >>
> >>Is there an easy way to do this?  I managed to accomplish this by
> >>creating my own tag <custom:text property="email">.  I created a custom
> >>TextTag class that extends BaseInputTag, looks up the property and
> >>writes it out.  This works, but it seems like there should be a better
> >>way of doing this.  Is there a better way?  How have others approached
> >>this problem?
> >>
> >>TIA
> >>
> >>-- Dave
> >>
> >>
> >>--
> >>To unsubscribe, e-mail:
> >>
> >>
> ><mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail:
> ><mailto:[EMAIL PROTECTED]>
> >
> >
> >
> >--
> >To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



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

Reply via email to