Try item. SetValue(cos) instead of item. SetValue("" + cos.ordinal()).
This did solve the problem. Thank you. – Shamik Mar 30 '10 at 22:07 Weird, the getAsString() of your converter does exactly the same.
– BalusC Mar 30 '10 at 22:09 Ah I see, the root cause is that the converter returns a fullworthy COSOptionType instead of "" + cos.ordinal() in getAsObject(), which thus don't appear at all in the existing options. – BalusC Mar 30 '10 at 22:15 Yes thats the issue. Thanks BalusC for explaining.
– Shamik Mar 30 '10 at 13:21.
The root cause is that the converter returns a fullworthy COSOptionType object instead of the string "" + cos.ordinal() in getAsObject(), which thus don't appear at all in the existing options. At any way, this approach is overcomplicated, especially the enum and the converter. I recommend you to reconsider this approach as follows: Option: package com.
Example; public enum Option { NOTAPPLICABLE("Not Applicable"), OPTIONAL("Optional"), MANDATORY("Mandatory"); private String label; private Option(String label) { this. Label = label; } public String getLabel() { return label; } } Bean: package com. Example; import java.util.
ArrayList; import java.util. List; import javax.faces.model. SelectItem; public class Bean { private List options = new ArrayList(); private Option option; public Bean() { for (Option option : Option.values()) { options.
Add(new SelectItem(option, option.getLabel())); } } public void submit() { System.out. Println(option); } public List getOptions() { return options; } public Option getOption() { return option; } public void setOption(Option option) { this. Option = option; } } OptionConverter: package com.
Example; import javax.faces.component. UIComponent; import javax.faces.context. FacesContext; import javax.faces.convert.
Converter; public class OptionConverter implements Converter { @Override public Object getAsObject(FacesContext context, UIComponent component, String value) { return Option. ValueOf(value); } @Override public String getAsString(FacesContext context, UIComponent component, Object value) { return ((Option) value).name(); } } faces-config. Xml: bean com.example.
Bean request com.example. OptionConverter com.example. Option Relevant part of JSF page: No need to hassle with Enum#ordinal() which is considered evil.
If you were using JSF 1.2 or newer which ships with a builtin generic EnumConverter, the OptionConverter is totally superfluous and can be safely removed.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.