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;
}
Element element = writer.element("span");
element.text(getLabelForEnum(messages, value));
writer.end(); // span
}
}
On Thu, Aug 26, 2021 at 3:31 AM Paul Stanton <[email protected]> wrote:
> 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?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
Dmitry Gusev
AnjLab Team
http://anjlab.com