struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dariusz Wojtas" <dwoj...@gmail.com>
Subject [S2] - select tag and supported data types.
Date Wed, 10 Jan 2007 09:49:47 GMT
Hi,

I am trying to gather some more info before I try to recreate the
issue WW-1601 .

What are the supported data types for
  * property that carries the actual data
  * beans inside collection/map/array that carry the displayable options

Background:

// the action class
class MyAction .. {
  private Integer rate;        // property carrying the actual data,
may be Byte, Long, ...
  private ArrayList<OptionBean> rates;   // displayable options
  ..
}

// Single option bean
class OptionBean implements Serializable {
   private Integer id;     // in general the same data type as in my
action (Byte, Long, ...)
   private String name;
}

<s:select size="1"
    name="rate"
    list="rates"
    listKey="id"
    listValue="name"
    emptyOption="false"
    label="...."/>

Sample option beans:
   1, London
   2, Paris
   3, Warsaw

data carried by the action.rate =  2

If I open my web page then Paris is not preselected.
It does not find equality between Integer(1) in action.rate and
Integer(1) in an option bean.

If I change the property in the action to String
   private String rate;
then it finds equality.

After WW-1601 there was a test added for the tag, but it carries a
collection of Strings, not objects that would match identifier in the
carried option bean.

Did anyone else experience the same problem?
It works with Strings but has problems with other value types.
I would add the comment to the issue, but it is marked as fixed and I
am not sure if it is still read by anyone.

Dariusz Wojtas

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message