cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danny Bols" <db...@osirion.be>
Subject RE: JxTemplate indirect evaluation of expressions
Date Mon, 17 May 2004 12:07:42 GMT
A simple usecase could be where a user enters a name of a property in a form
and where the JxTemplate is used to show the value of that property. For
instance:

In flow/form:
form.widget("propertyname").setValue("customer.name");


In jxtemplate:
evaluate
  <jx:eval select="${form.propertyname}">
as if i was writing this...
  <jx:out value="${customer.name}">

--
Danny

> -----Original Message-----
> From: H.vanderLinden@MI.unimaas.nl [mailto:H.vanderLinden@MI.unimaas.nl]
> Sent: maandag 17 mei 2004 12:57
> To: users@cocoon.apache.org
> Subject: RE: JxTemplate indirect evaluation of expressions
>
>
> Hmm, could you give an example? I cannot think of one.
> I sometimes use a choose, to decide which property to use, but
> that is only
> feasible when the number of choices is small (otherwise the code becomes
> unmanageable).
>
> Bye, Helma
>
> > -----Original Message-----
> > From: Danny Bols [mailto:dbols@osirion.be]
> > Sent: Monday, 17 May 2004 09:31
> > To: users@cocoon.apache.org
> > Subject: RE: JxTemplate indirect evaluation of expressions
> >
> >
> > I guess I need to clarify my use case. In my situation I do
> > not know the name of the property at compile-time, only at
> > run-time. That is why I need indirect evaluation.
> > --
> > Danny
> >
> > > -----Original Message-----
> > > From: H.vanderLinden@MI.unimaas.nl
> > > [mailto:H.vanderLinden@MI.unimaas.nl]
> > > Sent: maandag 17 mei 2004 9:04
> > > To: users@cocoon.apache.org
> > > Subject: RE: JxTemplate indirect evaluation of expressions
> > >
> > >
> > > I'm not 100% sure, but I don't think so, but you could
> > always rewrite
> > > it to:
> > >
> > > <jx:forEach var="customer" items="${customers}">
> > >  <jx:set var="myProperty" value="${customer.name}"/>
> > >    evaluate this...
> > >       ${myProperty}
> > > </jx:forEach>
> > >
> > >
> > > HTH.
> > >
> > > Bye, Helma
> > >
> > > > -----Original Message-----
> > > > From: Danny Bols [mailto:dbols@osirion.nl]
> > > > Sent: Friday, 14 May 2004 22:38
> > > > To: Cocoon Users
> > > > Subject: JxTemplate indirect evaluation of expressions
> > > >
> > > >
> > > > Is this kind of indirect evaluation possible in a jx-template?
> > > >
> > > > <jx:set var="myProperty" value="customer.name"/>
> > > >
> > > > <jx:forEach var="customer" items="${customers}">
> > > >
> > > >   evaluate this...
> > > >      ${myProperty}
> > > >   as if i was writing this...
> > > >      ${customer.name}
> > > >
> > > > </jx:forEach>
> > > >
> > > > --
> > > > Danny
> > > >
> > > >
> > > >
> > --------------------------------------------------------------------
> > > > -
> > > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > > For additional commands, e-mail: users-help@cocoon.apache.org
> > > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > For additional commands, e-mail: users-help@cocoon.apache.org
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message