Hi Baptiste, Actually I don't have a solution for your problem, but a way around it. :) Try using the I18n-Transformer and supply the Strings to be displayed as I18n-messages (key is the full qualified name of your Enumeration-Elements).
<message key="your.package.Tyappli.SPC">whatevermeansSPC</message> http://cocoon.apache.org/2.1/userdocs/i18nTransformer.html If anyone knows a cleaner way to do it, feel free to correct me! Greetings, Franzi > -----Ursprüngliche Nachricht----- > Von: Baptiste Placé [mailto:[EMAIL PROTECTED] > Gesendet: Mittwoch, 9. Mai 2007 17:38 > An: [email protected] > Betreff: Enumerated datatype with selection lists. > > Hi, > > I want to use an enumerated type for the different options of my > selection list. My problem is that the label of the options is always > the full qualified name of the enum type. > My toString() function is not used :( > As indicated on the Datatypes part of CForms, I have the following code : > > - Form definition : > <fd:field id="procedure_type" required="true"> > <fd:datatype base="enum"> > <fd:convertor type="enum"> > > <fd:enum>org.epoline.soprano.visualisation.customModel.Tyappli</fd:enum> > </fd:convertor> > </fd:datatype> > <fd:selection-list type="enum" > class="org.epoline.soprano.visualisation.customModel.Tyappli"/> > </fd:field> > > - Tyappli.class (simplified) : > public class Tyappli { > > public static final Tyappli NATIONAL = new Tyappli("National", new > Short("1")); > public static final Tyappli SPC = new Tyappli("Statistical Process > Control", new Short("4")); > > private String descr; > > private Tyappli(String descr, Short dbInt) { > this.descr = descr; > this.dbShort = dbInt; > } > > @Override > public String toString() { > return descr; > } > > public static Tyappli fromString(String value) { ... } > } > > > I keep having this large selection list with e.g. > org.epoline.soprano.visualisation.customModel.Tyappli.NATIONAL as option. > Any idea what am I missing for this to work ? > > -Baptiste > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
