That's it, thank you. <s:set var="len" value="requestDefinition == null ? 1 : ( requestDefinition.length() > 49 ? requestDefinition.length() / 50 : 1 )" /> <s:textarea label="Request Definition" name="requestDefinition" labelSeparator="" labelposition="left" readonly="true" cols="80" rows="%{#len}" />
Jim -----Original Message----- From: Wes Wannemacher [mailto:w...@wantii.com] Sent: 04 February 2010 20:08 To: Struts Users Mailing List Subject: Re: Dynamic values for rows attribute of s:textarea If you're calculating your value with s:set and setting a variable called, "len" did you try the following - <s:textarea label="Request Definition" name="requestDefinition" labelSeparator="" labelposition="left" readonly="true" cols="80" rows="%{#len}" /> On Thu, Feb 4, 2010 at 2:27 PM, Jim Talbut <jim.tal...@groupgti.com> wrote: > Hi, > > I have: > <s:textarea label="Request Definition" > name="requestDefinition" labelSeparator="" labelposition="left" > readonly="true" cols="80" rows="5" /> > Sometimes I have a LOT of data to display in the box, other times I have none > at all. > I'd like the box to resize based on the amount of data. > > My best effort involved getting the length of requestDefinition (using > s:set), calculating a decent row count based on that and then trying to set > the rows="<%=len%>" > Unfortunately that's against the DTD and struts blows up. > > Apart from a long series of ugly s:if elements is there any way to get a > dynamic rowcount? > > I may resort to use javascript, but that'd be quite a faff (these textareas > are in a series of forms generated by an iterator). > > Thanks > > Jim > > -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org