Hi,
I observed a weird behavior with select components after upgrading to Stripes
1.5. It can easily be reproduced.
I put 2 select components with similar attributes, and only the first one is rendered correctly; the other is missing
attributes. Ex:
<stripes:select id="select1" name="selected1" multiple="true" size="10">
<stripes:options-collection collection="${bean.items1}"/>
</stripes:select>
<stripes:select id="select2" name="selected2" multiple="true" size="10">
<stripes:options-collection collection="${bean.items2}"/>
</stripes:select>
Notice that both selects have an attribute "multiple" and "size". The html
generated is as follows:
<select multiple="multiple" size="10" name="selected1" id="select1">
<option value="1">1</option><option value="2">2</option><option
value="3">3</option>
</select>
<select name="selected2" id="select2">
<option value="1">1</option><option value="2">2</option><option
value="3">3</option>
</select>
Notice that attributes "multiple" and "size" are not added for the second
select.
I'm running Stripes 1.5rc1. I attached the jsp and ActionBean class to
reproduce the issue.
Thanks for any help!
Math
package com.mobicom.presentation.action;
import java.util.ArrayList;
import java.util.List;
import net.sourceforge.stripes.action.ActionBean;
import net.sourceforge.stripes.action.ActionBeanContext;
import net.sourceforge.stripes.action.Resolution;
import com.mobicom.presentation.stripes.config.SessionContext;
public class Sandbox implements ActionBean {
private SessionContext context;
public SessionContext getContext() {
return context;
}
public void setContext(ActionBeanContext context) {
this.context = (SessionContext) context;
}
private List selected1 = null;
private List selected2 = null;
public List<String> getItems1(){
List a = new ArrayList();
a.add("1");
a.add("2");
a.add("3");
return a;
}
public List<String> getItems2(){
List a = new ArrayList();
a.add("1");
a.add("2");
a.add("3");
return a;
}
public List getSelected1() {
return this.selected1;
}
public void setSelected1(List selected1) {
this.selected1 = selected1;
}
public List getSelected2() {
return this.selected2;
}
public void setSelected2(List selected2) {
this.selected2 = selected2;
}
public Resolution action1(){
return null;
}
public Resolution action2(){
return null;
}
}
<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld" %>
<stripes:useActionBean beanclass="com.mobicom.presentation.action.Sandbox"
var="bean"/>
<stripes:layout-render name="/stripes/inc/main-blank.jsp" pageTitle="Sandbox">
<stripes:layout-component name="pageContent">
<stripes:form
beanclass="com.mobicom.presentation.action.Sandbox" action="action1">
<stripes:select id="select1" name="selected1"
multiple="true" size="10">
<stripes:options-collection
collection="${bean.items1}"/>
</stripes:select>
<br>
<stripes:select id="select2" name="selected2"
multiple="true" size="10">
<stripes:options-collection
collection="${bean.items2}"/>
</stripes:select>
</stripes:form>
</stripes:layout-component>
</stripes:layout-render>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users