I'm using AbstractSelectModel, and ValueEncoder interface.

Palette is internally using two lists: one for available options and one for
selected.
Problem was I needed to change available options (for presentation purpose)

So, selectedSet.contains(value); (from Pallete.java) retuned false even if
'value'  is contained in selectedSet (available options).

I don't know if I'm beaning clear.
All lists contain objects of bean Category. Two categoies are equal if they
have same id property.
Besause I chaned name propery of available categories, selectedSet.contains
returns false even if categories have same id.

So, If you have similair problem just override equeas and hasSet methods of
bean (bean in my case)
in maner that suit your needs, and everything will work ok.

Hope this helps.



On Tue, Jan 27, 2009 at 7:07 AM, James Sherwood
<jsherw...@rgisolutions.com>wrote:

> Hello,
>
> I just ran into the same problem.
>
> You are probably creating the available and select lists in 2 different
> methods, you need to do it in the same method with the SAME object(or at
> least with a list that doesn't reload when you pull your select) otherwise
> you get that null error(or at least that was my problem) because you are
> basically handing your palette objects in your select that do not exist in
> your available.
>
> I was using the GenericSelectModel from the JumpStart object select that
> you
> use as both your encoder and model.
>
> Not sure if it's the same problem that I was having but it sounds alot like
> it. Posting your java may help.
>
> --James
>
> -----Original Message-----
> From: Geoff Callender [mailto:geoff.callender.jumpst...@gmail.com]
> Sent: January-27-09 12:56 AM
> To: Tapestry users
> Subject: Re: Palette component
>
> Does this one that works help you?
>
> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/component/cor
> einputcomponents
>
> On 27/01/2009, at 3:32 PM, Davor Miku wrote:
>
> > Anyone, plaese?
> >
> > On Mon, Jan 26, 2009 at 10:30 PM, Davor Miku <davorm...@gmail.com>
> > wrote:
> >
> >>    public List<OptionModel> getOptions() {
> >>        List<OptionModel> list = new ArrayList<OptionModel>();
> >>        for (Category c : categories) {
> >>            list.add(new CategoryOptionModel(c));
> >>        }
> >>        return list;
> >>    }
> >>
> >> This method returns list of OptionModel objects. If you meant on
> >> this, this
> >> list is not empty. I'm not sure I'm following you.
> >>
> >> On Mon, Jan 26, 2009 at 11:17 PM, Thiago H. de Paula Figueiredo <
> >> thiag...@gmail.com> wrote:
> >>
> >>> Em Tue, 27 Jan 2009 00:10:36 -0300, Davor Miku <davorm...@gmail.com>
> >>> escreveu:
> >>>
> >>> Hi Thiago,
> >>>>
> >>>
> >>> Hi!
> >>>
> >>> Thanks for reply.
> >>>> Can you be more specific, please?
> >>>>
> >>>
> >>> It's 1:12 AM here in Belo Horizonte (Brazil), so please don't mind
> >>> if the
> >>> answer is as clear as you need. :)
> >>>
> >>> One of the parameters of Select is model. You should pass a
> >>> SelectModel to
> >>> it. Basically, a SelectModel is a list of OptionModel instances
> >>> (SelectModel.getOptionModels()), one for each option to appear in
> >>> your
> >>> select tag (and component). Select does not support null
> >>> OptionModel's
> >>> returned by SelectModel.getOptionModels(), so the exception you seen
> >>> happens.
> >>>
> >>> Summary: make sure the SelectModel returned by getCategoryModel()
> >>> does not
> >>> return nulls in its getOptionModels(). ;)
> >>>
> >>>
> >>> --
> >>> Thiago H. de Paula Figueiredo
> >>> Independent Java consultant, developer, and instructor
> >>> http://www.arsmachina.com.br/thiago
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >>> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>>
> >>>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

Reply via email to