You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dennis Hoer <de...@gmail.com> on 2006/02/17 18:43:54 UTC
write el equivilent
I'm trying to write out the text of a string instead of creating a
form text object where the property dynamically gets the name of the
field. I tried the following but there is no bean write el
equivilent:
<!-- this works-->
<html-el:text name="myBean"
property="myNestedBean.${displayData.methodName}"
size="${displayData.NLength}"/>
<!-- this doesnt work-->
<bean:write name="myBean"
property="myNestedBean.${displayData.methodName}"/>
Is there tag lib out there that can do this or a different way to do this?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: write el equivilent
Posted by Dennis Hoer <de...@gmail.com>.
I wish that was the case. I don't know what field from the bean I
will retrieve until runtime. For example: in the html-el:text example
below, it first gets the value of displayData.property which, lets say
is 'myField1', then retrieves the myBean.myNestedBean.myField1. My
problem now is how do I get that behavior when I just want to display
text and not a form object?
Any ideas are welcome.
On 2/17/06, Keith Sader <ks...@gmail.com> wrote:
> I think you need ${} around the whole expression.
>
> ${myBean.myNestedBean.displayData.property}
>
>
> On 2/17/06, Dennis Hoer <de...@gmail.com> wrote:
> > Tried
> > <c:out value="myBean.myNestedBean.${displayData.methodName}"/>
> >
> > and it resolves to a string
> > "myBean.myNestedBean.methodX"
> >
> > I also tried
> > <c:set var="temp" value="myBean.myNestedBean.${displayData.methodName}"/>
> > <c:out value="${temp}"/>
> >
> > and get the same thing. I need the result of the string to be
> > resolved after the method name is returned.
>
> --
> Keith Sader
> ksader@gmail.com
> http://www.saderfamily.org/roller/page/ksader
> http://www.jroller.com/page/certifieddanger
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: write el equivilent
Posted by Dennis Hoer <de...@gmail.com>.
How would I display the text equivilent of a selected value in a dropdown box?
On 2/17/06, Laurie Harper <la...@holoweb.net> wrote:
> That would have a rather different meaning. Closer would be
>
> <c:out value="${myBean.myNestedBean[displayData.methodName]}"/>
>
> 'methodName' is suspicious, though. Are you trying to invoke a method,
> or retrieve a property? You can't invoke arbitrary methods with EL.
> 'methodName' means 'call the method named getMethodName'.
>
> L.
>
> Keith Sader wrote:
> > I think you need ${} around the whole expression.
> >
> > ${myBean.myNestedBean.displayData.property}
> >
> >
> > On 2/17/06, Dennis Hoer <de...@gmail.com> wrote:
> >> Tried
> >> <c:out value="myBean.myNestedBean.${displayData.methodName}"/>
> >>
> >> and it resolves to a string
> >> "myBean.myNestedBean.methodX"
> >>
> >> I also tried
> >> <c:set var="temp" value="myBean.myNestedBean.${displayData.methodName}"/>
> >> <c:out value="${temp}"/>
> >>
> >> and get the same thing. I need the result of the string to be
> >> resolved after the method name is returned.
> >
> > --
> > Keith Sader
> > ksader@gmail.com
> > http://www.saderfamily.org/roller/page/ksader
> > http://www.jroller.com/page/certifieddanger
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: write el equivilent
Posted by Dennis Hoer <de...@gmail.com>.
That worked! Thanks so much.
On 2/17/06, Laurie Harper <la...@holoweb.net> wrote:
> That would have a rather different meaning. Closer would be
>
> <c:out value="${myBean.myNestedBean[displayData.methodName]}"/>
>
> 'methodName' is suspicious, though. Are you trying to invoke a method,
> or retrieve a property? You can't invoke arbitrary methods with EL.
> 'methodName' means 'call the method named getMethodName'.
>
> L.
>
> Keith Sader wrote:
> > I think you need ${} around the whole expression.
> >
> > ${myBean.myNestedBean.displayData.property}
> >
> >
> > On 2/17/06, Dennis Hoer <de...@gmail.com> wrote:
> >> Tried
> >> <c:out value="myBean.myNestedBean.${displayData.methodName}"/>
> >>
> >> and it resolves to a string
> >> "myBean.myNestedBean.methodX"
> >>
> >> I also tried
> >> <c:set var="temp" value="myBean.myNestedBean.${displayData.methodName}"/>
> >> <c:out value="${temp}"/>
> >>
> >> and get the same thing. I need the result of the string to be
> >> resolved after the method name is returned.
> >
> > --
> > Keith Sader
> > ksader@gmail.com
> > http://www.saderfamily.org/roller/page/ksader
> > http://www.jroller.com/page/certifieddanger
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: write el equivilent
Posted by Laurie Harper <la...@holoweb.net>.
That would have a rather different meaning. Closer would be
<c:out value="${myBean.myNestedBean[displayData.methodName]}"/>
'methodName' is suspicious, though. Are you trying to invoke a method,
or retrieve a property? You can't invoke arbitrary methods with EL.
'methodName' means 'call the method named getMethodName'.
L.
Keith Sader wrote:
> I think you need ${} around the whole expression.
>
> ${myBean.myNestedBean.displayData.property}
>
>
> On 2/17/06, Dennis Hoer <de...@gmail.com> wrote:
>> Tried
>> <c:out value="myBean.myNestedBean.${displayData.methodName}"/>
>>
>> and it resolves to a string
>> "myBean.myNestedBean.methodX"
>>
>> I also tried
>> <c:set var="temp" value="myBean.myNestedBean.${displayData.methodName}"/>
>> <c:out value="${temp}"/>
>>
>> and get the same thing. I need the result of the string to be
>> resolved after the method name is returned.
>
> --
> Keith Sader
> ksader@gmail.com
> http://www.saderfamily.org/roller/page/ksader
> http://www.jroller.com/page/certifieddanger
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: write el equivilent
Posted by Keith Sader <ks...@gmail.com>.
I think you need ${} around the whole expression.
${myBean.myNestedBean.displayData.property}
On 2/17/06, Dennis Hoer <de...@gmail.com> wrote:
> Tried
> <c:out value="myBean.myNestedBean.${displayData.methodName}"/>
>
> and it resolves to a string
> "myBean.myNestedBean.methodX"
>
> I also tried
> <c:set var="temp" value="myBean.myNestedBean.${displayData.methodName}"/>
> <c:out value="${temp}"/>
>
> and get the same thing. I need the result of the string to be
> resolved after the method name is returned.
--
Keith Sader
ksader@gmail.com
http://www.saderfamily.org/roller/page/ksader
http://www.jroller.com/page/certifieddanger
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: write el equivilent
Posted by Dennis Hoer <de...@gmail.com>.
Tried
<c:out value="myBean.myNestedBean.${displayData.methodName}"/>
and it resolves to a string
"myBean.myNestedBean.methodX"
I also tried
<c:set var="temp" value="myBean.myNestedBean.${displayData.methodName}"/>
<c:out value="${temp}"/>
and get the same thing. I need the result of the string to be
resolved after the method name is returned.
On 2/17/06, Niall Pemberton <ni...@blueyonder.co.uk> wrote:
> How about <c:out> ?
>
> Niall
>
> ----- Original Message -----
> From: "Dennis Hoer" <de...@gmail.com>
> Sent: Friday, February 17, 2006 5:43 PM
>
>
> I'm trying to write out the text of a string instead of creating a
> form text object where the property dynamically gets the name of the
> field. I tried the following but there is no bean write el
> equivilent:
>
> <!-- this works-->
> <html-el:text name="myBean"
> property="myNestedBean.${displayData.methodName}"
> size="${displayData.NLength}"/>
>
> <!-- this doesnt work-->
> <bean:write name="myBean"
> property="myNestedBean.${displayData.methodName}"/>
>
> Is there tag lib out there that can do this or a different way to do this?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: write el equivilent
Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
How about <c:out> ?
Niall
----- Original Message -----
From: "Dennis Hoer" <de...@gmail.com>
Sent: Friday, February 17, 2006 5:43 PM
I'm trying to write out the text of a string instead of creating a
form text object where the property dynamically gets the name of the
field. I tried the following but there is no bean write el
equivilent:
<!-- this works-->
<html-el:text name="myBean"
property="myNestedBean.${displayData.methodName}"
size="${displayData.NLength}"/>
<!-- this doesnt work-->
<bean:write name="myBean"
property="myNestedBean.${displayData.methodName}"/>
Is there tag lib out there that can do this or a different way to do this?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org