You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by kshitiz <k....@gmail.com> on 2012/04/24 20:04:52 UTC
Wicket dropdownchoice onselectionchanged must override or implement
a supertype method
Hi,
I am trying to implement wicket drop down choice with on selection changed
feature. But as I write :
final DropDownChoice<SelectOption> postCategoriesDropDown = new
DropDownChoice<SelectOption>("postCategories", iModel,
Arrays.asList(selectOption), choiceRenderer)
{
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
protected boolean wantOnSelectionChangedNotifications()
{
return true;
}
@Override
protected void onSelectionChanged(final Object newSelection)
{
SelectOption selectOption = (SelectOption) newSelection;
}
};
eclipse shows an error:
*The method onSelectionChanged(Object) of type new
DropDownChoice<SelectOption>(){} must override or implement a supertype
method*
Can you please tell me what can be the reason?? I am following
https://cwiki.apache.org/WICKET/dropdownchoice-examples.html
https://cwiki.apache.org/WICKET/dropdownchoice-examples.html
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-dropdownchoice-onselectionchanged-must-override-or-implement-a-supertype-method-tp4584391p4584391.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket dropdownchoice onselectionchanged must override or
implement a supertype method
Posted by kshitiz <k....@gmail.com>.
Thanks all for the reply, You were right...I did the change and it worked.
And also, SelectOption is not wicket one but a class created by me only:
package WalknShine;
import java.io.Serializable;
public class SelectOption implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private int key;
private String value;
public SelectOption(int key, String value) {
this.key = key;
this.value = value;
}
getters and setters...
}
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-dropdownchoice-onselectionchanged-must-override-or-implement-a-supertype-method-tp4584391p4590526.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket dropdownchoice onselectionchanged must override or
implement a supertype method
Posted by Martin Grigorov <mg...@apache.org>.
On Tue, Apr 24, 2012 at 9:22 PM, Sebastien <se...@gmail.com> wrote:
> Right, should probably be something like:
> protected void onSelectionChanged(SelectOption newSelection) {};
>
> Also, note that SelectOption is generic...
I hope his SelectOption is not
org.apache.wicket.extensions.markup.html.form.select.SelectOption
because there is no much sense in that.
>
> Regards,
> Sebastien.
>
>
> On Tue, Apr 24, 2012 at 8:18 PM, Per Newgro <pe...@gmx.ch> wrote:
>
>> it is because of the @override annotation on a non-existent method.
>> Check the signature of the
>>
>> onSelectionChanged
>>
>>
>> Cheers
>> Per
>>
>> Am 24.04.2012 20:04, schrieb kshitiz:
>>
>> Hi,
>>>
>>> I am trying to implement wicket drop down choice with on selection changed
>>> feature. But as I write :
>>>
>>> final DropDownChoice<SelectOption> postCategoriesDropDown = new
>>> DropDownChoice<SelectOption>("**postCategories", iModel,
>>> Arrays.asList(selectOption), choiceRenderer)
>>> {
>>> /**
>>> *
>>> */
>>> private static final long serialVersionUID = 1L;
>>>
>>> @Override
>>> protected boolean wantOnSelectionChangedNotifica**
>>> tions()
>>> {
>>> return true;
>>> }
>>>
>>> @Override
>>> protected void onSelectionChanged(final Object
>>> newSelection)
>>> {
>>> SelectOption selectOption = (SelectOption)
>>> newSelection;
>>>
>>> }
>>>
>>> };
>>>
>>> eclipse shows an error:
>>>
>>> *The method onSelectionChanged(Object) of type new
>>> DropDownChoice<SelectOption>()**{} must override or implement a supertype
>>> method*
>>>
>>> Can you please tell me what can be the reason?? I am following
>>> https://cwiki.apache.org/**WICKET/dropdownchoice-**examples.html<https://cwiki.apache.org/WICKET/dropdownchoice-examples.html>
>>> https://cwiki.apache.org/**WICKET/dropdownchoice-**examples.html<https://cwiki.apache.org/WICKET/dropdownchoice-examples.html>
>>>
>>> --
>>> View this message in context: http://apache-wicket.1842946.**
>>> n4.nabble.com/Wicket-**dropdownchoice-**onselectionchanged-must-**
>>> override-or-implement-a-**supertype-method-**tp4584391p4584391.html<http://apache-wicket.1842946.n4.nabble.com/Wicket-dropdownchoice-onselectionchanged-must-override-or-implement-a-supertype-method-tp4584391p4584391.html>
>>> Sent from the Users forum mailing list archive at Nabble.com.
>>>
>>> ------------------------------**------------------------------**---------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket dropdownchoice onselectionchanged must override or
implement a supertype method
Posted by Sebastien <se...@gmail.com>.
Right, should probably be something like:
protected void onSelectionChanged(SelectOption newSelection) {};
Also, note that SelectOption is generic...
Regards,
Sebastien.
On Tue, Apr 24, 2012 at 8:18 PM, Per Newgro <pe...@gmx.ch> wrote:
> it is because of the @override annotation on a non-existent method.
> Check the signature of the
>
> onSelectionChanged
>
>
> Cheers
> Per
>
> Am 24.04.2012 20:04, schrieb kshitiz:
>
> Hi,
>>
>> I am trying to implement wicket drop down choice with on selection changed
>> feature. But as I write :
>>
>> final DropDownChoice<SelectOption> postCategoriesDropDown = new
>> DropDownChoice<SelectOption>("**postCategories", iModel,
>> Arrays.asList(selectOption), choiceRenderer)
>> {
>> /**
>> *
>> */
>> private static final long serialVersionUID = 1L;
>>
>> @Override
>> protected boolean wantOnSelectionChangedNotifica**
>> tions()
>> {
>> return true;
>> }
>>
>> @Override
>> protected void onSelectionChanged(final Object
>> newSelection)
>> {
>> SelectOption selectOption = (SelectOption)
>> newSelection;
>>
>> }
>>
>> };
>>
>> eclipse shows an error:
>>
>> *The method onSelectionChanged(Object) of type new
>> DropDownChoice<SelectOption>()**{} must override or implement a supertype
>> method*
>>
>> Can you please tell me what can be the reason?? I am following
>> https://cwiki.apache.org/**WICKET/dropdownchoice-**examples.html<https://cwiki.apache.org/WICKET/dropdownchoice-examples.html>
>> https://cwiki.apache.org/**WICKET/dropdownchoice-**examples.html<https://cwiki.apache.org/WICKET/dropdownchoice-examples.html>
>>
>> --
>> View this message in context: http://apache-wicket.1842946.**
>> n4.nabble.com/Wicket-**dropdownchoice-**onselectionchanged-must-**
>> override-or-implement-a-**supertype-method-**tp4584391p4584391.html<http://apache-wicket.1842946.n4.nabble.com/Wicket-dropdownchoice-onselectionchanged-must-override-or-implement-a-supertype-method-tp4584391p4584391.html>
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Wicket dropdownchoice onselectionchanged must override or implement
a supertype method
Posted by Per Newgro <pe...@gmx.ch>.
it is because of the @override annotation on a non-existent method.
Check the signature of the
onSelectionChanged
Cheers
Per
Am 24.04.2012 20:04, schrieb kshitiz:
> Hi,
>
> I am trying to implement wicket drop down choice with on selection changed
> feature. But as I write :
>
> final DropDownChoice<SelectOption> postCategoriesDropDown = new
> DropDownChoice<SelectOption>("postCategories", iModel,
> Arrays.asList(selectOption), choiceRenderer)
> {
> /**
> *
> */
> private static final long serialVersionUID = 1L;
>
> @Override
> protected boolean wantOnSelectionChangedNotifications()
> {
> return true;
> }
>
> @Override
> protected void onSelectionChanged(final Object newSelection)
> {
> SelectOption selectOption = (SelectOption) newSelection;
>
> }
>
> };
>
> eclipse shows an error:
>
> *The method onSelectionChanged(Object) of type new
> DropDownChoice<SelectOption>(){} must override or implement a supertype
> method*
>
> Can you please tell me what can be the reason?? I am following
> https://cwiki.apache.org/WICKET/dropdownchoice-examples.html
> https://cwiki.apache.org/WICKET/dropdownchoice-examples.html
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-dropdownchoice-onselectionchanged-must-override-or-implement-a-supertype-method-tp4584391p4584391.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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