Hi Tapestry Users!

I am positive we've all had fun with enums (and netmasks) at some point!!!
I got through the afternoon accomplishing my page rendering *[1]


I now have my entity class with an enum saved.
It is a netmask for an ip address.
So if an IP address belongs in a /24 subnet, I'd like to be able to assign
it to a /32 subnet.

I would like the t:select component to only display this option (or perhaps
a /31 & /32), but not the whole range of available netmasks in my app (/24
/25 /26...../32)


How would I go about doing this (displaying certain enum values from the
type)?

Cheers for any awesome suggestions, ditto for reading!
Chris



[1]
The t:select component reads the message catalog, however rendering in a
table (not a grid) seemed to ignore it.  I progressed with it by calling a
helper method from the template with something like
${convertEnum(passedEnum)}

page class has this method

public String convertEnum(EnumType n){
    switch(n){
       case EnumType.ONE: return "Hooray One";
       case EnumType.TWO: return "Hooray Two";
       default: return "Not Set";
    }
}

Reply via email to