You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Richard Doust <rd...@comcast.net> on 2002/12/23 21:52:59 UTC

embedding dynamic text in value of text field

Hi.
I have a form that wants to get the initial value for a <html:text> field
from a property of a bean associated with a different form on the page.
I have tried this:
<html:text property="userName" value="<c:out value="${foo.userName}"/>"/>
and this:
<html:text property="userName" value="${foo.userName}"/>
but obviously these won't work because, in the latter case, EL isn't being
processed in the attributes of the struts tag.
Does anyone know how I could do this?
Thanks,
Rich


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: embedding dynamic text in value of text field

Posted by David Bolsover <da...@bolsover.com>.
Hi

I'm sure there must be a better way but I have used code like this to solve
similar problem:

<% String temp = ((cast.to.object.type)pageContext.getAttribute("foo",
pageContext.PAGE_SCOPE)).getUserName(); %>
<html:text property="userName" value="<%= temp %>" />

db

> -----Original Message-----
> From: Richard Doust [mailto:rdoust@comcast.net]
> Sent: 23 December 2002 20:53
> To: struts-user@jakarta.apache.org
> Subject: embedding dynamic text in value of text field
>
>
> Hi.
> I have a form that wants to get the initial value for a <html:text> field
> from a property of a bean associated with a different form on the page.
> I have tried this:
> <html:text property="userName" value="<c:out value="${foo.userName}"/>"/>
> and this:
> <html:text property="userName" value="${foo.userName}"/>
> but obviously these won't work because, in the latter case, EL isn't being
> processed in the attributes of the struts tag.
> Does anyone know how I could do this?
> Thanks,
> Rich
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>