We never really use much of the expression language, so I can't comment on
that.

This is just a comment on the last example: I'm not sure that you need a
@Property when using the "var:" prefix (if you have a backing property it
ought to be a "prop:" binding, as far as I understand)

-- 
Chris



On Wed, May 26, 2021 at 12:00 PM Numa Schmeder <n...@dfacto.ch> wrote:

> Hello,
>
> It seems method with varargs doesn’t work with property expression.
> If I put the following property expression, I get an error: Message
> doesn’t have a public “format" method.
> ${messages.format('priceFromPerGuest', travelMinPricePerGuest,
> displayedCurrency)}
> But If I write it as follow is works:
> messages.format('priceFromPerGuest', [travelMinPricePerGuest,
> displayedCurrency])
>
> Is this a bug ?
>
> Tapestry property expression is a bit limiting, particularly in conditions
> where you can’t have logical expression as:  test=“size > 10”
>
> I know the rational is to keep property expression as simple as possible,
> but having some logic expressed in the template is not that bad, because
> it’s in context ans sometimes makes more sense than having everything in
> java code.
>
> Also if you work a lot with collection of objects, you have to create a
> property for each type of element in the collections, the “var” keyword is
> not powerful to be used in complex property expressions.
> Exemple, this won’t work, but it would be very practical:
> <t:loop source=“countries” value=“var:country”>
>         ${var:country.getName(locale)} - ${getPopulation(var:country)}
> </t:loop>
>
> And if you use a generic property tempValue that you could reuse in
> different places, it won’t work because all conduits will be based on the
> Object Type and not Country type.
>
> @Property
> Object tempValue
>
> <t:loop source=“countries” value=“var: tempValue”>
>         ${tempValue.getName(locale)} - ${getPopulation(tempValue)}
> </t:loop>
>
> Could we find a solution to avoir creating a lot of fields for all loops ?
>
> Thank you for your help,
>
> Best!
>
>
>   <http://www.dfacto.ch/>       Numa Schmeder    www.dfacto.ch  <
> http://www.dfacto.ch/>
> n...@dfacto.ch <mailto:n...@dfacto.ch>   |   M +41 79 538 30 01
>
> DIGITAL STRATEGY   |   DESIGN   |   DEVELOPMENT
>
>
>
>
>

Reply via email to