If you really want this feature then you can write a custom binding prefix.
It can work exactly as you want

> I'm trying to steer our team away from embedding style and formatting in
Java code

Well, you need to either do it in the template or in the Java code. Both
the template and the component class are for presentation logic so I don't
see a problem putting it there. The added benefit is its easier to test.

Horses for courses I guess...
 On 17 May 2014 00:00, "Aristedes Maniatis" <a...@ish.com.au> wrote:

> Lance Java wrote:
> > I'm not sure how you have assumed that tapestry knows how understand a
> "format:" binding prefix. Certainly none of the tapestry documentation
> mentions it?
>
> I was trying to extrapolate from this:
> http://wiki.apache.org/tapestry/Tapestry5HowToFormatDateTimeEtc
>
> Really, I wasn't hopeful it would work so much as provide an example for
> what I'm trying to accomplish.
>
>
> > The simple solution is to provide a getter for the formatted date String.
>
>
> This is the exact thing I am trying to avoid. Our development team has
> dozens of formatted strings scattered through Java and every time a design
> change requires a small formatting alteration we have to rebuild the
> application.
>
> I am not a tapestry expert, but I'm trying to steer our team away from
> embedding style and formatting in Java code and instead make it easily
> customisable in the tml files. In Rails, I'd do this no matter whether this
> was in an element or attribute:
>
> <%= someDate.strftime("%m/%d/%Y") %>
>
>
> In Spring/jstl I think there is <fmt:formatDate>.
>
>
> Cheers
> Ari
>
>
>
>
>
> On 14/05/2014 4:24pm, Aristedes Maniatis wrote:
> > I understand that I can do this in the tml:
> >
> >     <span itemprop="startDate"><t:output value="someDate"
> format="literal:YYYY-MM-DD hh:mm:ss 'UTC' Z"></span>
> >
> >
> > But I want to put the value into an attribute to suit a Google schema
> microformat, like this:
> >
> > <abbr itemprop="startDate" content="${format:date=YYYY-MM-DD hh:mm:ss
> 'UTC' Z,someDate}" title="">
> >
> >
> > This does not work. What am I missing here?
> >
> >
> > Ari Maniatis
> >
> >
>
> --
> -------------------------->
> Aristedes Maniatis
> ish
> http://www.ish.com.au
> Level 1, 30 Wilson Street Newtown 2042 Australia
> phone +61 2 9550 5001   fax +61 2 9550 4001
> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

Reply via email to