Hi Chris,
Your suggestion works perfectly.
In the getColumnLabel() implementation, I also tried the following:
public String getColumnLabel() {
return TapestryInternalUtils.getLabelForEnum(messages,
rowElement.getColumn());
}
Like this I can use the standard properties for enums:
Column.A=LocalizedA
Column.B=LocalizedB
Thanks for the help,
Miguel
On Tue, Jul 2, 2013 at 8:08 AM, Christian Köberl <
[email protected]> wrote:
> 2013/7/1 Miguel Figueiredo <[email protected]>:
> > Hi,
> Hi
>
> > I need to add a column override that contains an enum, but I am having
> > trouble localizing it.
> >
> > For example:
> >
> > <t:grid source="datasource" row="rowElement">
> > <p:columnCell>
> > ${rowElement.column}
> > </p:columnCell>
> > </t:grid>
> >
> > My rowElement.column corresponds to an enum like:
> >
> > enum Column {
> > A, B
> > }
>
> Just create a getter in your page/component
>
> public String getColumnLabel()
> {
> return messages.get(rowElement.getColumn().name() + "-label");
> }
>
> with the corresponding labels in your properties:
> A-label=Alabel
> B-label=The "B"
>
> then you can use that in your template:
> <t:grid source="datasource" row="rowElement">
> <p:columnCell>
> ${columnLabel}
> </p:columnCell>
> </t:grid>
>
> > Best regards,
> > Miguel
>
> Cheers,
> Chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
Miguel Figueiredo
Software Developer
http://jaragua.hopto.org <http://jaragua.dyndns.org>
"I'm a pretty lazy person and am prepared to work quite hard in order to
avoid work."
-- Martin Fowler