You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Josh Chappelle <jc...@4redi.com> on 2010/03/24 19:58:39 UTC

Palette Problem

Hi,

 

I'm having a problem that is about to drive me nuts. I have a Palette that
won't display the selected values. I am able to reproduce my problem with a
simple version so here it is:

 

                        List<String> current = new ArrayList<String>();

                        current.add("ABC");

                        List<String> available = new ArrayList<String>();

                        available.add("DEF");

                        available.add("123");

                        

                        ChoiceRenderer renderer = new ChoiceRenderer()

                        {

 

                                    @Override

                                    public Object getDisplayValue(Object
object)

                                    {

                                                return object.toString();

                                    }

 

                                    @Override

                                    public String getIdValue(Object object,
int index)

                                    {

                                                return object.toString();

                                    }

                                    

                        };

 

new Palette<String>("views", new Model((Serializable)current), new
Model((Serializable)available), renderer, 10, true);

 

When I add this Palette to a form it only displays "DEF" and "123" in the
available part. I can't get anything to show in the selected part.

 

Someone please help. 

 

Thanks,

 

Josh


Re: Palette Problem

Posted by James Carman <jc...@carmanconsulting.com>.
No problem, man.  Sorry about the 4 hours.  That's what paired
programming is for! :)  Glad to help.

On Wed, Mar 24, 2010 at 4:44 PM, Josh Chappelle <jc...@4redi.com> wrote:
> Yes that was it. I wish I had those 4 hours back. Thank you.
>
> -----Original Message-----
> From: James Carman [mailto:jcarman@carmanconsulting.com]
> Sent: Wednesday, March 24, 2010 3:34 PM
> To: users@wicket.apache.org
> Subject: Re: Palette Problem
>
> Doesn't your "current" have to be a subset of "available"?
>
> On Wed, Mar 24, 2010 at 2:58 PM, Josh Chappelle <jc...@4redi.com>
> wrote:
>> Hi,
>>
>>
>>
>> I'm having a problem that is about to drive me nuts. I have a Palette that
>> won't display the selected values. I am able to reproduce my problem with
> a
>> simple version so here it is:
>>
>>
>>
>>                        List<String> current = new ArrayList<String>();
>>
>>                        current.add("ABC");
>>
>>                        List<String> available = new ArrayList<String>();
>>
>>                        available.add("DEF");
>>
>>                        available.add("123");
>>
>>
>>
>>                        ChoiceRenderer renderer = new ChoiceRenderer()
>>
>>                        {
>>
>>
>>
>>                                    @Override
>>
>>                                    public Object getDisplayValue(Object
>> object)
>>
>>                                    {
>>
>>                                                return object.toString();
>>
>>                                    }
>>
>>
>>
>>                                    @Override
>>
>>                                    public String getIdValue(Object object,
>> int index)
>>
>>                                    {
>>
>>                                                return object.toString();
>>
>>                                    }
>>
>>
>>
>>                        };
>>
>>
>>
>> new Palette<String>("views", new Model((Serializable)current), new
>> Model((Serializable)available), renderer, 10, true);
>>
>>
>>
>> When I add this Palette to a form it only displays "DEF" and "123" in the
>> available part. I can't get anything to show in the selected part.
>>
>>
>>
>> Someone please help.
>>
>>
>>
>> Thanks,
>>
>>
>>
>> Josh
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: Palette Problem

Posted by Josh Chappelle <jc...@4redi.com>.
Yes that was it. I wish I had those 4 hours back. Thank you.

-----Original Message-----
From: James Carman [mailto:jcarman@carmanconsulting.com] 
Sent: Wednesday, March 24, 2010 3:34 PM
To: users@wicket.apache.org
Subject: Re: Palette Problem

Doesn't your "current" have to be a subset of "available"?

On Wed, Mar 24, 2010 at 2:58 PM, Josh Chappelle <jc...@4redi.com>
wrote:
> Hi,
>
>
>
> I'm having a problem that is about to drive me nuts. I have a Palette that
> won't display the selected values. I am able to reproduce my problem with
a
> simple version so here it is:
>
>
>
>                        List<String> current = new ArrayList<String>();
>
>                        current.add("ABC");
>
>                        List<String> available = new ArrayList<String>();
>
>                        available.add("DEF");
>
>                        available.add("123");
>
>
>
>                        ChoiceRenderer renderer = new ChoiceRenderer()
>
>                        {
>
>
>
>                                    @Override
>
>                                    public Object getDisplayValue(Object
> object)
>
>                                    {
>
>                                                return object.toString();
>
>                                    }
>
>
>
>                                    @Override
>
>                                    public String getIdValue(Object object,
> int index)
>
>                                    {
>
>                                                return object.toString();
>
>                                    }
>
>
>
>                        };
>
>
>
> new Palette<String>("views", new Model((Serializable)current), new
> Model((Serializable)available), renderer, 10, true);
>
>
>
> When I add this Palette to a form it only displays "DEF" and "123" in the
> available part. I can't get anything to show in the selected part.
>
>
>
> Someone please help.
>
>
>
> Thanks,
>
>
>
> Josh
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Palette Problem

Posted by James Carman <jc...@carmanconsulting.com>.
Doesn't your "current" have to be a subset of "available"?

On Wed, Mar 24, 2010 at 2:58 PM, Josh Chappelle <jc...@4redi.com> wrote:
> Hi,
>
>
>
> I'm having a problem that is about to drive me nuts. I have a Palette that
> won't display the selected values. I am able to reproduce my problem with a
> simple version so here it is:
>
>
>
>                        List<String> current = new ArrayList<String>();
>
>                        current.add("ABC");
>
>                        List<String> available = new ArrayList<String>();
>
>                        available.add("DEF");
>
>                        available.add("123");
>
>
>
>                        ChoiceRenderer renderer = new ChoiceRenderer()
>
>                        {
>
>
>
>                                    @Override
>
>                                    public Object getDisplayValue(Object
> object)
>
>                                    {
>
>                                                return object.toString();
>
>                                    }
>
>
>
>                                    @Override
>
>                                    public String getIdValue(Object object,
> int index)
>
>                                    {
>
>                                                return object.toString();
>
>                                    }
>
>
>
>                        };
>
>
>
> new Palette<String>("views", new Model((Serializable)current), new
> Model((Serializable)available), renderer, 10, true);
>
>
>
> When I add this Palette to a form it only displays "DEF" and "123" in the
> available part. I can't get anything to show in the selected part.
>
>
>
> Someone please help.
>
>
>
> Thanks,
>
>
>
> Josh
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org