Yeah I ran into this awhile ago.  See 
http://www.nabble.com/Can-I-extend-InputSelectTag-and-drop-in--to20919043.html#a20920018

What I did was extend input select tag, override the is option selected method 
with object.equals(other).  I also had to copy the stripes tld, strip all the 
other tags out except select, and replace the class name with mine.  Then of 
course I had to reference the new tld in the app.  Works much closer to what 
I'd expect, I'm not sure why the existing tag does something like  
format(o.toString()).equals(format(o2.toString()) instead of o.equals(o2)


From: [email protected] [mailto:[email protected]]
Sent: Tuesday, April 28, 2009 9:21 AM
To: Stripes Users List
Subject: [Stripes-users] Vedr.: Re: options-collection tag and selections


Right,

But my problem is that I am also using toString() for another purpuse, and I'd 
kind of like to keep doing that.

I was looking into the value="" attribute of the <stripes:select> tag, but that 
doesn't seem to work as expected either.

-dennis


Morten Matras <[email protected]> skrev den 28-04-2009 14:54:44:

> What I've done is to make the toString return the id of the object.
> It's not perfect, but it solves your issue.
>
> Regards
>
> Morten Matras
> Consultant Blob Communication ApS, Odense, Denmark

> 2009/4/28 <[email protected]>
>
> Hi,
>
> In the documentation of the <options-collecton> tag there is the following:
>
> would cause the container to look for a Collection called "cats"
> across the various JSP scopes and set it on the tag. The tag
> would then proceed to iterate through that collection calling
> getCatId() and getName() on each cat to produce HTML option tags.
>
> In my case let's say I'm displaying a collection of Cat instances.
> When the tag (through the option tag)
> determines if each option is selected it seems to be using the
> toString() method of the selected cat and
> comparing this to the getCatId() value.
>
> Should it be like that? Any ideas on how to work around this?
>
> -dennis
> ------------------------------------------------------------------------------
> Register Now & Save for Velocity, the Web Performance & Operations
> Conference from O'Reilly Media. Velocity features a full day of
> expert-led, hands-on workshops and two days of sessions from industry
> leaders in dedicated Performance & Operations tracks. Use code vel09scf
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users

>
>
>
> --
>  Morten Matras
>  Consultant
>  Blob Communication ApS
>  Svendsagervej 42
>  DK-5240 Odense NĂ˜
>  P: (+45) 76 6-5-4-3-2-1
>  W: www.blobcom.com
>  E: [email protected]
> ------------------------------------------------------------------------------
> Register Now & Save for Velocity, the Web Performance & Operations
> Conference from O'Reilly Media. Velocity features a full day of
> expert-led, hands-on workshops and two days of sessions from industry
> leaders in dedicated Performance & Operations tracks. Use code vel09scf
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to