Re: textarea and wrap
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 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 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.
RE: textarea and wrap
I have had other similar issues and I think a very useful enhancement to all Struts tags would be to make them more granular so that they could be easily sub-classed and modified. Currently methods such as doStartTag() tend to have one big lump of code which means if you want to change it behaviour you have to override it and then duplicate much of the code in the original method. An example of the kind of structure I'm looking for is below: >From the CheckboxTag: public int doStartTag() throws JspException { StringBuffer results = new StringBuffer(""); // Print this field to our output writer JspWriter writer = pageContext.getOut(); try { writer.print(results.toString()); } catch (IOException e) { throw new JspException (messages.getMessage("common.io", e.toString())); } // Continue processing this page return (EVAL_BODY_TAG); } protected String prepareName() { return " name=\""+this.property+"\""; } etc. etc. > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of > Matthias Bauer > Sent: 09 May 2001 11:38 > To: [EMAIL PROTECTED] > Subject: Re: textarea and wrap > > > I posted a bug report and sent a patch for struts on this one. I > think this was > last week. The committers decided not to include it, because the > wrap attribute > is not in the HTML spec. This is really unfortunate, escpecially > because the > little patch I already provided is just a minor change and would > be useful for > pretty many developers, I think. > > So what I am doing: I am patching struts locally. You should be > able to find my > mail with the patch in the mail-archive. > > --- Matthias > > > > 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. > > -- > > William Jaynes | University of Michigan Medical School > > [EMAIL PROTECTED] | 734-763-6751
Re: textarea and wrap
I posted a bug report and sent a patch for struts on this one. I think this was last week. The committers decided not to include it, because the wrap attribute is not in the HTML spec. This is really unfortunate, escpecially because the little patch I already provided is just a minor change and would be useful for pretty many developers, I think. So what I am doing: I am patching struts locally. You should be able to find my mail with the patch in the mail-archive. --- Matthias 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. > -- > William Jaynes | University of Michigan Medical School > [EMAIL PROTECTED] | 734-763-6751 S/MIME Cryptographic Signature