Submitted by Eugene:
http://forums.opensymphony.com/thread.jspa?threadID=14124&tstart=0
ww:select tag works only with string variables. I must to use code like this:
public String getType() {
return String.valueOf(type);
}
public void setType(String type) {
this.type = Integer.valueOf(type);
}
template
<@ww.form method="POST" validate="true" action="AddNews">
<@ww.select label="%{getText('type')}" name="type" list=r"#{0: 'type1', 1 : 'type2'}"/>
<@ww.textfield label="%{getText('title')}" name="title" size="50" required="true"/>
<@ww.textarea label="%{getText('text')}" name="text" rows="5" cols="40" required="true"/>
<@form.submit submitValue="%{getText('button.add')}" cancelValue="%{getText('button.back')}" cancelHref="News.jspa"/>
</@ww.form>
code:
public String getType() {
return String.valueOf(type);
}
public void setType(String type) {
this.type = Integer.valueOf(type);
}
works, but
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
does not work. Allways first option of select is selected
You can close 1116 issue. With new version - i haven't meet this bug...