Rob,
Thanks for the quick reply and the palette sample.
I think i m avoiding using palette cuz i cant fig out an easy way to convert
my java.util.List of composite objects (or watever u call em...the ones with
objects inside objects) to a IPropertySelectionModel.
I'll take a look at tassel. good ref! thx
i m curious though to learn more about the select component with
multiple=true. So if the select component displayed a collection of objects,
what would be a way (in the form listener) to get hold of the selected
objects?
as i mentioned b4, i iterate through all the colln objects for isSelected()
to be true, but looks like setSelected() is not turning the flag to
true...or maybe i m missing something?
thanks again!
From: Robert Zeigler <[EMAIL PROTECTED]>
Reply-To: "Tapestry users" <[email protected]>
To: Tapestry users <[email protected]>
Subject: Re: Multiple Select
Date: Wed, 13 Jul 2005 16:58:32 -0500
Try the select multiple component in tassel?
Otherwise, the contrib:palette works well, too.
Using it is really about the same as using PropertySelection.
The only difference is that you're passing a (modifiable) list instead
of a single object in.
Here's an example...
<select jwcid="@contrib:Palette" model="ognl:coursesModel"
selected="ognl:selectedCourses"
availableTitleBlock="ognl:components.unenrolled"
selectedTitleBlock="ognl:components.enrolled"/>
<span jwcid="[EMAIL PROTECTED]">
Unenrolled
</span>
<span jwcid="[EMAIL PROTECTED]">
Enrolled
</span>
Robert
Dan wrote:
> Hi,
>
> I am newbie to tapestry. I am having problems getting the selected
> values from a MULTIPLE select.
>
>> From googling the net and reading the docs, the method i approached to
>> get
>
> the selected value from a SINGLE select list(dropwdown) is by iterating
> over the collection being rendered and check if isSelected() is true.
>
> example:
>
> Page spec:
>
> <select jwcid="@Select">
> <span jwcid="@Foreach" source="ognl:colorList" value="ognl:color">
> <option jwcid="@Option" selected="ognl:color.selected"
> label="ognl:color.name"/>
> </span>
> </select>
>
> Java code:
>
> public Color getCurrentColor(){
> List l = getColorList();
> Color p;
> for (int i=0;i<l.size();i++){
> p = (Color)l.get(i);
> if (p.isSelected())
> return p;
> }
> return null;
> }
>
> I try to do similar thing with mulitple select, ie return a List of
> objects whose isSelected() == true. But this doesnt seem to work.
>
> Could someone please guide as to how do they retrieve the selected
> objects from the multiple select?
>
> Also are there any contrib:palette examples out there? The book
> doesnt...neither did googling help.
>
> Thanks a bunch!
>
> _________________________________________________________________
> DonÂ’t just search. Find. Check out the new MSN Search!
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
DonÂ’t just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]