[ 
https://issues.apache.org/struts/browse/WW-1601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39730
 ] 

Dariusz Wojtas commented on WW-1601:
------------------------------------

Maybe I am wrong - if I am, I give up on this issue.

But in my opinion this test should also check for both
    collection of objects with keys ot type 'Byte'    - as you used in the test
    action's   "name"   object pointing to a 'Byte' property   - the test uses 
Strings

I tried to modify the
   org.apache.struts2.views.jsp.ui.SelectTest.testByte
method to define collection containing both Byte and a String

        // expect strings to be returned, we're still dealing with HTTP here!
        collection.add(new Byte((byte) 1));        // FAILS, but this should 
match the condition!
        collection.add("2");

and only element "2" was selected but not Byte(1).
What does the comment
       // expect strings to be returned, we're still dealing with HTTP here!
mean here?
That collection does not come from httpServletRequest but directly from the 
action.
And the action may contain objects different than String.


If the framework supports conversion of String->arbitrary object on request
   [when no rendering is done]
then why does it not support arbitrary objects in the rendering phase
   [when no conversion is involved - just comparison of objects]?

The test fails for me if I use Integers, Longs and other non String types.
Please see the initial issue description - it talks about 'name' of type Byte.

I would reopen this issue but I do not have such rights with my account.
I hope I am right. 
Please clarify your point.

> s:select tag does not support keys of type Byte (and possibly others)
> ---------------------------------------------------------------------
>
>                 Key: WW-1601
>                 URL: https://issues.apache.org/struts/browse/WW-1601
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: windows xp, java 6, tomcat 5.5.17
>            Reporter: Dariusz Wojtas
>         Assigned To: Don Brown
>
> <s:select size="1" 
>     name="rate" 
>     list="rates" 
>     listKey="id" 
>     listValue="name" 
>     emptyOption="false" 
>     label="...."/>
> Action has properties
>   private Byte rate;
>   private ArrayList<OptionBean> rates;
> class OptionBean implements Serializable {
>    private Byte id;
>    private String name;
> }
> generated select tag does not recognize selected value.
> If I switch Byte to String then it works.
> I would like set OptionBean containing 'id' of type Object.
> And I tried it with different types of Objects (String, Byte) but only String 
> worked.
> I believe it should support all object types with correctly implemented 
> 'equals'.
> If it matters - form is of theme "ajax".

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to