Ernst Bunders wrote: > hi > > one question: why is the enumeration field type implemented as a > resourcebundle? i thought they were for i18n. What's the benefit?
Normally you can think of an enumeration as an option-list in html, which contains option-tags, which are key/value. The key serves as the value for the field, the value is only for display. Of course the value can be something else, depending on the locale (e.g. the state of mmservers is stored as a locale independent int, but displayed as a locale dependent description of the state). Resourcebundles are more or less the same thing: a set of i18n key/values.. The only differnce is actually that an enumeration might be ordered, and a resourcebundle is unorderd. Therefore org.mmbase.util.SortedBundle is created, which can present a ResourceBundle ordered. Use of resource-bundles for enumrations was supported in 1.7 too, you simply use the name of the resourcebundle as the 'guitype' of a field (only works I think for integers). Btw, a resource bundle is only one of the possible ways to define the enumeration. You can also state every key or key/value eplicitely. Michiel -- Michiel Meeuwissen mihxil' Peperbus 111 MediaPark H'sum [] () +31 (0)35 6772979 nl_NL eo_XX en_US _______________________________________________ Developers mailing list [email protected] http://lists.mmbase.org/mailman/listinfo/developers
