Well, the values shown solely depends on your model. Just filter / sort it accordingly? By default Tapestry adds all enum values to options (see EnumSelectModel). Unfortunately you can not derive from EnumSelectModel, so I would try to start from AbstractSelectModel copy and paste a few lines from EnumSelectModel and provide a filter predicate which filters results in "getOptions" according to your requirements (retrieve all, filter and return the filtered list)
Jens Von meinem iPhone gesendet > Am 31.10.2013 um 11:51 schrieb Chris Mylonas <ch...@opencsta.org>: > > 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"; > } > } --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org