Re: Render a single Enum value

2021-08-30 Thread Thiago H. de Paula Figueiredo
Hello! Have you tried ? This component is used by BeanDisplay and Grid for outputting property values, using the contributed display blocks to the BeanBlockSource, and uses TapestryInternalUtils.getLabelForEnum(Messages, Enum). On Wed, Aug 25, 2021 at 11:31 PM Paul Stanton wrote: > Using ${obje

Re: Render a single Enum value

2021-08-27 Thread Dmitry Gusev
You could build a custom component, e.g.: public class OutputEnum { @Inject private Messages messages; @Parameter(required = true) private Enum value; @BeginRender void begin(MarkupWriter writer) { if (value == null) { return; }

Re: Render a single Enum value

2021-08-27 Thread Nathan Quirynen
If you want a reusable solution, you could contribute your own custom binding prefix, so you can use the following in your .tml files: ${enum:object.enumValue} And then in your .properties message files: EnumName.ENUM=Enum message 1. Extend the AbstractBinding class: (maybe it can also

Re: Render a single Enum value

2021-08-27 Thread Nathan Quirynen
Or if you want a more global easy to use solution, you could contribute your own custom binding prefix, so you can use the following in your .tml files: ${enum:object.enumValue} And then in your .properties message files: EnumName.ENUM=Enum message 1. Extend the AbstractBinding class:

Re: Render a single Enum value

2021-08-25 Thread Volker Lamp
> Using ${object.enumValue} renders the enum in raw form ie ENUM1 > > How do I leverage "TapestryInternalUtils.getLabelForEnum" without having to > use a BeanDisplay or Grid etc? > > Or is there super easy way to just render the Enum value formatted without > rendering any wrapping html etc?