very cool, but the options' values are force to 0, 1, 2, 3, 4 ...
option value=0Day/option
option value=1Week /option
option value=2Fortnight/option
option value=3Month/option
option value=4Year/option
I've tried the whole night, any help is appreciated.
Sven Meier wrote:
You can do
insom wrote:
new DropDownChoice(period,
new PropertyModel(myObject, period),
periods,
new ChoiceRenderer() {
public String getDisplayValue(Object object) {
int period = ((Integer) object).intValue();
switch (period) {
case 1: return Day;
...
default:
You can do without the ChoiceRenderer if you put your terms in a
property file next to your panel/page:
A.java
new DropDownChoice(period, ...) {
protected boolean localizeDisplayValues() {
return true;
}
}
A.html
select