Re: DropDownChoice with Java Enum

2009-09-11 Thread Pedro Santos
t;> > >> >> Matthias Keller wrote: > >> >> > >> >>> Hi Charles > >> >>> > >> >>> No problem. Just make an IChoiceRenderer which calls getDescription > >> for > >> >>> the display value and g

Re: DropDownChoice with Java Enum

2009-09-10 Thread cmoulliard
arles Moulliard wrote: >> >>> >> >>>> Hi, >> >>>> >> >>>> I would like to know if I can create a DropDownChoice where the >> value >> >>>> to >> >>>> be >> >>>> displayed

Re: DropDownChoice with Java Enum

2009-09-10 Thread Pedro Santos
(e.g. Accepted) while the value to be returned is the > value > >>>> defined in the enumeration (e.g: ACCPT) ? > >>>> > >>>> public enum ProcessingStatusType { > >>>> NEW ("NEW", "New"), > >>>> A

Re: DropDownChoice with Java Enum

2009-09-10 Thread cmoulliard
>> public enum ProcessingStatusType { >>>> NEW ("NEW", "New"), >>>> ACCEPTED ("ACCPT", "Accepted"), >>>> VALIDATED ("VALID", "Validated"), >>>> TRANSFORMED("TRFRM", "Transformed"), >>&

Re: DropDownChoice with Java Enum

2009-09-10 Thread Johannes Schneider
You cast objDispl to String which is obviously(?) a ProcessingStatusType cmoulliard wrote: > You mean create something like this : > > add(new DropDownChoice("requestStatus", > Arrays.asList(ProcessingStatusType.values()), new IChoiceRenderer() { > > public Object getDis

Re: DropDownChoice with Java Enum

2009-09-10 Thread Matthias Keller
Hi Close but not quite. getDisplayValue gets the catual ELEMENT of the list - so objDispl is of type ProcessingStatusType already. So in your case it would be something like: public Object getDisplayValue(Object objDispl) { return ((ProcessingStatusType) objDispl).getDescription(); }

Re: DropDownChoice with Java Enum

2009-09-10 Thread Pedro Santos
quot;, "Failed"); > >> > >> private final String value; > >> private final String description; > >> > >> ProcessingStatusType( String value, String description ) { > >> this.value = value; > >

Re: DropDownChoice with Java Enum

2009-09-10 Thread Martin Makundi
ot;), >>>     TRANSFERRED("TRFRD", "Transferred"), >>>     REJECTED("REJEC", "Rejected"), >>>     FAILED("FAIL", "Failed"); >>> >>>     private final String value; >>>     private final String description; >>> >>

Re: DropDownChoice with Java Enum

2009-09-10 Thread cmoulliard
gt; ProcessingStatusType( String value, String description ) { >> this.value = value; >> this.description = description; >> } >> >> > > > > - Charles Moulliard SOA Architect My Blog : http://cmoulliard.blogspot.com/

Re: DropDownChoice with Java Enum

2009-09-10 Thread Matthias Keller
Hi Charles No problem. Just make an IChoiceRenderer which calls getDescription for the display value and getValue for the id. Matt Charles Moulliard wrote: Hi, I would like to know if I can create a DropDownChoice where the value to be displayed in the drop down list corresponds to the desc

DropDownChoice with Java Enum

2009-09-10 Thread Charles Moulliard
Hi, I would like to know if I can create a DropDownChoice where the value to be displayed in the drop down list corresponds to the description of my enumeration (e.g. Accepted) while the value to be returned is the value defined in the enumeration (e.g: ACCPT) ? public enum ProcessingStatusType {