I have enum field in my JSP looks as:
<td>
<stripes:select name="answer" id="answer" tabindex="530">
<stripes:options-enumeration enum="com.enums.YesNoEmpty"/>
</stripes:select>
</td>
And of course YesNoEmpty.java
public enum YesNoEmpty {
NO,
YES;
public String toString() {
switch (this) {
case YES:
return "Yes";
case NO:
return "No";
default:
return null;
}
}
}
The problem is i see "No" by default on my page, but need "Yes". How can i manage it without changing order NO, YES in YesNoEmpty.java. Thank you.
According to the API:
The options will be generated in ordinal value order (i.e. the order they are declared in the enum).
It looks like the best(only) way would be to change the order of the enum.