You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Anders Peterson <ap...@optimatika.se> on 2008/09/17 14:55:25 UTC

Problem with DropDownChoice on 1.4M3

My DropDownChoice always displays as if nothing is selected. Using it 
works fine, but every time the page is (re)loaded the selection is reset.

wantOnSelectionChangedNotifications return true.

I have an older version of my app deployed (using an older version of 
Wicket) that works as expected.

Is this a known problem or could I be doing something wrong?

/Anders


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


Re: SOLVED Re: Problem with DropDownChoice on 1.4M3

Posted by Daan van Etten <da...@stuq.nl>.
Great you figured it out!
Some problems have simple solutions...

Regards,

Daan

On 17 sep 2008, at 16:07, Anders Peterson wrote:

> Isn't it always like this; as soon as you ask someone you start  
> thinking about the problem differently. Or should I say you start  
> thinking straight. The problem was, of course, with the equals- 
> method of the listed objects (two instances of that class would  
> never be equal).
>
> Thanks for being there! /Anders
>
> Anders Peterson wrote:
>> This is the code that creates the DropDownChoice:
>> myForm.add(new DropDownChoice<BLView>("views",  
>> this.getPortfolio().getViews(), new  
>> ChoiceRenderer<BLView>("toDisplayString")) {
>>            @Override
>>            protected void onSelectionChanged(BLView newSelection) {
>>                super.onSelectionChanged(newSelection);
>>                ...;
>>            }
>>            @Override
>>            protected boolean wantOnSelectionChangedNotifications() {
>>                return true;
>>            }
>>        });
>> Nothing strange... /Anders
>> Daan van Etten wrote:
>>> On 17 sep 2008, at 14:55, Anders Peterson wrote:
>>>
>>>> My DropDownChoice always displays as if nothing is selected.  
>>>> Using it works fine, but every time the page is (re)loaded the  
>>>> selection is reset.
>>>>
>>>> wantOnSelectionChangedNotifications return true.
>>>>
>>>> I have an older version of my app deployed (using an older  
>>>> version of Wicket) that works as expected.
>>>>
>>>> Is this a known problem or could I be doing something wrong?
>>>
>>> You could be doing something wrong. Do you set the model of the  
>>> DropDownChoice?
>>> Show us some code.
>>>
>>> Regards,
>>>
>>> Daan
>>>
>>> ---------------------------------------------------------------------
>>> 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
>


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


SOLVED Re: Problem with DropDownChoice on 1.4M3

Posted by Anders Peterson <ap...@optimatika.se>.
Isn't it always like this; as soon as you ask someone you start thinking 
about the problem differently. Or should I say you start thinking 
straight. The problem was, of course, with the equals-method of the 
listed objects (two instances of that class would never be equal).

Thanks for being there! /Anders

Anders Peterson wrote:
> This is the code that creates the DropDownChoice:
> 
> myForm.add(new DropDownChoice<BLView>("views", 
> this.getPortfolio().getViews(), new 
> ChoiceRenderer<BLView>("toDisplayString")) {
> 
>             @Override
>             protected void onSelectionChanged(BLView newSelection) {
> 
>                 super.onSelectionChanged(newSelection);
> 
>                 ...;
>             }
> 
>             @Override
>             protected boolean wantOnSelectionChangedNotifications() {
>                 return true;
>             }
> 
>         });
> 
> 
> Nothing strange... /Anders
> 
> 
> Daan van Etten wrote:
>> On 17 sep 2008, at 14:55, Anders Peterson wrote:
>>
>>> My DropDownChoice always displays as if nothing is selected. Using it 
>>> works fine, but every time the page is (re)loaded the selection is 
>>> reset.
>>>
>>> wantOnSelectionChangedNotifications return true.
>>>
>>> I have an older version of my app deployed (using an older version of 
>>> Wicket) that works as expected.
>>>
>>> Is this a known problem or could I be doing something wrong?
>>
>> You could be doing something wrong. Do you set the model of the 
>> DropDownChoice?
>> Show us some code.
>>
>> Regards,
>>
>> Daan
>>
>> ---------------------------------------------------------------------
>> 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: Problem with DropDownChoice on 1.4M3

Posted by Anders Peterson <ap...@optimatika.se>.
This is the code that creates the DropDownChoice:

myForm.add(new DropDownChoice<BLView>("views", 
this.getPortfolio().getViews(), new 
ChoiceRenderer<BLView>("toDisplayString")) {

             @Override
             protected void onSelectionChanged(BLView newSelection) {

                 super.onSelectionChanged(newSelection);

                 ...;
             }

             @Override
             protected boolean wantOnSelectionChangedNotifications() {
                 return true;
             }

         });


Nothing strange... /Anders


Daan van Etten wrote:
> On 17 sep 2008, at 14:55, Anders Peterson wrote:
> 
>> My DropDownChoice always displays as if nothing is selected. Using it 
>> works fine, but every time the page is (re)loaded the selection is reset.
>>
>> wantOnSelectionChangedNotifications return true.
>>
>> I have an older version of my app deployed (using an older version of 
>> Wicket) that works as expected.
>>
>> Is this a known problem or could I be doing something wrong?
> 
> You could be doing something wrong. Do you set the model of the 
> DropDownChoice?
> Show us some code.
> 
> Regards,
> 
> Daan
> 
> ---------------------------------------------------------------------
> 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: Problem with DropDownChoice on 1.4M3

Posted by Daan van Etten <da...@stuq.nl>.
On 17 sep 2008, at 14:55, Anders Peterson wrote:

> My DropDownChoice always displays as if nothing is selected. Using  
> it works fine, but every time the page is (re)loaded the selection  
> is reset.
>
> wantOnSelectionChangedNotifications return true.
>
> I have an older version of my app deployed (using an older version  
> of Wicket) that works as expected.
>
> Is this a known problem or could I be doing something wrong?

You could be doing something wrong. Do you set the model of the  
DropDownChoice?
Show us some code.

Regards,

Daan

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