You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kasper <ka...@nekoconeko.nl> on 2009/04/10 09:04:03 UTC
T5: Multiple Select preselected values
Hi all,
I have a form with a multiple select field:
<input t:type="Select" t:model="regions" t:value="preferredRegions"
t:id="preferredRegions" t:multiple="true" size="13" />
Where the t:model="regions" = HashMap<Long, String>. Now when the page
loads I want some preferredRegions to be set. For normal form fields I
use a setFieldValue(), so I tried to do this also for this Select field.
public HashMap<Long, String> getPreferredRegions() {
HashMap<Long, String> l = new HashMap<Long, String>();
l.put(Long.valueOf(1), "first field");
l.put(Long.valueOf(2), "second field");
l.put(Long.valueOf(3), "third field");
return l;
}
This doesn't work, it also doesn't work when I try to use List<Long>
or just long[]. It does work when I use plain long. But then only one
option can be preselected.
Does anyone have a clue how to let more than one value be preseleced?
Thanks,
Yours,
Kasper
--
http://kasper.nekoconeko.nl
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5: Multiple Select preselected values
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, Apr 10, 2009 at 4:04 AM, Kasper <ka...@nekoconeko.nl> wrote:
> Hi all,
Hi!
> I have a form with a multiple select field:
> <input t:type="Select" t:model="regions" t:value="preferredRegions"
> t:id="preferredRegions" t:multiple="true" size="13" />
Tapestry's Select component does not have a "multiple" parameter nor
supports maps as the edited value. Maybe the Palette component is what
you're looking for.
--
Thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org