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
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;
}
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
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:
> 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?