The Struts Action works through introspection. It doesn't know (or care)
whether the value in a form was rendered by a Struts custom tag or not.
This means if you use a standard textarea tag in your form, and give it
a name that matches a property in your form bean, Struts will use that
attribute just as if it had been rendered by a html:textarea tag. After
all, this is all the Struts html:textarea tag does.

To seed the textarea from the form bean, you could code something like 

<textarea name="article" rows="15" cols="60" wrap="soft"><bean:write
name="scriptForm" property="article"/></textarea>

And everything else will be automagical again.

What I would like to propose and contribute in the 1.1 timeframe is the
addition of a "options" attribute to all the HTML tags, so we could code
something like 

<html:textarea options="wrap=soft" rows="15" ... >

and have Struts add wrap="soft" to the tag without interpretation. This
would make all the tags extensible for non-standard properties.

William Jaynes wrote:
> 
> I usually need 'wrap="virtual"' as an attribute for my textareas. It
> isn't part of the HTML spec, but it's supported in both Netscape and IE,
> and it's pretty useful. I wonder how people are dealing with the lack of
> a "wrap" attribute in the struts textarea tag.

Reply via email to