tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bauer, Paul-Michael" <PBa...@LNC.com>
Subject RE: Dynamic ognl property names
Date Thu, 20 Jan 2005 19:41:48 GMT
You could define a method on your page class like so:

public String nameMeSomethingUseful(String property) {
	DynaBean dynaBean = new WrapDynaBean( getBean() );
	return dynaBean.get(property).toString();
}

Then in your template:

----
<span jwcid="@Insert" value="ognl:nameMeSomethingUseful(field)" />
----

Alternatively, you could define a WrapDynaBean in your page
specification and skip the nameMeSomething... method.  Then the template
could be

----
<span jwcid="@Insert" value="ognl:beans.dynaBean.get(field)" /> 
----

I haven't tested either of these...just what came to mind.


-----Original Message-----
From: Eric Everman [mailto:everman@precedadesign.com] 
Sent: Thursday, January 20, 2005 2:28 PM
To: Tapestry users
Subject: Dynamic ognl property names

Hi-

How do I refer to a dynamic ognl property name?  For instance, I have a 
Foreach that iterates over a list of property names as:

       <div class="info" jwcid="@Foreach" source="ognl:rfields" 
value="ognl:field" element="div">
         <span><span jwcid="@Insert" value="ognl:bean.[The property 
whose name is contained in the 'field' property]" /></span>
       </div>

Any hints?

Thanks in advance,
Eric Everman


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



DISCLAIMER:
**This E-mail and any of its attachments may contain Lincoln National Corporation proprietary
information, which is privileged, confidential, or subject to copyright belonging to the Lincoln
National Corporation family of companies. This E-mail is intended solely for the use of the
individual or entity to which it is addressed. If you are not the intended recipient of this
E-mail, you are hereby notified that any dissemination, distribution, copying, or action taken
in relation to the contents of and attachments to this E-mail is strictly prohibited and may
be unlawful. If you have received this E-mail in error, please notify the sender immediately
and permanently delete the original and any copy of this E-mail and any printout. Thank You.**

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Mime
View raw message