You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Brill Pappin <br...@pappin.ca> on 2009/03/02 21:11:15 UTC

VOTE: Remove ? extends from constructor of DropDownChoice

Ok, as suggested, here is the thread, and the first vote.

+1
for making the generic definition the same for all list type components.

FYI -  you can also "vote" in the issue I just created at (which might  
actually be a better place to vote):
https://issues.apache.org/jira/browse/WICKET-2137

- Brill




On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:

> Perhaps start a vote thread, with the subject something like: "VOTE:  
> Remove
> ? extends from constructor of DropDownChoice".
>
> I'd be +1 non-binding
>
>
> -- 
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca> wrote:
>
>> I'm of the don't widen it camp anyway :)
>>
>> So how do I go about gathering support for having the  
>> DropDownChoice work
>> with the models the way everything else does?
>>
>> - Brill
>>
>>
>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>>
>> yes, the choice was intentional. personally i do not care if it is  
>> <T>
>>> all the way, some users complained so we widened it on the choices
>>> model, we cannot widen it on the main model.
>>>
>>> -igor
>>>
>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin <br...@pappin.ca>  
>>> wrote:
>>>
>>>> I see... but this would i think because Bar "is a" Foo:
>>>>
>>>> class Bar exends Foo {}
>>>> List<? extends Foo> list = ...
>>>> list.add(new Bar());
>>>>
>>>> Anyway, what your saying is that the generics choice was  
>>>> intentional?
>>>>
>>>> - Brill
>>>>
>>>>
>>>>
>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>>>>
>>>> list<? extends string> stings=...
>>>>> strings.add("asd"); <== wont compile
>>>>>
>>>>> -igor
>>>>>
>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos Fernandes
>>>>> <ad...@gmail.com> wrote:
>>>>>
>>>>>>
>>>>>> What do you mean with "read only" here?
>>>>>>
>>>>>>
>>>>>> Adriano
>>>>>>
>>>>>>
>>>>>> Igor Vaynberg escreveu:
>>>>>>
>>>>>>>
>>>>>>> <? extends Foo> collections are read only, it would be too
>>>>>>> inconvenient to make the model collection read only :)
>>>>>>>
>>>>>>> -igor
>>>>>>>
>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>>>>>>> <je...@wickettraining.com> wrote:
>>>>>>>
>>>>>>>
>>>>>>>> This is what I was commenting on last week on the list (or  
>>>>>>>> earlier
>>>>>>>> this
>>>>>>>> week).  One expects List<? extends Foo> while the other expects
>>>>>>>> List<Foo>.
>>>>>>>> I'm not fully convinced yet that the "? extends" is the better
>>>>>>>> option.
>>>>>>>> Either way, I think they should be the same.
>>>>>>>>
>>>>>>>> --
>>>>>>>> Jeremy Thomerson
>>>>>>>> http://www.wickettraining.com
>>>>>>>>
>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <br...@pappin.ca>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> Roughly what I'm doing is:
>>>>>>>>>
>>>>>>>>> class TypeA{}
>>>>>>>>>
>>>>>>>>> class TypeAModel extends LoadableDetachableModel<  
>>>>>>>>> List<TypeA>> {
>>>>>>>>>    public List<TypeA> load(){
>>>>>>>>>            ... do the load ...
>>>>>>>>>            return ...
>>>>>>>>>    }
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> TypeAModel model = new TypeAModel();
>>>>>>>>> DropDownChoice< TypeA> ddc = new DropDownChoice<TypeA>("id",  
>>>>>>>>> model
>>>>>>>>> );
>>>>>>>>>
>>>>>>>>> which gets complained about... in this case the generic def is
>>>>>>>>> DropDownChoice<List<? extends T>>
>>>>>>>>>
>>>>>>>>> I think the problem is that the generic def of the class  
>>>>>>>>> should
>>>>>>>>> actually
>>>>>>>>> be
>>>>>>>>> DropDownChoice<List<T>> because you are already identifying  
>>>>>>>>> the type
>>>>>>>>> when
>>>>>>>>> you create a new instance.
>>>>>>>>>
>>>>>>>>> Now... my generics are a bit hazy at this level, because I can
>>>>>>>>> understand
>>>>>>>>> why it was done that way... does anyone with more generics
>>>>>>>>> experience
>>>>>>>>> know
>>>>>>>>> what it should be? Is this a bug that needs filing?
>>>>>>>>>
>>>>>>>>> - Brill
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>>>>>>>>>
>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> For some reason the DropDownChoice component doesn't have  
>>>>>>>>>> the same
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> generics as ListView and it will not accept a model that  
>>>>>>>>>>> listview
>>>>>>>>>>> will,
>>>>>>>>>>> despite its saying that it will accept an IModel.
>>>>>>>>>>>
>>>>>>>>>>> Is anyone else having that sort of trouble with  
>>>>>>>>>>> DropDownChoice?
>>>>>>>>>>>
>>>>>>>>>>> - Brill
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>> Can you give us more information on what exactly is not  
>>>>>>>>>> working for
>>>>>>>>>> you?
>>>>>>>>>>
>>>>>>>>>> DropDownChoice indeed does accept a model, see for instance  
>>>>>>>>>> the
>>>>>>>>>> example
>>>>>>>>>> in
>>>>>>>>>> the class description at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>>>>>>>>>>
>>>>>>>>>> This works for me.
>>>>>>>>>>
>>>>>>>>>> Kaspar
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>>
>>>>>>>>>> <!-- HTML: -->
>>>>>>>>>> <select wicket:id="site">
>>>>>>>>>>           <option>site 1</option>
>>>>>>>>>>           <option>site 2</option>
>>>>>>>>>> </select>
>>>>>>>>>> <ul>
>>>>>>>>>> <li wicket:id="site2"><wicket:container
>>>>>>>>>> wicket:id="sitename"/></li>
>>>>>>>>>> </ul>
>>>>>>>>>>
>>>>>>>>>> // Code
>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>>>>>>>>>>   "The Server Side", "Java Lobby", "Java.Net"
>>>>>>>>>> });
>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>>>>>>>>>> form.add(new ListView("site2", SITES)
>>>>>>>>>> {
>>>>>>>>>> @Override
>>>>>>>>>> protected void populateItem(ListItem item)
>>>>>>>>>> {
>>>>>>>>>>   item.add(new Label("sitename", item.getModel()));
>>>>>>>>>> }
>>>>>>>>>> });
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>> 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
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>> ? extends
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> 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
>>>>
>>>>
>>>>
>>> es, the choice
>>>
>>> ---------------------------------------------------------------------
>>> 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: [off topic] was: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Martijn Dashorst <ma...@gmail.com>.
It would make writing books, giving presentations and tutorials *that*
much simpler ...

Martijn

On Tue, Mar 3, 2009 at 5:42 AM, Jan Kriesten <kr...@mail.footprint.de> wrote:
>
>> i also dont remember using a compound property model...can we remove that?
>
> hehe - i haven't used that either.
>
> + 1 on removing cpm! ;-)
>
> Best reagards, --- Jan.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.5 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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


Re: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Tue, 03 Mar 2009, walnutmon wrote:
> It seems that the drop down should at least be able to take a ListModel<Foo>,
> but that doesn't work either...

I think that there's also a convenience model called 
something like Wildcard*Model for the wildcarded case.

Best wishes,
Timo


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


[off topic] was: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Jan Kriesten <kr...@mail.footprint.de>.
> i also dont remember using a compound property model...can we remove that?

hehe - i haven't used that either.

+ 1 on removing cpm! ;-)

Best reagards, --- Jan.


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


Re: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by walnutmon <ju...@gmail.com>.
It seems that the drop down should at least be able to take a ListModel<Foo>,
but that doesn't work either...

I actually was just writing code to get around this right now.

DropDownChoice<Foo> dd =
				new DropDownChoice<Foo>("foo",
				new IModel<List<? extends Foo>>()
				{
					public List<? extends Foo> getObject()
					{
						return getListOfFoos();
					}
                                       //some noops
				});

Thoughts?


igor.vaynberg wrote:
> 
> i also dont remember using a compound property model...can we remove that?
> 
> -igor
> 
> On Mon, Mar 2, 2009 at 12:57 PM, James Carman
> <jc...@carmanconsulting.com> wrote:
>> Can you remember ever having to do either one of those?  I guess I
>> could see someone trying to do such a thing during the processing of
>> an AJAX request to perhaps make more stuff show up in the
>> DDC/ListView.  But, for that case, wouldn't it be easier to just
>> modify the underlying list (I assume they'd use a list because
>> anything else, such as an LDM, would tend to be read-only)?
>>
>> On Mon, Mar 2, 2009 at 3:47 PM, Igor Vaynberg <ig...@gmail.com>
>> wrote:
>>> depends on your coding style.
>>>
>>> -igor
>>>
>>> On Mon, Mar 2, 2009 at 12:44 PM, James Carman
>>> <jc...@carmanconsulting.com> wrote:
>>>> Aren't both the "choices" model in DDC and the actual model of
>>>> ListView supposed to be considered read-only (as far as the component
>>>> is concerned)?  The DDC and ListView don't need to be able to alter
>>>> those models anyway, right?  Perhaps my experience is just too
>>>> limited, but I don't think I've ever tried to do either one of your
>>>> usecases (I always consider them read-only).
>>>>
>>>>
>>>> On Mon, Mar 2, 2009 at 3:24 PM, Igor Vaynberg <ig...@gmail.com>
>>>> wrote:
>>>>> see WICKET-2126
>>>>>
>>>>> -igor
>>>>>
>>>>> On Mon, Mar 2, 2009 at 12:19 PM, James Carman
>>>>> <jc...@carmanconsulting.com> wrote:
>>>>>> I vote -0.99 on this (non-binding of course).  I'd vote +1 to making
>>>>>> ListView accept List<? extends T> rather than making DDC less
>>>>>> flexible.
>>>>>>
>>>>>> On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>>>>> Ok, as suggested, here is the thread, and the first vote.
>>>>>>>
>>>>>>> +1
>>>>>>> for making the generic definition the same for all list type
>>>>>>> components.
>>>>>>>
>>>>>>> FYI -  you can also "vote" in the issue I just created at (which
>>>>>>> might
>>>>>>> actually be a better place to vote):
>>>>>>> https://issues.apache.org/jira/browse/WICKET-2137
>>>>>>>
>>>>>>> - Brill
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>>>>>>>
>>>>>>>> Perhaps start a vote thread, with the subject something like:
>>>>>>>> "VOTE:
>>>>>>>> Remove
>>>>>>>> ? extends from constructor of DropDownChoice".
>>>>>>>>
>>>>>>>> I'd be +1 non-binding
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Jeremy Thomerson
>>>>>>>> http://www.wickettraining.com
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> I'm of the don't widen it camp anyway :)
>>>>>>>>>
>>>>>>>>> So how do I go about gathering support for having the
>>>>>>>>> DropDownChoice work
>>>>>>>>> with the models the way everything else does?
>>>>>>>>>
>>>>>>>>> - Brill
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>>>>>>>>>
>>>>>>>>> yes, the choice was intentional. personally i do not care if it is
>>>>>>>>> <T>
>>>>>>>>>>
>>>>>>>>>> all the way, some users complained so we widened it on the
>>>>>>>>>> choices
>>>>>>>>>> model, we cannot widen it on the main model.
>>>>>>>>>>
>>>>>>>>>> -igor
>>>>>>>>>>
>>>>>>>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin <br...@pappin.ca>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> I see... but this would i think because Bar "is a" Foo:
>>>>>>>>>>>
>>>>>>>>>>> class Bar exends Foo {}
>>>>>>>>>>> List<? extends Foo> list = ...
>>>>>>>>>>> list.add(new Bar());
>>>>>>>>>>>
>>>>>>>>>>> Anyway, what your saying is that the generics choice was
>>>>>>>>>>> intentional?
>>>>>>>>>>>
>>>>>>>>>>> - Brill
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>>>>>>>>>>>
>>>>>>>>>>> list<? extends string> stings=...
>>>>>>>>>>>>
>>>>>>>>>>>> strings.add("asd"); <== wont compile
>>>>>>>>>>>>
>>>>>>>>>>>> -igor
>>>>>>>>>>>>
>>>>>>>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos Fernandes
>>>>>>>>>>>> <ad...@gmail.com> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> What do you mean with "read only" here?
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Adriano
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Igor Vaynberg escreveu:
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <? extends Foo> collections are read only, it would be too
>>>>>>>>>>>>>> inconvenient to make the model collection read only :)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> -igor
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>>>>>>>>>>>>>> <je...@wickettraining.com> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> This is what I was commenting on last week on the list (or
>>>>>>>>>>>>>>> earlier
>>>>>>>>>>>>>>> this
>>>>>>>>>>>>>>> week).  One expects List<? extends Foo> while the other
>>>>>>>>>>>>>>> expects
>>>>>>>>>>>>>>> List<Foo>.
>>>>>>>>>>>>>>> I'm not fully convinced yet that the "? extends" is the
>>>>>>>>>>>>>>> better
>>>>>>>>>>>>>>> option.
>>>>>>>>>>>>>>> Either way, I think they should be the same.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>> Jeremy Thomerson
>>>>>>>>>>>>>>> http://www.wickettraining.com
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin
>>>>>>>>>>>>>>> <br...@pappin.ca>
>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Roughly what I'm doing is:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> class TypeA{}
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> class TypeAModel extends LoadableDetachableModel<
>>>>>>>>>>>>>>>> List<TypeA>> {
>>>>>>>>>>>>>>>>   public List<TypeA> load(){
>>>>>>>>>>>>>>>>           ... do the load ...
>>>>>>>>>>>>>>>>           return ...
>>>>>>>>>>>>>>>>   }
>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> TypeAModel model = new TypeAModel();
>>>>>>>>>>>>>>>> DropDownChoice< TypeA> ddc = new
>>>>>>>>>>>>>>>> DropDownChoice<TypeA>("id", model
>>>>>>>>>>>>>>>> );
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> which gets complained about... in this case the generic def
>>>>>>>>>>>>>>>> is
>>>>>>>>>>>>>>>> DropDownChoice<List<? extends T>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> I think the problem is that the generic def of the class
>>>>>>>>>>>>>>>> should
>>>>>>>>>>>>>>>> actually
>>>>>>>>>>>>>>>> be
>>>>>>>>>>>>>>>> DropDownChoice<List<T>> because you are already identifying
>>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>>> type
>>>>>>>>>>>>>>>> when
>>>>>>>>>>>>>>>> you create a new instance.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Now... my generics are a bit hazy at this level, because I
>>>>>>>>>>>>>>>> can
>>>>>>>>>>>>>>>> understand
>>>>>>>>>>>>>>>> why it was done that way... does anyone with more generics
>>>>>>>>>>>>>>>> experience
>>>>>>>>>>>>>>>> know
>>>>>>>>>>>>>>>> what it should be? Is this a bug that needs filing?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> For some reason the DropDownChoice component doesn't have
>>>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>>>> same
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> generics as ListView and it will not accept a model that
>>>>>>>>>>>>>>>>>> listview
>>>>>>>>>>>>>>>>>> will,
>>>>>>>>>>>>>>>>>> despite its saying that it will accept an IModel.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Is anyone else having that sort of trouble with
>>>>>>>>>>>>>>>>>> DropDownChoice?
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Can you give us more information on what exactly is not
>>>>>>>>>>>>>>>>> working
>>>>>>>>>>>>>>>>> for
>>>>>>>>>>>>>>>>> you?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> DropDownChoice indeed does accept a model, see for
>>>>>>>>>>>>>>>>> instance the
>>>>>>>>>>>>>>>>> example
>>>>>>>>>>>>>>>>> in
>>>>>>>>>>>>>>>>> the class description at
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> This works for me.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Kaspar
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> <!-- HTML: -->
>>>>>>>>>>>>>>>>> <select wicket:id="site">
>>>>>>>>>>>>>>>>>          <option>site 1</option>
>>>>>>>>>>>>>>>>>          <option>site 2</option>
>>>>>>>>>>>>>>>>> </select>
>>>>>>>>>>>>>>>>> <ul>
>>>>>>>>>>>>>>>>> <li wicket:id="site2"><wicket:container
>>>>>>>>>>>>>>>>> wicket:id="sitename"/></li>
>>>>>>>>>>>>>>>>> </ul>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> // Code
>>>>>>>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>>>>>>>>>>>>>>>>>  "The Server Side", "Java Lobby", "Java.Net"
>>>>>>>>>>>>>>>>> });
>>>>>>>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>>>>>>>>>>>>>>>>> form.add(new ListView("site2", SITES)
>>>>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>>>> @Override
>>>>>>>>>>>>>>>>> protected void populateItem(ListItem item)
>>>>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>>>>  item.add(new Label("sitename", item.getModel()));
>>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>>> });
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>>>>> 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
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ? extends
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>> 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
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>> es, the choice
>>>>>>>>>>
>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>> 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
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/using-a-model-with-DropDownChoice-tp22234544p22311062.html
Sent from the Wicket - User 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: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Igor Vaynberg <ig...@gmail.com>.
i also dont remember using a compound property model...can we remove that?

-igor

On Mon, Mar 2, 2009 at 12:57 PM, James Carman
<jc...@carmanconsulting.com> wrote:
> Can you remember ever having to do either one of those?  I guess I
> could see someone trying to do such a thing during the processing of
> an AJAX request to perhaps make more stuff show up in the
> DDC/ListView.  But, for that case, wouldn't it be easier to just
> modify the underlying list (I assume they'd use a list because
> anything else, such as an LDM, would tend to be read-only)?
>
> On Mon, Mar 2, 2009 at 3:47 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>> depends on your coding style.
>>
>> -igor
>>
>> On Mon, Mar 2, 2009 at 12:44 PM, James Carman
>> <jc...@carmanconsulting.com> wrote:
>>> Aren't both the "choices" model in DDC and the actual model of
>>> ListView supposed to be considered read-only (as far as the component
>>> is concerned)?  The DDC and ListView don't need to be able to alter
>>> those models anyway, right?  Perhaps my experience is just too
>>> limited, but I don't think I've ever tried to do either one of your
>>> usecases (I always consider them read-only).
>>>
>>>
>>> On Mon, Mar 2, 2009 at 3:24 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>>> see WICKET-2126
>>>>
>>>> -igor
>>>>
>>>> On Mon, Mar 2, 2009 at 12:19 PM, James Carman
>>>> <jc...@carmanconsulting.com> wrote:
>>>>> I vote -0.99 on this (non-binding of course).  I'd vote +1 to making
>>>>> ListView accept List<? extends T> rather than making DDC less
>>>>> flexible.
>>>>>
>>>>> On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>>>> Ok, as suggested, here is the thread, and the first vote.
>>>>>>
>>>>>> +1
>>>>>> for making the generic definition the same for all list type components.
>>>>>>
>>>>>> FYI -  you can also "vote" in the issue I just created at (which might
>>>>>> actually be a better place to vote):
>>>>>> https://issues.apache.org/jira/browse/WICKET-2137
>>>>>>
>>>>>> - Brill
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>>>>>>
>>>>>>> Perhaps start a vote thread, with the subject something like: "VOTE:
>>>>>>> Remove
>>>>>>> ? extends from constructor of DropDownChoice".
>>>>>>>
>>>>>>> I'd be +1 non-binding
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Jeremy Thomerson
>>>>>>> http://www.wickettraining.com
>>>>>>>
>>>>>>>
>>>>>>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>>>>>
>>>>>>>> I'm of the don't widen it camp anyway :)
>>>>>>>>
>>>>>>>> So how do I go about gathering support for having the DropDownChoice work
>>>>>>>> with the models the way everything else does?
>>>>>>>>
>>>>>>>> - Brill
>>>>>>>>
>>>>>>>>
>>>>>>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>>>>>>>>
>>>>>>>> yes, the choice was intentional. personally i do not care if it is <T>
>>>>>>>>>
>>>>>>>>> all the way, some users complained so we widened it on the choices
>>>>>>>>> model, we cannot widen it on the main model.
>>>>>>>>>
>>>>>>>>> -igor
>>>>>>>>>
>>>>>>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>>>>>>>
>>>>>>>>>> I see... but this would i think because Bar "is a" Foo:
>>>>>>>>>>
>>>>>>>>>> class Bar exends Foo {}
>>>>>>>>>> List<? extends Foo> list = ...
>>>>>>>>>> list.add(new Bar());
>>>>>>>>>>
>>>>>>>>>> Anyway, what your saying is that the generics choice was intentional?
>>>>>>>>>>
>>>>>>>>>> - Brill
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>>>>>>>>>>
>>>>>>>>>> list<? extends string> stings=...
>>>>>>>>>>>
>>>>>>>>>>> strings.add("asd"); <== wont compile
>>>>>>>>>>>
>>>>>>>>>>> -igor
>>>>>>>>>>>
>>>>>>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos Fernandes
>>>>>>>>>>> <ad...@gmail.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> What do you mean with "read only" here?
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Adriano
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Igor Vaynberg escreveu:
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> <? extends Foo> collections are read only, it would be too
>>>>>>>>>>>>> inconvenient to make the model collection read only :)
>>>>>>>>>>>>>
>>>>>>>>>>>>> -igor
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>>>>>>>>>>>>> <je...@wickettraining.com> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>> This is what I was commenting on last week on the list (or earlier
>>>>>>>>>>>>>> this
>>>>>>>>>>>>>> week).  One expects List<? extends Foo> while the other expects
>>>>>>>>>>>>>> List<Foo>.
>>>>>>>>>>>>>> I'm not fully convinced yet that the "? extends" is the better
>>>>>>>>>>>>>> option.
>>>>>>>>>>>>>> Either way, I think they should be the same.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> --
>>>>>>>>>>>>>> Jeremy Thomerson
>>>>>>>>>>>>>> http://www.wickettraining.com
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <br...@pappin.ca>
>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Roughly what I'm doing is:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> class TypeA{}
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> class TypeAModel extends LoadableDetachableModel< List<TypeA>> {
>>>>>>>>>>>>>>>   public List<TypeA> load(){
>>>>>>>>>>>>>>>           ... do the load ...
>>>>>>>>>>>>>>>           return ...
>>>>>>>>>>>>>>>   }
>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> TypeAModel model = new TypeAModel();
>>>>>>>>>>>>>>> DropDownChoice< TypeA> ddc = new DropDownChoice<TypeA>("id", model
>>>>>>>>>>>>>>> );
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> which gets complained about... in this case the generic def is
>>>>>>>>>>>>>>> DropDownChoice<List<? extends T>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I think the problem is that the generic def of the class should
>>>>>>>>>>>>>>> actually
>>>>>>>>>>>>>>> be
>>>>>>>>>>>>>>> DropDownChoice<List<T>> because you are already identifying the
>>>>>>>>>>>>>>> type
>>>>>>>>>>>>>>> when
>>>>>>>>>>>>>>> you create a new instance.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Now... my generics are a bit hazy at this level, because I can
>>>>>>>>>>>>>>> understand
>>>>>>>>>>>>>>> why it was done that way... does anyone with more generics
>>>>>>>>>>>>>>> experience
>>>>>>>>>>>>>>> know
>>>>>>>>>>>>>>> what it should be? Is this a bug that needs filing?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> For some reason the DropDownChoice component doesn't have the
>>>>>>>>>>>>>>>> same
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> generics as ListView and it will not accept a model that
>>>>>>>>>>>>>>>>> listview
>>>>>>>>>>>>>>>>> will,
>>>>>>>>>>>>>>>>> despite its saying that it will accept an IModel.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Is anyone else having that sort of trouble with DropDownChoice?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Can you give us more information on what exactly is not working
>>>>>>>>>>>>>>>> for
>>>>>>>>>>>>>>>> you?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> DropDownChoice indeed does accept a model, see for instance the
>>>>>>>>>>>>>>>> example
>>>>>>>>>>>>>>>> in
>>>>>>>>>>>>>>>> the class description at
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> This works for me.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Kaspar
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> <!-- HTML: -->
>>>>>>>>>>>>>>>> <select wicket:id="site">
>>>>>>>>>>>>>>>>          <option>site 1</option>
>>>>>>>>>>>>>>>>          <option>site 2</option>
>>>>>>>>>>>>>>>> </select>
>>>>>>>>>>>>>>>> <ul>
>>>>>>>>>>>>>>>> <li wicket:id="site2"><wicket:container
>>>>>>>>>>>>>>>> wicket:id="sitename"/></li>
>>>>>>>>>>>>>>>> </ul>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> // Code
>>>>>>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>>>>>>>>>>>>>>>>  "The Server Side", "Java Lobby", "Java.Net"
>>>>>>>>>>>>>>>> });
>>>>>>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>>>>>>>>>>>>>>>> form.add(new ListView("site2", SITES)
>>>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>>> @Override
>>>>>>>>>>>>>>>> protected void populateItem(ListItem item)
>>>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>>>  item.add(new Label("sitename", item.getModel()));
>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>> });
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>>>> 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
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>> ? extends
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>> 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
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> es, the choice
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> 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
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>
>

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


Re: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by James Carman <jc...@carmanconsulting.com>.
Can you remember ever having to do either one of those?  I guess I
could see someone trying to do such a thing during the processing of
an AJAX request to perhaps make more stuff show up in the
DDC/ListView.  But, for that case, wouldn't it be easier to just
modify the underlying list (I assume they'd use a list because
anything else, such as an LDM, would tend to be read-only)?

On Mon, Mar 2, 2009 at 3:47 PM, Igor Vaynberg <ig...@gmail.com> wrote:
> depends on your coding style.
>
> -igor
>
> On Mon, Mar 2, 2009 at 12:44 PM, James Carman
> <jc...@carmanconsulting.com> wrote:
>> Aren't both the "choices" model in DDC and the actual model of
>> ListView supposed to be considered read-only (as far as the component
>> is concerned)?  The DDC and ListView don't need to be able to alter
>> those models anyway, right?  Perhaps my experience is just too
>> limited, but I don't think I've ever tried to do either one of your
>> usecases (I always consider them read-only).
>>
>>
>> On Mon, Mar 2, 2009 at 3:24 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>> see WICKET-2126
>>>
>>> -igor
>>>
>>> On Mon, Mar 2, 2009 at 12:19 PM, James Carman
>>> <jc...@carmanconsulting.com> wrote:
>>>> I vote -0.99 on this (non-binding of course).  I'd vote +1 to making
>>>> ListView accept List<? extends T> rather than making DDC less
>>>> flexible.
>>>>
>>>> On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>>> Ok, as suggested, here is the thread, and the first vote.
>>>>>
>>>>> +1
>>>>> for making the generic definition the same for all list type components.
>>>>>
>>>>> FYI -  you can also "vote" in the issue I just created at (which might
>>>>> actually be a better place to vote):
>>>>> https://issues.apache.org/jira/browse/WICKET-2137
>>>>>
>>>>> - Brill
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>>>>>
>>>>>> Perhaps start a vote thread, with the subject something like: "VOTE:
>>>>>> Remove
>>>>>> ? extends from constructor of DropDownChoice".
>>>>>>
>>>>>> I'd be +1 non-binding
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Jeremy Thomerson
>>>>>> http://www.wickettraining.com
>>>>>>
>>>>>>
>>>>>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>>>>
>>>>>>> I'm of the don't widen it camp anyway :)
>>>>>>>
>>>>>>> So how do I go about gathering support for having the DropDownChoice work
>>>>>>> with the models the way everything else does?
>>>>>>>
>>>>>>> - Brill
>>>>>>>
>>>>>>>
>>>>>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>>>>>>>
>>>>>>> yes, the choice was intentional. personally i do not care if it is <T>
>>>>>>>>
>>>>>>>> all the way, some users complained so we widened it on the choices
>>>>>>>> model, we cannot widen it on the main model.
>>>>>>>>
>>>>>>>> -igor
>>>>>>>>
>>>>>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>>>>>>
>>>>>>>>> I see... but this would i think because Bar "is a" Foo:
>>>>>>>>>
>>>>>>>>> class Bar exends Foo {}
>>>>>>>>> List<? extends Foo> list = ...
>>>>>>>>> list.add(new Bar());
>>>>>>>>>
>>>>>>>>> Anyway, what your saying is that the generics choice was intentional?
>>>>>>>>>
>>>>>>>>> - Brill
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>>>>>>>>>
>>>>>>>>> list<? extends string> stings=...
>>>>>>>>>>
>>>>>>>>>> strings.add("asd"); <== wont compile
>>>>>>>>>>
>>>>>>>>>> -igor
>>>>>>>>>>
>>>>>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos Fernandes
>>>>>>>>>> <ad...@gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> What do you mean with "read only" here?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Adriano
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Igor Vaynberg escreveu:
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> <? extends Foo> collections are read only, it would be too
>>>>>>>>>>>> inconvenient to make the model collection read only :)
>>>>>>>>>>>>
>>>>>>>>>>>> -igor
>>>>>>>>>>>>
>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>>>>>>>>>>>> <je...@wickettraining.com> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>> This is what I was commenting on last week on the list (or earlier
>>>>>>>>>>>>> this
>>>>>>>>>>>>> week).  One expects List<? extends Foo> while the other expects
>>>>>>>>>>>>> List<Foo>.
>>>>>>>>>>>>> I'm not fully convinced yet that the "? extends" is the better
>>>>>>>>>>>>> option.
>>>>>>>>>>>>> Either way, I think they should be the same.
>>>>>>>>>>>>>
>>>>>>>>>>>>> --
>>>>>>>>>>>>> Jeremy Thomerson
>>>>>>>>>>>>> http://www.wickettraining.com
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <br...@pappin.ca>
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Roughly what I'm doing is:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> class TypeA{}
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> class TypeAModel extends LoadableDetachableModel< List<TypeA>> {
>>>>>>>>>>>>>>   public List<TypeA> load(){
>>>>>>>>>>>>>>           ... do the load ...
>>>>>>>>>>>>>>           return ...
>>>>>>>>>>>>>>   }
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> TypeAModel model = new TypeAModel();
>>>>>>>>>>>>>> DropDownChoice< TypeA> ddc = new DropDownChoice<TypeA>("id", model
>>>>>>>>>>>>>> );
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> which gets complained about... in this case the generic def is
>>>>>>>>>>>>>> DropDownChoice<List<? extends T>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I think the problem is that the generic def of the class should
>>>>>>>>>>>>>> actually
>>>>>>>>>>>>>> be
>>>>>>>>>>>>>> DropDownChoice<List<T>> because you are already identifying the
>>>>>>>>>>>>>> type
>>>>>>>>>>>>>> when
>>>>>>>>>>>>>> you create a new instance.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Now... my generics are a bit hazy at this level, because I can
>>>>>>>>>>>>>> understand
>>>>>>>>>>>>>> why it was done that way... does anyone with more generics
>>>>>>>>>>>>>> experience
>>>>>>>>>>>>>> know
>>>>>>>>>>>>>> what it should be? Is this a bug that needs filing?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> For some reason the DropDownChoice component doesn't have the
>>>>>>>>>>>>>>> same
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> generics as ListView and it will not accept a model that
>>>>>>>>>>>>>>>> listview
>>>>>>>>>>>>>>>> will,
>>>>>>>>>>>>>>>> despite its saying that it will accept an IModel.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Is anyone else having that sort of trouble with DropDownChoice?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Can you give us more information on what exactly is not working
>>>>>>>>>>>>>>> for
>>>>>>>>>>>>>>> you?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> DropDownChoice indeed does accept a model, see for instance the
>>>>>>>>>>>>>>> example
>>>>>>>>>>>>>>> in
>>>>>>>>>>>>>>> the class description at
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> This works for me.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Kaspar
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> <!-- HTML: -->
>>>>>>>>>>>>>>> <select wicket:id="site">
>>>>>>>>>>>>>>>          <option>site 1</option>
>>>>>>>>>>>>>>>          <option>site 2</option>
>>>>>>>>>>>>>>> </select>
>>>>>>>>>>>>>>> <ul>
>>>>>>>>>>>>>>> <li wicket:id="site2"><wicket:container
>>>>>>>>>>>>>>> wicket:id="sitename"/></li>
>>>>>>>>>>>>>>> </ul>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> // Code
>>>>>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>>>>>>>>>>>>>>>  "The Server Side", "Java Lobby", "Java.Net"
>>>>>>>>>>>>>>> });
>>>>>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>>>>>>>>>>>>>>> form.add(new ListView("site2", SITES)
>>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>> @Override
>>>>>>>>>>>>>>> protected void populateItem(ListItem item)
>>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>>  item.add(new Label("sitename", item.getModel()));
>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>> });
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>>> 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
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>> ? extends
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>> 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
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> es, the choice
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> 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
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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


Re: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Igor Vaynberg <ig...@gmail.com>.
depends on your coding style.

-igor

On Mon, Mar 2, 2009 at 12:44 PM, James Carman
<jc...@carmanconsulting.com> wrote:
> Aren't both the "choices" model in DDC and the actual model of
> ListView supposed to be considered read-only (as far as the component
> is concerned)?  The DDC and ListView don't need to be able to alter
> those models anyway, right?  Perhaps my experience is just too
> limited, but I don't think I've ever tried to do either one of your
> usecases (I always consider them read-only).
>
>
> On Mon, Mar 2, 2009 at 3:24 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>> see WICKET-2126
>>
>> -igor
>>
>> On Mon, Mar 2, 2009 at 12:19 PM, James Carman
>> <jc...@carmanconsulting.com> wrote:
>>> I vote -0.99 on this (non-binding of course).  I'd vote +1 to making
>>> ListView accept List<? extends T> rather than making DDC less
>>> flexible.
>>>
>>> On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>> Ok, as suggested, here is the thread, and the first vote.
>>>>
>>>> +1
>>>> for making the generic definition the same for all list type components.
>>>>
>>>> FYI -  you can also "vote" in the issue I just created at (which might
>>>> actually be a better place to vote):
>>>> https://issues.apache.org/jira/browse/WICKET-2137
>>>>
>>>> - Brill
>>>>
>>>>
>>>>
>>>>
>>>> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>>>>
>>>>> Perhaps start a vote thread, with the subject something like: "VOTE:
>>>>> Remove
>>>>> ? extends from constructor of DropDownChoice".
>>>>>
>>>>> I'd be +1 non-binding
>>>>>
>>>>>
>>>>> --
>>>>> Jeremy Thomerson
>>>>> http://www.wickettraining.com
>>>>>
>>>>>
>>>>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>>>
>>>>>> I'm of the don't widen it camp anyway :)
>>>>>>
>>>>>> So how do I go about gathering support for having the DropDownChoice work
>>>>>> with the models the way everything else does?
>>>>>>
>>>>>> - Brill
>>>>>>
>>>>>>
>>>>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>>>>>>
>>>>>> yes, the choice was intentional. personally i do not care if it is <T>
>>>>>>>
>>>>>>> all the way, some users complained so we widened it on the choices
>>>>>>> model, we cannot widen it on the main model.
>>>>>>>
>>>>>>> -igor
>>>>>>>
>>>>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>>>>>
>>>>>>>> I see... but this would i think because Bar "is a" Foo:
>>>>>>>>
>>>>>>>> class Bar exends Foo {}
>>>>>>>> List<? extends Foo> list = ...
>>>>>>>> list.add(new Bar());
>>>>>>>>
>>>>>>>> Anyway, what your saying is that the generics choice was intentional?
>>>>>>>>
>>>>>>>> - Brill
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>>>>>>>>
>>>>>>>> list<? extends string> stings=...
>>>>>>>>>
>>>>>>>>> strings.add("asd"); <== wont compile
>>>>>>>>>
>>>>>>>>> -igor
>>>>>>>>>
>>>>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos Fernandes
>>>>>>>>> <ad...@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> What do you mean with "read only" here?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Adriano
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Igor Vaynberg escreveu:
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> <? extends Foo> collections are read only, it would be too
>>>>>>>>>>> inconvenient to make the model collection read only :)
>>>>>>>>>>>
>>>>>>>>>>> -igor
>>>>>>>>>>>
>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>>>>>>>>>>> <je...@wickettraining.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> This is what I was commenting on last week on the list (or earlier
>>>>>>>>>>>> this
>>>>>>>>>>>> week).  One expects List<? extends Foo> while the other expects
>>>>>>>>>>>> List<Foo>.
>>>>>>>>>>>> I'm not fully convinced yet that the "? extends" is the better
>>>>>>>>>>>> option.
>>>>>>>>>>>> Either way, I think they should be the same.
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> Jeremy Thomerson
>>>>>>>>>>>> http://www.wickettraining.com
>>>>>>>>>>>>
>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <br...@pappin.ca>
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>> Roughly what I'm doing is:
>>>>>>>>>>>>>
>>>>>>>>>>>>> class TypeA{}
>>>>>>>>>>>>>
>>>>>>>>>>>>> class TypeAModel extends LoadableDetachableModel< List<TypeA>> {
>>>>>>>>>>>>>   public List<TypeA> load(){
>>>>>>>>>>>>>           ... do the load ...
>>>>>>>>>>>>>           return ...
>>>>>>>>>>>>>   }
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>> TypeAModel model = new TypeAModel();
>>>>>>>>>>>>> DropDownChoice< TypeA> ddc = new DropDownChoice<TypeA>("id", model
>>>>>>>>>>>>> );
>>>>>>>>>>>>>
>>>>>>>>>>>>> which gets complained about... in this case the generic def is
>>>>>>>>>>>>> DropDownChoice<List<? extends T>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> I think the problem is that the generic def of the class should
>>>>>>>>>>>>> actually
>>>>>>>>>>>>> be
>>>>>>>>>>>>> DropDownChoice<List<T>> because you are already identifying the
>>>>>>>>>>>>> type
>>>>>>>>>>>>> when
>>>>>>>>>>>>> you create a new instance.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Now... my generics are a bit hazy at this level, because I can
>>>>>>>>>>>>> understand
>>>>>>>>>>>>> why it was done that way... does anyone with more generics
>>>>>>>>>>>>> experience
>>>>>>>>>>>>> know
>>>>>>>>>>>>> what it should be? Is this a bug that needs filing?
>>>>>>>>>>>>>
>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>> For some reason the DropDownChoice component doesn't have the
>>>>>>>>>>>>>> same
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> generics as ListView and it will not accept a model that
>>>>>>>>>>>>>>> listview
>>>>>>>>>>>>>>> will,
>>>>>>>>>>>>>>> despite its saying that it will accept an IModel.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Is anyone else having that sort of trouble with DropDownChoice?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Can you give us more information on what exactly is not working
>>>>>>>>>>>>>> for
>>>>>>>>>>>>>> you?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> DropDownChoice indeed does accept a model, see for instance the
>>>>>>>>>>>>>> example
>>>>>>>>>>>>>> in
>>>>>>>>>>>>>> the class description at
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> This works for me.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Kaspar
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <!-- HTML: -->
>>>>>>>>>>>>>> <select wicket:id="site">
>>>>>>>>>>>>>>          <option>site 1</option>
>>>>>>>>>>>>>>          <option>site 2</option>
>>>>>>>>>>>>>> </select>
>>>>>>>>>>>>>> <ul>
>>>>>>>>>>>>>> <li wicket:id="site2"><wicket:container
>>>>>>>>>>>>>> wicket:id="sitename"/></li>
>>>>>>>>>>>>>> </ul>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> // Code
>>>>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>>>>>>>>>>>>>>  "The Server Side", "Java Lobby", "Java.Net"
>>>>>>>>>>>>>> });
>>>>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>>>>>>>>>>>>>> form.add(new ListView("site2", SITES)
>>>>>>>>>>>>>> {
>>>>>>>>>>>>>> @Override
>>>>>>>>>>>>>> protected void populateItem(ListItem item)
>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>  item.add(new Label("sitename", item.getModel()));
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>> });
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>> 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
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>> ? extends
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>> 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
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> es, the choice
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> 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
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> 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: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Olivier Michallat <om...@gmail.com>.
Hi everyone (I'm new to the list),

Johannes, you are right about lists:

> If the constructor accepts the widened type, you can add all those
> lists...
>
> List<? extends Number> n = new List<Number>;
> List<? extends Number> n = new List<Integer>;
> List<? extends Number> n = new List<Double>;

But in our case the constructor parameter is an IModel, no a list. Try
the following:

  IModel<List<? extends Number>> model = new
LoadableDetachableModel<List<Integer>>() { ... };

See my comment in JIRA for more detail.

Olivier


2009/3/4 Johannes Schneider <ma...@cedarsoft.com>:
> On Wed, 2009-03-04 at 10:04 -0500, Brill Pappin wrote:
>> I actually wasn't saying they were the same.
>> What I said (meant) was that:
>>
>> a) don't lock down
>
> Locking down means *removing* the wildcard. Adding the wildcard *widens*
> the collection.
>
> To be clear:
> Wildcard --> it fits for everybody
> No wildcard --> it fits only for some special cases (maybe yours)
>
>> b) I prefer the explicit form rather than the "Any of type" form. i.e.
>> <List<T>> rather than <List<? extends T>>.
>
> They mean something completely different. I understand that you prefer
> the shorter version. Many do. But it stays wrong...
>
> If the constructor accepts "List<Number>", everybody *has* to give you
> exactly a List<Number>.
>
> List<Number> n = new List<Number>;
>
>
> If the constructor accepts the widened type, you can add all those
> lists...
>
> List<? extends Number> n = new List<Number>;
> List<? extends Number> n = new List<Integer>;
> List<? extends Number> n = new List<Double>;
>
>
> If you don't believe me, take a look at GlazedLists. Compare version 1.7
> and version 1.8. They changed exactly that thing (a non backward
> compatible change!). They made exactly the same fault...
>
>
> Regards,
>
> Johannes
>
>>
>> - Brill
>>
>> On 4-Mar-09, at 6:26 AM, Johannes Schneider wrote:
>>
>> > On Tue, 2009-03-03 at 16:02 -0500, Brill Pappin wrote:
>> >> I'd hate to be
>> >> prevented from doing so simply because someone wanted to lock down an
>> >> API that didn't really need locking down.
>> >
>> > You are wrong. *Widening* a collection is the exact opposite of
>> > "locking
>> > down".
>> > If you want to have some fancy (read "hacky") write access to the
>> > model
>> > you are free to simply cast...
>> > That is the right choice here. You know that you have a special
>> > model in
>> > there, so cast it.
>> >
>> > But the "common" case is, that you don't know for sure whether the
>> > model
>> > supports adding of choices or not.
>> >
>> >
>> > If you don't believe me, take a look at JComboBox.
>> > javax.swing.JComboBox#getModel returns a *read only* view of the
>> > model.
>> >
>> >
>> >
>> > Regards,
>> >
>> > Johannes
>> >
>> >
>> >> I think the syntax doesn't really mean read only, and if the wicket
>> >> developers really want it to be read only, wrapping the list would be
>> >> the way to go.
>> >>
>> >> I'm for the plain old <List<T>> because its simple and explicit...
>> >> <List<? extends T>> would be my next choice because it widens the
>> >> scope.
>> >>
>> >> - Brill
>> >>
>> >> On 2-Mar-09, at 3:44 PM, James Carman wrote:
>> >>
>> >>> Aren't both the "choices" model in DDC and the actual model of
>> >>> ListView supposed to be considered read-only (as far as the
>> >>> component
>> >>> is concerned)?  The DDC and ListView don't need to be able to alter
>> >>> those models anyway, right?  Perhaps my experience is just too
>> >>> limited, but I don't think I've ever tried to do either one of your
>> >>> usecases (I always consider them read-only).
>> >>>
>> >>>
>> >>> On Mon, Mar 2, 2009 at 3:24 PM, Igor Vaynberg
>> >>> <ig...@gmail.com> wrote:
>> >>>> see WICKET-2126
>> >>>>
>> >>>> -igor
>> >>>>
>> >>>> On Mon, Mar 2, 2009 at 12:19 PM, James Carman
>> >>>> <jc...@carmanconsulting.com> wrote:
>> >>>>> I vote -0.99 on this (non-binding of course).  I'd vote +1 to
>> >>>>> making
>> >>>>> ListView accept List<? extends T> rather than making DDC less
>> >>>>> flexible.
>> >>>>>
>> >>>>> On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin <br...@pappin.ca>
>> >>>>> wrote:
>> >>>>>> Ok, as suggested, here is the thread, and the first vote.
>> >>>>>>
>> >>>>>> +1
>> >>>>>> for making the generic definition the same for all list type
>> >>>>>> components.
>> >>>>>>
>> >>>>>> FYI -  you can also "vote" in the issue I just created at (which
>> >>>>>> might
>> >>>>>> actually be a better place to vote):
>> >>>>>> https://issues.apache.org/jira/browse/WICKET-2137
>> >>>>>>
>> >>>>>> - Brill
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>> >>>>>>
>> >>>>>>> Perhaps start a vote thread, with the subject something like:
>> >>>>>>> "VOTE:
>> >>>>>>> Remove
>> >>>>>>> ? extends from constructor of DropDownChoice".
>> >>>>>>>
>> >>>>>>> I'd be +1 non-binding
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> --
>> >>>>>>> Jeremy Thomerson
>> >>>>>>> http://www.wickettraining.com
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca>
>> >>>>>>> wrote:
>> >>>>>>>
>> >>>>>>>> I'm of the don't widen it camp anyway :)
>> >>>>>>>>
>> >>>>>>>> So how do I go about gathering support for having the
>> >>>>>>>> DropDownChoice work
>> >>>>>>>> with the models the way everything else does?
>> >>>>>>>>
>> >>>>>>>> - Brill
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>> >>>>>>>>
>> >>>>>>>> yes, the choice was intentional. personally i do not care if it
>> >>>>>>>> is <T>
>> >>>>>>>>>
>> >>>>>>>>> all the way, some users complained so we widened it on the
>> >>>>>>>>> choices
>> >>>>>>>>> model, we cannot widen it on the main model.
>> >>>>>>>>>
>> >>>>>>>>> -igor
>> >>>>>>>>>
>> >>>>>>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin
>> >>>>>>>>> <br...@pappin.ca> wrote:
>> >>>>>>>>>
>> >>>>>>>>>> I see... but this would i think because Bar "is a" Foo:
>> >>>>>>>>>>
>> >>>>>>>>>> class Bar exends Foo {}
>> >>>>>>>>>> List<? extends Foo> list = ...
>> >>>>>>>>>> list.add(new Bar());
>> >>>>>>>>>>
>> >>>>>>>>>> Anyway, what your saying is that the generics choice was
>> >>>>>>>>>> intentional?
>> >>>>>>>>>>
>> >>>>>>>>>> - Brill
>> >>>>>>>>>>
>> >>>>>>>>>>
>> >>>>>>>>>>
>> >>>>>>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>> >>>>>>>>>>
>> >>>>>>>>>> list<? extends string> stings=...
>> >>>>>>>>>>>
>> >>>>>>>>>>> strings.add("asd"); <== wont compile
>> >>>>>>>>>>>
>> >>>>>>>>>>> -igor
>> >>>>>>>>>>>
>> >>>>>>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos
>> >>>>>>>>>>> Fernandes
>> >>>>>>>>>>> <ad...@gmail.com> wrote:
>> >>>>>>>>>>>
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> What do you mean with "read only" here?
>> >>>>>>>>>>>>
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> Adriano
>> >>>>>>>>>>>>
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> Igor Vaynberg escreveu:
>> >>>>>>>>>>>>
>> >>>>>>>>>>>>>
>> >>>>>>>>>>>>> <? extends Foo> collections are read only, it would be too
>> >>>>>>>>>>>>> inconvenient to make the model collection read only :)
>> >>>>>>>>>>>>>
>> >>>>>>>>>>>>> -igor
>> >>>>>>>>>>>>>
>> >>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>> >>>>>>>>>>>>> <je...@wickettraining.com> wrote:
>> >>>>>>>>>>>>>
>> >>>>>>>>>>>>>
>> >>>>>>>>>>>>>> This is what I was commenting on last week on the list
>> >>>>>>>>>>>>>> (or earlier
>> >>>>>>>>>>>>>> this
>> >>>>>>>>>>>>>> week).  One expects List<? extends Foo> while the other
>> >>>>>>>>>>>>>> expects
>> >>>>>>>>>>>>>> List<Foo>.
>> >>>>>>>>>>>>>> I'm not fully convinced yet that the "? extends" is the
>> >>>>>>>>>>>>>> better
>> >>>>>>>>>>>>>> option.
>> >>>>>>>>>>>>>> Either way, I think they should be the same.
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>> --
>> >>>>>>>>>>>>>> Jeremy Thomerson
>> >>>>>>>>>>>>>> http://www.wickettraining.com
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <brill@pappin.ca
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>> wrote:
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> Roughly what I'm doing is:
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> class TypeA{}
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> class TypeAModel extends LoadableDetachableModel<
>> >>>>>>>>>>>>>>> List<TypeA>> {
>> >>>>>>>>>>>>>>>  public List<TypeA> load(){
>> >>>>>>>>>>>>>>>          ... do the load ...
>> >>>>>>>>>>>>>>>          return ...
>> >>>>>>>>>>>>>>>  }
>> >>>>>>>>>>>>>>> }
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> TypeAModel model = new TypeAModel();
>> >>>>>>>>>>>>>>> DropDownChoice< TypeA> ddc = new
>> >>>>>>>>>>>>>>> DropDownChoice<TypeA>("id", model
>> >>>>>>>>>>>>>>> );
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> which gets complained about... in this case the generic
>> >>>>>>>>>>>>>>> def is
>> >>>>>>>>>>>>>>> DropDownChoice<List<? extends T>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> I think the problem is that the generic def of the class
>> >>>>>>>>>>>>>>> should
>> >>>>>>>>>>>>>>> actually
>> >>>>>>>>>>>>>>> be
>> >>>>>>>>>>>>>>> DropDownChoice<List<T>> because you are already
>> >>>>>>>>>>>>>>> identifying the
>> >>>>>>>>>>>>>>> type
>> >>>>>>>>>>>>>>> when
>> >>>>>>>>>>>>>>> you create a new instance.
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> Now... my generics are a bit hazy at this level, because
>> >>>>>>>>>>>>>>> I can
>> >>>>>>>>>>>>>>> understand
>> >>>>>>>>>>>>>>> why it was done that way... does anyone with more
>> >>>>>>>>>>>>>>> generics
>> >>>>>>>>>>>>>>> experience
>> >>>>>>>>>>>>>>> know
>> >>>>>>>>>>>>>>> what it should be? Is this a bug that needs filing?
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> - Brill
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> For some reason the DropDownChoice component doesn't
>> >>>>>>>>>>>>>>>> have the
>> >>>>>>>>>>>>>>>> same
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>> generics as ListView and it will not accept a model
>> >>>>>>>>>>>>>>>>> that
>> >>>>>>>>>>>>>>>>> listview
>> >>>>>>>>>>>>>>>>> will,
>> >>>>>>>>>>>>>>>>> despite its saying that it will accept an IModel.
>> >>>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>> Is anyone else having that sort of trouble with
>> >>>>>>>>>>>>>>>>> DropDownChoice?
>> >>>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>> - Brill
>> >>>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> Can you give us more information on what exactly is not
>> >>>>>>>>>>>>>>>> working
>> >>>>>>>>>>>>>>>> for
>> >>>>>>>>>>>>>>>> you?
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> DropDownChoice indeed does accept a model, see for
>> >>>>>>>>>>>>>>>> instance the
>> >>>>>>>>>>>>>>>> example
>> >>>>>>>>>>>>>>>> in
>> >>>>>>>>>>>>>>>> the class description at
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> This works for me.
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> Kaspar
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> --
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> <!-- HTML: -->
>> >>>>>>>>>>>>>>>> <select wicket:id="site">
>> >>>>>>>>>>>>>>>>         <option>site 1</option>
>> >>>>>>>>>>>>>>>>         <option>site 2</option>
>> >>>>>>>>>>>>>>>> </select>
>> >>>>>>>>>>>>>>>> <ul>
>> >>>>>>>>>>>>>>>> <li wicket:id="site2"><wicket:container
>> >>>>>>>>>>>>>>>> wicket:id="sitename"/></li>
>> >>>>>>>>>>>>>>>> </ul>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> // Code
>> >>>>>>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>> >>>>>>>>>>>>>>>> "The Server Side", "Java Lobby", "Java.Net"
>> >>>>>>>>>>>>>>>> });
>> >>>>>>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>> >>>>>>>>>>>>>>>> form.add(new ListView("site2", SITES)
>> >>>>>>>>>>>>>>>> {
>> >>>>>>>>>>>>>>>> @Override
>> >>>>>>>>>>>>>>>> protected void populateItem(ListItem item)
>> >>>>>>>>>>>>>>>> {
>> >>>>>>>>>>>>>>>> item.add(new Label("sitename", item.getModel()));
>> >>>>>>>>>>>>>>>> }
>> >>>>>>>>>>>>>>>> });
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> ---------------------------------------------------------------------
>> >>>>>>>>>>>>>>>> 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
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>> ? extends
>> >>>>>>>>>>>>>
>> >>>>>>>>>>>>>
>> >>>>>>>>>>>>> ---------------------------------------------------------------------
>> >>>>>>>>>>>>> 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
>> >>>>>>>>>>
>> >>>>>>>>>>
>> >>>>>>>>>>
>> >>>>>>>>> es, the choice
>> >>>>>>>>>
>> >>>>>>>>> ---------------------------------------------------------------------
>> >>>>>>>>> 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
>> >>>>>
>> >>>>>
>> >>>>
>> >>>> ---------------------------------------------------------------------
>> >>>> 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
>> >
>>
>>
>> ---------------------------------------------------------------------
>> 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: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Tue, 03 Mar 2009, Brill Pappin wrote:
> Might as well merge the two then... I did do a quick check to see if  
> there was another ticket, but obviously a bit too quick :)

I think that it's more or less a "full-time hobby" just 
trying to keep up with what happens on the lists and Jira 
and source code repository :)


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


Re: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Scott Swank <sc...@gmail.com>.
I agree.  It is very sensible to be able to provide a
Model<List<Integer>> as the choices for a dropdown that has
Model<Number>.  Restricting the choices to Model<List<T>> only
eliminates (sensible) options for the client code.

Scott

On Wed, Mar 4, 2009 at 8:08 AM, Johannes Schneider
<ma...@cedarsoft.com> wrote:
> On Wed, 2009-03-04 at 10:04 -0500, Brill Pappin wrote:
>> I actually wasn't saying they were the same.
>> What I said (meant) was that:
>>
>> a) don't lock down
>
> Locking down means *removing* the wildcard. Adding the wildcard *widens*
> the collection.
>
> To be clear:
> Wildcard --> it fits for everybody
> No wildcard --> it fits only for some special cases (maybe yours)
>
>> b) I prefer the explicit form rather than the "Any of type" form. i.e.
>> <List<T>> rather than <List<? extends T>>.
>
> They mean something completely different. I understand that you prefer
> the shorter version. Many do. But it stays wrong...
>
> If the constructor accepts "List<Number>", everybody *has* to give you
> exactly a List<Number>.
>
> List<Number> n = new List<Number>;
>
>
> If the constructor accepts the widened type, you can add all those
> lists...
>
> List<? extends Number> n = new List<Number>;
> List<? extends Number> n = new List<Integer>;
> List<? extends Number> n = new List<Double>;
>
>
> If you don't believe me, take a look at GlazedLists. Compare version 1.7
> and version 1.8. They changed exactly that thing (a non backward
> compatible change!). They made exactly the same fault...
>
>
> Regards,
>
> Johannes
> - Show quoted text -
>>
>> - Brill
>>
>> On 4-Mar-09, at 6:26 AM, Johannes Schneider wrote:
>>
>> > On Tue, 2009-03-03 at 16:02 -0500, Brill Pappin wrote:
>> >> I'd hate to be
>> >> prevented from doing so simply because someone wanted to lock down an
>> >> API that didn't really need locking down.
>> >
>> > You are wrong. *Widening* a collection is the exact opposite of
>> > "locking
>> > down".
>> > If you want to have some fancy (read "hacky") write access to the
>> > model
>> > you are free to simply cast...
>> > That is the right choice here. You know that you have a special
>> > model in
>> > there, so cast it.
>> >
>> > But the "common" case is, that you don't know for sure whether the
>> > model
>> > supports adding of choices or not.
>> >
>> >
>> > If you don't believe me, take a look at JComboBox.
>> > javax.swing.JComboBox#getModel returns a *read only* view of the
>> > model.
>> >
>> >
>> >
>> > Regards,
>> >
>> > Johannes
>> >
>> >
>> >> I think the syntax doesn't really mean read only, and if the wicket
>> >> developers really want it to be read only, wrapping the list would be
>> >> the way to go.
>> >>
>> >> I'm for the plain old <List<T>> because its simple and explicit...
>> >> <List<? extends T>> would be my next choice because it widens the
>> >> scope.
>> >>
>> >> - Brill
>> >>
>> >> On 2-Mar-09, at 3:44 PM, James Carman wrote:
>> >>
>> >>> Aren't both the "choices" model in DDC and the actual model of
>> >>> ListView supposed to be considered read-only (as far as the
>> >>> component
>> >>> is concerned)?  The DDC and ListView don't need to be able to alter
>> >>> those models anyway, right?  Perhaps my experience is just too
>> >>> limited, but I don't think I've ever tried to do either one of your
>> >>> usecases (I always consider them read-only).
>> >>>
>> >>>
>> >>> On Mon, Mar 2, 2009 at 3:24 PM, Igor Vaynberg
>> >>> <ig...@gmail.com> wrote:
>> >>>> see WICKET-2126
>> >>>>
>> >>>> -igor
>> >>>>
>> >>>> On Mon, Mar 2, 2009 at 12:19 PM, James Carman
>> >>>> <jc...@carmanconsulting.com> wrote:
>> >>>>> I vote -0.99 on this (non-binding of course).  I'd vote +1 to
>> >>>>> making
>> >>>>> ListView accept List<? extends T> rather than making DDC less
>> >>>>> flexible.
>> >>>>>
>> >>>>> On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin <br...@pappin.ca>
>> >>>>> wrote:
>> >>>>>> Ok, as suggested, here is the thread, and the first vote.
>> >>>>>>
>> >>>>>> +1
>> >>>>>> for making the generic definition the same for all list type
>> >>>>>> components.
>> >>>>>>
>> >>>>>> FYI -  you can also "vote" in the issue I just created at (which
>> >>>>>> might
>> >>>>>> actually be a better place to vote):
>> >>>>>> https://issues.apache.org/jira/browse/WICKET-2137
>> >>>>>>
>> >>>>>> - Brill
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>> >>>>>>
>> >>>>>>> Perhaps start a vote thread, with the subject something like:
>> >>>>>>> "VOTE:
>> >>>>>>> Remove
>> >>>>>>> ? extends from constructor of DropDownChoice".
>> >>>>>>>
>> >>>>>>> I'd be +1 non-binding
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> --
>> >>>>>>> Jeremy Thomerson
>> >>>>>>> http://www.wickettraining.com
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca>
>> >>>>>>> wrote:
>> >>>>>>>
>> >>>>>>>> I'm of the don't widen it camp anyway :)
>> >>>>>>>>
>> >>>>>>>> So how do I go about gathering support for having the
>> >>>>>>>> DropDownChoice work
>> >>>>>>>> with the models the way everything else does?
>> >>>>>>>>
>> >>>>>>>> - Brill
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>> >>>>>>>>
>> >>>>>>>> yes, the choice was intentional. personally i do not care if it
>> >>>>>>>> is <T>
>> >>>>>>>>>
>> >>>>>>>>> all the way, some users complained so we widened it on the
>> >>>>>>>>> choices
>> >>>>>>>>> model, we cannot widen it on the main model.
>> >>>>>>>>>
>> >>>>>>>>> -igor
>> >>>>>>>>>
>> >>>>>>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin
>> >>>>>>>>> <br...@pappin.ca> wrote:
>> >>>>>>>>>
>> >>>>>>>>>> I see... but this would i think because Bar "is a" Foo:
>> >>>>>>>>>>
>> >>>>>>>>>> class Bar exends Foo {}
>> >>>>>>>>>> List<? extends Foo> list = ...
>> >>>>>>>>>> list.add(new Bar());
>> >>>>>>>>>>
>> >>>>>>>>>> Anyway, what your saying is that the generics choice was
>> >>>>>>>>>> intentional?
>> >>>>>>>>>>
>> >>>>>>>>>> - Brill
>> >>>>>>>>>>
>> >>>>>>>>>>
>> >>>>>>>>>>
>> >>>>>>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>> >>>>>>>>>>
>> >>>>>>>>>> list<? extends string> stings=...
>> >>>>>>>>>>>
>> >>>>>>>>>>> strings.add("asd"); <== wont compile
>> >>>>>>>>>>>
>> >>>>>>>>>>> -igor
>> >>>>>>>>>>>
>> >>>>>>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos
>> >>>>>>>>>>> Fernandes
>> >>>>>>>>>>> <ad...@gmail.com> wrote:
>> >>>>>>>>>>>
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> What do you mean with "read only" here?
>> >>>>>>>>>>>>
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> Adriano
>> >>>>>>>>>>>>
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> Igor Vaynberg escreveu:
>> >>>>>>>>>>>>
>> >>>>>>>>>>>>>
>> >>>>>>>>>>>>> <? extends Foo> collections are read only, it would be too
>> >>>>>>>>>>>>> inconvenient to make the model collection read only :)
>> >>>>>>>>>>>>>
>> >>>>>>>>>>>>> -igor
>> >>>>>>>>>>>>>
>> >>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>> >>>>>>>>>>>>> <je...@wickettraining.com> wrote:
>> >>>>>>>>>>>>>
>> >>>>>>>>>>>>>
>> >>>>>>>>>>>>>> This is what I was commenting on last week on the list
>> >>>>>>>>>>>>>> (or earlier
>> >>>>>>>>>>>>>> this
>> >>>>>>>>>>>>>> week).  One expects List<? extends Foo> while the other
>> >>>>>>>>>>>>>> expects
>> >>>>>>>>>>>>>> List<Foo>.
>> >>>>>>>>>>>>>> I'm not fully convinced yet that the "? extends" is the
>> >>>>>>>>>>>>>> better
>> >>>>>>>>>>>>>> option.
>> >>>>>>>>>>>>>> Either way, I think they should be the same.
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>> --
>> >>>>>>>>>>>>>> Jeremy Thomerson
>> >>>>>>>>>>>>>> http://www.wickettraining.com
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <brill@pappin.ca
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>> wrote:
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> Roughly what I'm doing is:
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> class TypeA{}
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> class TypeAModel extends LoadableDetachableModel<
>> >>>>>>>>>>>>>>> List<TypeA>> {
>> >>>>>>>>>>>>>>>  public List<TypeA> load(){
>> >>>>>>>>>>>>>>>          ... do the load ...
>> >>>>>>>>>>>>>>>          return ...
>> >>>>>>>>>>>>>>>  }
>> >>>>>>>>>>>>>>> }
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> TypeAModel model = new TypeAModel();
>> >>>>>>>>>>>>>>> DropDownChoice< TypeA> ddc = new
>> >>>>>>>>>>>>>>> DropDownChoice<TypeA>("id", model
>> >>>>>>>>>>>>>>> );
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> which gets complained about... in this case the generic
>> >>>>>>>>>>>>>>> def is
>> >>>>>>>>>>>>>>> DropDownChoice<List<? extends T>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> I think the problem is that the generic def of the class
>> >>>>>>>>>>>>>>> should
>> >>>>>>>>>>>>>>> actually
>> >>>>>>>>>>>>>>> be
>> >>>>>>>>>>>>>>> DropDownChoice<List<T>> because you are already
>> >>>>>>>>>>>>>>> identifying the
>> >>>>>>>>>>>>>>> type
>> >>>>>>>>>>>>>>> when
>> >>>>>>>>>>>>>>> you create a new instance.
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> Now... my generics are a bit hazy at this level, because
>> >>>>>>>>>>>>>>> I can
>> >>>>>>>>>>>>>>> understand
>> >>>>>>>>>>>>>>> why it was done that way... does anyone with more
>> >>>>>>>>>>>>>>> generics
>> >>>>>>>>>>>>>>> experience
>> >>>>>>>>>>>>>>> know
>> >>>>>>>>>>>>>>> what it should be? Is this a bug that needs filing?
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> - Brill
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> For some reason the DropDownChoice component doesn't
>> >>>>>>>>>>>>>>>> have the
>> >>>>>>>>>>>>>>>> same
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>> generics as ListView and it will not accept a model
>> >>>>>>>>>>>>>>>>> that
>> >>>>>>>>>>>>>>>>> listview
>> >>>>>>>>>>>>>>>>> will,
>> >>>>>>>>>>>>>>>>> despite its saying that it will accept an IModel.
>> >>>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>> Is anyone else having that sort of trouble with
>> >>>>>>>>>>>>>>>>> DropDownChoice?
>> >>>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>> - Brill
>> >>>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> Can you give us more information on what exactly is not
>> >>>>>>>>>>>>>>>> working
>> >>>>>>>>>>>>>>>> for
>> >>>>>>>>>>>>>>>> you?
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> DropDownChoice indeed does accept a model, see for
>> >>>>>>>>>>>>>>>> instance the
>> >>>>>>>>>>>>>>>> example
>> >>>>>>>>>>>>>>>> in
>> >>>>>>>>>>>>>>>> the class description at
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> This works for me.
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> Kaspar
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> --
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> <!-- HTML: -->
>> >>>>>>>>>>>>>>>> <select wicket:id="site">
>> >>>>>>>>>>>>>>>>         <option>site 1</option>
>> >>>>>>>>>>>>>>>>         <option>site 2</option>
>> >>>>>>>>>>>>>>>> </select>
>> >>>>>>>>>>>>>>>> <ul>
>> >>>>>>>>>>>>>>>> <li wicket:id="site2"><wicket:container
>> >>>>>>>>>>>>>>>> wicket:id="sitename"/></li>
>> >>>>>>>>>>>>>>>> </ul>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> // Code
>> >>>>>>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>> >>>>>>>>>>>>>>>> "The Server Side", "Java Lobby", "Java.Net"
>> >>>>>>>>>>>>>>>> });
>> >>>>>>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>> >>>>>>>>>>>>>>>> form.add(new ListView("site2", SITES)
>> >>>>>>>>>>>>>>>> {
>> >>>>>>>>>>>>>>>> @Override
>> >>>>>>>>>>>>>>>> protected void populateItem(ListItem item)
>> >>>>>>>>>>>>>>>> {
>> >>>>>>>>>>>>>>>> item.add(new Label("sitename", item.getModel()));
>> >>>>>>>>>>>>>>>> }
>> >>>>>>>>>>>>>>>> });
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> ---------------------------------------------------------------------
>> >>>>>>>>>>>>>>>> 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
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>> ? extends
>> >>>>>>>>>>>>>
>> >>>>>>>>>>>>>
>> >>>>>>>>>>>>> ---------------------------------------------------------------------
>> >>>>>>>>>>>>> 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
>> >>>>>>>>>>
>> >>>>>>>>>>
>> >>>>>>>>>>
>> >>>>>>>>> es, the choice
>> >>>>>>>>>
>> >>>>>>>>> ---------------------------------------------------------------------
>> >>>>>>>>> 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
>> >>>>>
>> >>>>>
>> >>>>
>> >>>> ---------------------------------------------------------------------
>> >>>> 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
>> >
>>
>>
>> ---------------------------------------------------------------------
>> 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: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Igor Vaynberg <ig...@gmail.com>.
it has nothing to do with us wanting to "lock" something down. i am
simply stating that the read-only nature is a side-effect of a widened
type declaration. it is something we should all be aware of.

-igor

On Tue, Mar 3, 2009 at 1:02 PM, Brill Pappin <br...@pappin.ca> wrote:
> I usually think of them as read only as well, however why would you presume
> read only?
>
> they are pretty much exactly the same semantically and if I thought of some
> cool trick I could do modifying the list, I'd hate to be prevented from
> doing so simply because someone wanted to lock down an API that didn't
> really need locking down.
> I think the syntax doesn't really mean read only, and if the wicket
> developers really want it to be read only, wrapping the list would be the
> way to go.
>
> I'm for the plain old <List<T>> because its simple and explicit... <List<?
> extends T>> would be my next choice because it widens the scope.
>
> - Brill
>
> On 2-Mar-09, at 3:44 PM, James Carman wrote:
>
>> Aren't both the "choices" model in DDC and the actual model of
>> ListView supposed to be considered read-only (as far as the component
>> is concerned)?  The DDC and ListView don't need to be able to alter
>> those models anyway, right?  Perhaps my experience is just too
>> limited, but I don't think I've ever tried to do either one of your
>> usecases (I always consider them read-only).
>>
>>
>> On Mon, Mar 2, 2009 at 3:24 PM, Igor Vaynberg <ig...@gmail.com>
>> wrote:
>>>
>>> see WICKET-2126
>>>
>>> -igor
>>>
>>> On Mon, Mar 2, 2009 at 12:19 PM, James Carman
>>> <jc...@carmanconsulting.com> wrote:
>>>>
>>>> I vote -0.99 on this (non-binding of course).  I'd vote +1 to making
>>>> ListView accept List<? extends T> rather than making DDC less
>>>> flexible.
>>>>
>>>> On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>>>
>>>>> Ok, as suggested, here is the thread, and the first vote.
>>>>>
>>>>> +1
>>>>> for making the generic definition the same for all list type
>>>>> components.
>>>>>
>>>>> FYI -  you can also "vote" in the issue I just created at (which might
>>>>> actually be a better place to vote):
>>>>> https://issues.apache.org/jira/browse/WICKET-2137
>>>>>
>>>>> - Brill
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>>>>>
>>>>>> Perhaps start a vote thread, with the subject something like: "VOTE:
>>>>>> Remove
>>>>>> ? extends from constructor of DropDownChoice".
>>>>>>
>>>>>> I'd be +1 non-binding
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Jeremy Thomerson
>>>>>> http://www.wickettraining.com
>>>>>>
>>>>>>
>>>>>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>>>>
>>>>>>> I'm of the don't widen it camp anyway :)
>>>>>>>
>>>>>>> So how do I go about gathering support for having the DropDownChoice
>>>>>>> work
>>>>>>> with the models the way everything else does?
>>>>>>>
>>>>>>> - Brill
>>>>>>>
>>>>>>>
>>>>>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>>>>>>>
>>>>>>> yes, the choice was intentional. personally i do not care if it is
>>>>>>> <T>
>>>>>>>>
>>>>>>>> all the way, some users complained so we widened it on the choices
>>>>>>>> model, we cannot widen it on the main model.
>>>>>>>>
>>>>>>>> -igor
>>>>>>>>
>>>>>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin <br...@pappin.ca>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> I see... but this would i think because Bar "is a" Foo:
>>>>>>>>>
>>>>>>>>> class Bar exends Foo {}
>>>>>>>>> List<? extends Foo> list = ...
>>>>>>>>> list.add(new Bar());
>>>>>>>>>
>>>>>>>>> Anyway, what your saying is that the generics choice was
>>>>>>>>> intentional?
>>>>>>>>>
>>>>>>>>> - Brill
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>>>>>>>>>
>>>>>>>>> list<? extends string> stings=...
>>>>>>>>>>
>>>>>>>>>> strings.add("asd"); <== wont compile
>>>>>>>>>>
>>>>>>>>>> -igor
>>>>>>>>>>
>>>>>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos Fernandes
>>>>>>>>>> <ad...@gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> What do you mean with "read only" here?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Adriano
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Igor Vaynberg escreveu:
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> <? extends Foo> collections are read only, it would be too
>>>>>>>>>>>> inconvenient to make the model collection read only :)
>>>>>>>>>>>>
>>>>>>>>>>>> -igor
>>>>>>>>>>>>
>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>>>>>>>>>>>> <je...@wickettraining.com> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>> This is what I was commenting on last week on the list (or
>>>>>>>>>>>>> earlier
>>>>>>>>>>>>> this
>>>>>>>>>>>>> week).  One expects List<? extends Foo> while the other expects
>>>>>>>>>>>>> List<Foo>.
>>>>>>>>>>>>> I'm not fully convinced yet that the "? extends" is the better
>>>>>>>>>>>>> option.
>>>>>>>>>>>>> Either way, I think they should be the same.
>>>>>>>>>>>>>
>>>>>>>>>>>>> --
>>>>>>>>>>>>> Jeremy Thomerson
>>>>>>>>>>>>> http://www.wickettraining.com
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <br...@pappin.ca>
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Roughly what I'm doing is:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> class TypeA{}
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> class TypeAModel extends LoadableDetachableModel< List<TypeA>>
>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>  public List<TypeA> load(){
>>>>>>>>>>>>>>          ... do the load ...
>>>>>>>>>>>>>>          return ...
>>>>>>>>>>>>>>  }
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> TypeAModel model = new TypeAModel();
>>>>>>>>>>>>>> DropDownChoice< TypeA> ddc = new DropDownChoice<TypeA>("id",
>>>>>>>>>>>>>> model
>>>>>>>>>>>>>> );
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> which gets complained about... in this case the generic def is
>>>>>>>>>>>>>> DropDownChoice<List<? extends T>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I think the problem is that the generic def of the class
>>>>>>>>>>>>>> should
>>>>>>>>>>>>>> actually
>>>>>>>>>>>>>> be
>>>>>>>>>>>>>> DropDownChoice<List<T>> because you are already identifying
>>>>>>>>>>>>>> the
>>>>>>>>>>>>>> type
>>>>>>>>>>>>>> when
>>>>>>>>>>>>>> you create a new instance.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Now... my generics are a bit hazy at this level, because I can
>>>>>>>>>>>>>> understand
>>>>>>>>>>>>>> why it was done that way... does anyone with more generics
>>>>>>>>>>>>>> experience
>>>>>>>>>>>>>> know
>>>>>>>>>>>>>> what it should be? Is this a bug that needs filing?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> For some reason the DropDownChoice component doesn't have the
>>>>>>>>>>>>>>> same
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> generics as ListView and it will not accept a model that
>>>>>>>>>>>>>>>> listview
>>>>>>>>>>>>>>>> will,
>>>>>>>>>>>>>>>> despite its saying that it will accept an IModel.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Is anyone else having that sort of trouble with
>>>>>>>>>>>>>>>> DropDownChoice?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Can you give us more information on what exactly is not
>>>>>>>>>>>>>>> working
>>>>>>>>>>>>>>> for
>>>>>>>>>>>>>>> you?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> DropDownChoice indeed does accept a model, see for instance
>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>> example
>>>>>>>>>>>>>>> in
>>>>>>>>>>>>>>> the class description at
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> This works for me.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Kaspar
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> <!-- HTML: -->
>>>>>>>>>>>>>>> <select wicket:id="site">
>>>>>>>>>>>>>>>         <option>site 1</option>
>>>>>>>>>>>>>>>         <option>site 2</option>
>>>>>>>>>>>>>>> </select>
>>>>>>>>>>>>>>> <ul>
>>>>>>>>>>>>>>> <li wicket:id="site2"><wicket:container
>>>>>>>>>>>>>>> wicket:id="sitename"/></li>
>>>>>>>>>>>>>>> </ul>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> // Code
>>>>>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>>>>>>>>>>>>>>>  "The Server Side", "Java Lobby", "Java.Net"
>>>>>>>>>>>>>>> });
>>>>>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>>>>>>>>>>>>>>> form.add(new ListView("site2", SITES)
>>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>> @Override
>>>>>>>>>>>>>>> protected void populateItem(ListItem item)
>>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>>  item.add(new Label("sitename", item.getModel()));
>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>> });
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>>> 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
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>> ? extends
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>> 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
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> es, the choice
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> 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
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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


Re: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by James Carman <jc...@carmanconsulting.com>.
So, do we need to make it IModel<? extends List<? extends T>>?  That
would allow what Oliver was talking about.

On Wed, Mar 4, 2009 at 4:14 PM, Brill Pappin <br...@pappin.ca> wrote:
> See the sample test in  ticket: WICKET-2137
>
> https://issues.apache.org/jira/browse/WICKET-2137
>
> - brill
>
> On 4-Mar-09, at 11:08 AM, Johannes Schneider wrote:
>
>> On Wed, 2009-03-04 at 10:04 -0500, Brill Pappin wrote:
>>>
>>> I actually wasn't saying they were the same.
>>> What I said (meant) was that:
>>>
>>> a) don't lock down
>>
>> Locking down means *removing* the wildcard. Adding the wildcard *widens*
>> the collection.
>>
>> To be clear:
>> Wildcard --> it fits for everybody
>> No wildcard --> it fits only for some special cases (maybe yours)
>>
>>> b) I prefer the explicit form rather than the "Any of type" form. i.e.
>>> <List<T>> rather than <List<? extends T>>.
>>
>> They mean something completely different. I understand that you prefer
>> the shorter version. Many do. But it stays wrong...
>>
>> If the constructor accepts "List<Number>", everybody *has* to give you
>> exactly a List<Number>.
>>
>> List<Number> n = new List<Number>;
>>
>>
>> If the constructor accepts the widened type, you can add all those
>> lists...
>>
>> List<? extends Number> n = new List<Number>;
>> List<? extends Number> n = new List<Integer>;
>> List<? extends Number> n = new List<Double>;
>>
>>
>> If you don't believe me, take a look at GlazedLists. Compare version 1.7
>> and version 1.8. They changed exactly that thing (a non backward
>> compatible change!). They made exactly the same fault...
>>
>>
>> Regards,
>>
>> Johannes
>>
>>>
>>> - Brill
>>>
>>> On 4-Mar-09, at 6:26 AM, Johannes Schneider wrote:
>>>
>>>> On Tue, 2009-03-03 at 16:02 -0500, Brill Pappin wrote:
>>>>>
>>>>> I'd hate to be
>>>>> prevented from doing so simply because someone wanted to lock down an
>>>>> API that didn't really need locking down.
>>>>
>>>> You are wrong. *Widening* a collection is the exact opposite of
>>>> "locking
>>>> down".
>>>> If you want to have some fancy (read "hacky") write access to the
>>>> model
>>>> you are free to simply cast...
>>>> That is the right choice here. You know that you have a special
>>>> model in
>>>> there, so cast it.
>>>>
>>>> But the "common" case is, that you don't know for sure whether the
>>>> model
>>>> supports adding of choices or not.
>>>>
>>>>
>>>> If you don't believe me, take a look at JComboBox.
>>>> javax.swing.JComboBox#getModel returns a *read only* view of the
>>>> model.
>>>>
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Johannes
>>>>
>>>>
>>>>> I think the syntax doesn't really mean read only, and if the wicket
>>>>> developers really want it to be read only, wrapping the list would be
>>>>> the way to go.
>>>>>
>>>>> I'm for the plain old <List<T>> because its simple and explicit...
>>>>> <List<? extends T>> would be my next choice because it widens the
>>>>> scope.
>>>>>
>>>>> - Brill
>>>>>
>>>>> On 2-Mar-09, at 3:44 PM, James Carman wrote:
>>>>>
>>>>>> Aren't both the "choices" model in DDC and the actual model of
>>>>>> ListView supposed to be considered read-only (as far as the
>>>>>> component
>>>>>> is concerned)?  The DDC and ListView don't need to be able to alter
>>>>>> those models anyway, right?  Perhaps my experience is just too
>>>>>> limited, but I don't think I've ever tried to do either one of your
>>>>>> usecases (I always consider them read-only).
>>>>>>
>>>>>>
>>>>>> On Mon, Mar 2, 2009 at 3:24 PM, Igor Vaynberg
>>>>>> <ig...@gmail.com> wrote:
>>>>>>>
>>>>>>> see WICKET-2126
>>>>>>>
>>>>>>> -igor
>>>>>>>
>>>>>>> On Mon, Mar 2, 2009 at 12:19 PM, James Carman
>>>>>>> <jc...@carmanconsulting.com> wrote:
>>>>>>>>
>>>>>>>> I vote -0.99 on this (non-binding of course).  I'd vote +1 to
>>>>>>>> making
>>>>>>>> ListView accept List<? extends T> rather than making DDC less
>>>>>>>> flexible.
>>>>>>>>
>>>>>>>> On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin <br...@pappin.ca>
>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> Ok, as suggested, here is the thread, and the first vote.
>>>>>>>>>
>>>>>>>>> +1
>>>>>>>>> for making the generic definition the same for all list type
>>>>>>>>> components.
>>>>>>>>>
>>>>>>>>> FYI -  you can also "vote" in the issue I just created at (which
>>>>>>>>> might
>>>>>>>>> actually be a better place to vote):
>>>>>>>>> https://issues.apache.org/jira/browse/WICKET-2137
>>>>>>>>>
>>>>>>>>> - Brill
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>>>>>>>>>
>>>>>>>>>> Perhaps start a vote thread, with the subject something like:
>>>>>>>>>> "VOTE:
>>>>>>>>>> Remove
>>>>>>>>>> ? extends from constructor of DropDownChoice".
>>>>>>>>>>
>>>>>>>>>> I'd be +1 non-binding
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Jeremy Thomerson
>>>>>>>>>> http://www.wickettraining.com
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> I'm of the don't widen it camp anyway :)
>>>>>>>>>>>
>>>>>>>>>>> So how do I go about gathering support for having the
>>>>>>>>>>> DropDownChoice work
>>>>>>>>>>> with the models the way everything else does?
>>>>>>>>>>>
>>>>>>>>>>> - Brill
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>>>>>>>>>>>
>>>>>>>>>>> yes, the choice was intentional. personally i do not care if it
>>>>>>>>>>> is <T>
>>>>>>>>>>>>
>>>>>>>>>>>> all the way, some users complained so we widened it on the
>>>>>>>>>>>> choices
>>>>>>>>>>>> model, we cannot widen it on the main model.
>>>>>>>>>>>>
>>>>>>>>>>>> -igor
>>>>>>>>>>>>
>>>>>>>>>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin
>>>>>>>>>>>> <br...@pappin.ca> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> I see... but this would i think because Bar "is a" Foo:
>>>>>>>>>>>>>
>>>>>>>>>>>>> class Bar exends Foo {}
>>>>>>>>>>>>> List<? extends Foo> list = ...
>>>>>>>>>>>>> list.add(new Bar());
>>>>>>>>>>>>>
>>>>>>>>>>>>> Anyway, what your saying is that the generics choice was
>>>>>>>>>>>>> intentional?
>>>>>>>>>>>>>
>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> list<? extends string> stings=...
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> strings.add("asd"); <== wont compile
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> -igor
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos
>>>>>>>>>>>>>> Fernandes
>>>>>>>>>>>>>> <ad...@gmail.com> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> What do you mean with "read only" here?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Adriano
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Igor Vaynberg escreveu:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> <? extends Foo> collections are read only, it would be too
>>>>>>>>>>>>>>>> inconvenient to make the model collection read only :)
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> -igor
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>>>>>>>>>>>>>>>> <je...@wickettraining.com> wrote:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> This is what I was commenting on last week on the list
>>>>>>>>>>>>>>>>> (or earlier
>>>>>>>>>>>>>>>>> this
>>>>>>>>>>>>>>>>> week).  One expects List<? extends Foo> while the other
>>>>>>>>>>>>>>>>> expects
>>>>>>>>>>>>>>>>> List<Foo>.
>>>>>>>>>>>>>>>>> I'm not fully convinced yet that the "? extends" is the
>>>>>>>>>>>>>>>>> better
>>>>>>>>>>>>>>>>> option.
>>>>>>>>>>>>>>>>> Either way, I think they should be the same.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>>>> Jeremy Thomerson
>>>>>>>>>>>>>>>>> http://www.wickettraining.com
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin
>>>>>>>>>>>>>>>>> <brill@pappin.ca
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Roughly what I'm doing is:
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> class TypeA{}
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> class TypeAModel extends LoadableDetachableModel<
>>>>>>>>>>>>>>>>>> List<TypeA>> {
>>>>>>>>>>>>>>>>>> public List<TypeA> load(){
>>>>>>>>>>>>>>>>>>        ... do the load ...
>>>>>>>>>>>>>>>>>>        return ...
>>>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> TypeAModel model = new TypeAModel();
>>>>>>>>>>>>>>>>>> DropDownChoice< TypeA> ddc = new
>>>>>>>>>>>>>>>>>> DropDownChoice<TypeA>("id", model
>>>>>>>>>>>>>>>>>> );
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> which gets complained about... in this case the generic
>>>>>>>>>>>>>>>>>> def is
>>>>>>>>>>>>>>>>>> DropDownChoice<List<? extends T>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> I think the problem is that the generic def of the class
>>>>>>>>>>>>>>>>>> should
>>>>>>>>>>>>>>>>>> actually
>>>>>>>>>>>>>>>>>> be
>>>>>>>>>>>>>>>>>> DropDownChoice<List<T>> because you are already
>>>>>>>>>>>>>>>>>> identifying the
>>>>>>>>>>>>>>>>>> type
>>>>>>>>>>>>>>>>>> when
>>>>>>>>>>>>>>>>>> you create a new instance.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Now... my generics are a bit hazy at this level, because
>>>>>>>>>>>>>>>>>> I can
>>>>>>>>>>>>>>>>>> understand
>>>>>>>>>>>>>>>>>> why it was done that way... does anyone with more
>>>>>>>>>>>>>>>>>> generics
>>>>>>>>>>>>>>>>>> experience
>>>>>>>>>>>>>>>>>> know
>>>>>>>>>>>>>>>>>> what it should be? Is this a bug that needs filing?
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> For some reason the DropDownChoice component doesn't
>>>>>>>>>>>>>>>>>>> have the
>>>>>>>>>>>>>>>>>>> same
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> generics as ListView and it will not accept a model
>>>>>>>>>>>>>>>>>>>> that
>>>>>>>>>>>>>>>>>>>> listview
>>>>>>>>>>>>>>>>>>>> will,
>>>>>>>>>>>>>>>>>>>> despite its saying that it will accept an IModel.
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> Is anyone else having that sort of trouble with
>>>>>>>>>>>>>>>>>>>> DropDownChoice?
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Can you give us more information on what exactly is not
>>>>>>>>>>>>>>>>>>> working
>>>>>>>>>>>>>>>>>>> for
>>>>>>>>>>>>>>>>>>> you?
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> DropDownChoice indeed does accept a model, see for
>>>>>>>>>>>>>>>>>>> instance the
>>>>>>>>>>>>>>>>>>> example
>>>>>>>>>>>>>>>>>>> in
>>>>>>>>>>>>>>>>>>> the class description at
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> This works for me.
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Kaspar
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> <!-- HTML: -->
>>>>>>>>>>>>>>>>>>> <select wicket:id="site">
>>>>>>>>>>>>>>>>>>>       <option>site 1</option>
>>>>>>>>>>>>>>>>>>>       <option>site 2</option>
>>>>>>>>>>>>>>>>>>> </select>
>>>>>>>>>>>>>>>>>>> <ul>
>>>>>>>>>>>>>>>>>>> <li wicket:id="site2"><wicket:container
>>>>>>>>>>>>>>>>>>> wicket:id="sitename"/></li>
>>>>>>>>>>>>>>>>>>> </ul>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> // Code
>>>>>>>>>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>>>>>>>>>>>>>>>>>>> "The Server Side", "Java Lobby", "Java.Net"
>>>>>>>>>>>>>>>>>>> });
>>>>>>>>>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>>>>>>>>>>>>>>>>>>> form.add(new ListView("site2", SITES)
>>>>>>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>>>>>> @Override
>>>>>>>>>>>>>>>>>>> protected void populateItem(ListItem item)
>>>>>>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>>>>>> item.add(new Label("sitename", item.getModel()));
>>>>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>>>>> });
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>>>>>>> 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
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> ? extends
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>>>> 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
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>> es, the choice
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>> 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
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> 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
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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


Re: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Brill Pappin <br...@pappin.ca>.
See the sample test in  ticket: WICKET-2137

https://issues.apache.org/jira/browse/WICKET-2137

- brill

On 4-Mar-09, at 11:08 AM, Johannes Schneider wrote:

> On Wed, 2009-03-04 at 10:04 -0500, Brill Pappin wrote:
>> I actually wasn't saying they were the same.
>> What I said (meant) was that:
>>
>> a) don't lock down
>
> Locking down means *removing* the wildcard. Adding the wildcard  
> *widens*
> the collection.
>
> To be clear:
> Wildcard --> it fits for everybody
> No wildcard --> it fits only for some special cases (maybe yours)
>
>> b) I prefer the explicit form rather than the "Any of type" form.  
>> i.e.
>> <List<T>> rather than <List<? extends T>>.
>
> They mean something completely different. I understand that you prefer
> the shorter version. Many do. But it stays wrong...
>
> If the constructor accepts "List<Number>", everybody *has* to give you
> exactly a List<Number>.
>
> List<Number> n = new List<Number>;
>
>
> If the constructor accepts the widened type, you can add all those
> lists...
>
> List<? extends Number> n = new List<Number>;
> List<? extends Number> n = new List<Integer>;
> List<? extends Number> n = new List<Double>;
>
>
> If you don't believe me, take a look at GlazedLists. Compare version  
> 1.7
> and version 1.8. They changed exactly that thing (a non backward
> compatible change!). They made exactly the same fault...
>
>
> Regards,
>
> Johannes
>
>>
>> - Brill
>>
>> On 4-Mar-09, at 6:26 AM, Johannes Schneider wrote:
>>
>>> On Tue, 2009-03-03 at 16:02 -0500, Brill Pappin wrote:
>>>> I'd hate to be
>>>> prevented from doing so simply because someone wanted to lock  
>>>> down an
>>>> API that didn't really need locking down.
>>>
>>> You are wrong. *Widening* a collection is the exact opposite of
>>> "locking
>>> down".
>>> If you want to have some fancy (read "hacky") write access to the
>>> model
>>> you are free to simply cast...
>>> That is the right choice here. You know that you have a special
>>> model in
>>> there, so cast it.
>>>
>>> But the "common" case is, that you don't know for sure whether the
>>> model
>>> supports adding of choices or not.
>>>
>>>
>>> If you don't believe me, take a look at JComboBox.
>>> javax.swing.JComboBox#getModel returns a *read only* view of the
>>> model.
>>>
>>>
>>>
>>> Regards,
>>>
>>> Johannes
>>>
>>>
>>>> I think the syntax doesn't really mean read only, and if the wicket
>>>> developers really want it to be read only, wrapping the list  
>>>> would be
>>>> the way to go.
>>>>
>>>> I'm for the plain old <List<T>> because its simple and explicit...
>>>> <List<? extends T>> would be my next choice because it widens the
>>>> scope.
>>>>
>>>> - Brill
>>>>
>>>> On 2-Mar-09, at 3:44 PM, James Carman wrote:
>>>>
>>>>> Aren't both the "choices" model in DDC and the actual model of
>>>>> ListView supposed to be considered read-only (as far as the
>>>>> component
>>>>> is concerned)?  The DDC and ListView don't need to be able to  
>>>>> alter
>>>>> those models anyway, right?  Perhaps my experience is just too
>>>>> limited, but I don't think I've ever tried to do either one of  
>>>>> your
>>>>> usecases (I always consider them read-only).
>>>>>
>>>>>
>>>>> On Mon, Mar 2, 2009 at 3:24 PM, Igor Vaynberg
>>>>> <ig...@gmail.com> wrote:
>>>>>> see WICKET-2126
>>>>>>
>>>>>> -igor
>>>>>>
>>>>>> On Mon, Mar 2, 2009 at 12:19 PM, James Carman
>>>>>> <jc...@carmanconsulting.com> wrote:
>>>>>>> I vote -0.99 on this (non-binding of course).  I'd vote +1 to
>>>>>>> making
>>>>>>> ListView accept List<? extends T> rather than making DDC less
>>>>>>> flexible.
>>>>>>>
>>>>>>> On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin <br...@pappin.ca>
>>>>>>> wrote:
>>>>>>>> Ok, as suggested, here is the thread, and the first vote.
>>>>>>>>
>>>>>>>> +1
>>>>>>>> for making the generic definition the same for all list type
>>>>>>>> components.
>>>>>>>>
>>>>>>>> FYI -  you can also "vote" in the issue I just created at  
>>>>>>>> (which
>>>>>>>> might
>>>>>>>> actually be a better place to vote):
>>>>>>>> https://issues.apache.org/jira/browse/WICKET-2137
>>>>>>>>
>>>>>>>> - Brill
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>>>>>>>>
>>>>>>>>> Perhaps start a vote thread, with the subject something like:
>>>>>>>>> "VOTE:
>>>>>>>>> Remove
>>>>>>>>> ? extends from constructor of DropDownChoice".
>>>>>>>>>
>>>>>>>>> I'd be +1 non-binding
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Jeremy Thomerson
>>>>>>>>> http://www.wickettraining.com
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin  
>>>>>>>>> <br...@pappin.ca>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> I'm of the don't widen it camp anyway :)
>>>>>>>>>>
>>>>>>>>>> So how do I go about gathering support for having the
>>>>>>>>>> DropDownChoice work
>>>>>>>>>> with the models the way everything else does?
>>>>>>>>>>
>>>>>>>>>> - Brill
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>>>>>>>>>>
>>>>>>>>>> yes, the choice was intentional. personally i do not care  
>>>>>>>>>> if it
>>>>>>>>>> is <T>
>>>>>>>>>>>
>>>>>>>>>>> all the way, some users complained so we widened it on the
>>>>>>>>>>> choices
>>>>>>>>>>> model, we cannot widen it on the main model.
>>>>>>>>>>>
>>>>>>>>>>> -igor
>>>>>>>>>>>
>>>>>>>>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin
>>>>>>>>>>> <br...@pappin.ca> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> I see... but this would i think because Bar "is a" Foo:
>>>>>>>>>>>>
>>>>>>>>>>>> class Bar exends Foo {}
>>>>>>>>>>>> List<? extends Foo> list = ...
>>>>>>>>>>>> list.add(new Bar());
>>>>>>>>>>>>
>>>>>>>>>>>> Anyway, what your saying is that the generics choice was
>>>>>>>>>>>> intentional?
>>>>>>>>>>>>
>>>>>>>>>>>> - Brill
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> list<? extends string> stings=...
>>>>>>>>>>>>>
>>>>>>>>>>>>> strings.add("asd"); <== wont compile
>>>>>>>>>>>>>
>>>>>>>>>>>>> -igor
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos
>>>>>>>>>>>>> Fernandes
>>>>>>>>>>>>> <ad...@gmail.com> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> What do you mean with "read only" here?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Adriano
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Igor Vaynberg escreveu:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> <? extends Foo> collections are read only, it would be  
>>>>>>>>>>>>>>> too
>>>>>>>>>>>>>>> inconvenient to make the model collection read only :)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> -igor
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>>>>>>>>>>>>>>> <je...@wickettraining.com> wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> This is what I was commenting on last week on the list
>>>>>>>>>>>>>>>> (or earlier
>>>>>>>>>>>>>>>> this
>>>>>>>>>>>>>>>> week).  One expects List<? extends Foo> while the other
>>>>>>>>>>>>>>>> expects
>>>>>>>>>>>>>>>> List<Foo>.
>>>>>>>>>>>>>>>> I'm not fully convinced yet that the "? extends" is the
>>>>>>>>>>>>>>>> better
>>>>>>>>>>>>>>>> option.
>>>>>>>>>>>>>>>> Either way, I think they should be the same.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>>> Jeremy Thomerson
>>>>>>>>>>>>>>>> http://www.wickettraining.com
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <brill@pappin.ca
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Roughly what I'm doing is:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> class TypeA{}
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> class TypeAModel extends LoadableDetachableModel<
>>>>>>>>>>>>>>>>> List<TypeA>> {
>>>>>>>>>>>>>>>>> public List<TypeA> load(){
>>>>>>>>>>>>>>>>>         ... do the load ...
>>>>>>>>>>>>>>>>>         return ...
>>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> TypeAModel model = new TypeAModel();
>>>>>>>>>>>>>>>>> DropDownChoice< TypeA> ddc = new
>>>>>>>>>>>>>>>>> DropDownChoice<TypeA>("id", model
>>>>>>>>>>>>>>>>> );
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> which gets complained about... in this case the  
>>>>>>>>>>>>>>>>> generic
>>>>>>>>>>>>>>>>> def is
>>>>>>>>>>>>>>>>> DropDownChoice<List<? extends T>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> I think the problem is that the generic def of the  
>>>>>>>>>>>>>>>>> class
>>>>>>>>>>>>>>>>> should
>>>>>>>>>>>>>>>>> actually
>>>>>>>>>>>>>>>>> be
>>>>>>>>>>>>>>>>> DropDownChoice<List<T>> because you are already
>>>>>>>>>>>>>>>>> identifying the
>>>>>>>>>>>>>>>>> type
>>>>>>>>>>>>>>>>> when
>>>>>>>>>>>>>>>>> you create a new instance.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Now... my generics are a bit hazy at this level,  
>>>>>>>>>>>>>>>>> because
>>>>>>>>>>>>>>>>> I can
>>>>>>>>>>>>>>>>> understand
>>>>>>>>>>>>>>>>> why it was done that way... does anyone with more
>>>>>>>>>>>>>>>>> generics
>>>>>>>>>>>>>>>>> experience
>>>>>>>>>>>>>>>>> know
>>>>>>>>>>>>>>>>> what it should be? Is this a bug that needs filing?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> For some reason the DropDownChoice component doesn't
>>>>>>>>>>>>>>>>>> have the
>>>>>>>>>>>>>>>>>> same
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> generics as ListView and it will not accept a model
>>>>>>>>>>>>>>>>>>> that
>>>>>>>>>>>>>>>>>>> listview
>>>>>>>>>>>>>>>>>>> will,
>>>>>>>>>>>>>>>>>>> despite its saying that it will accept an IModel.
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Is anyone else having that sort of trouble with
>>>>>>>>>>>>>>>>>>> DropDownChoice?
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Can you give us more information on what exactly is  
>>>>>>>>>>>>>>>>>> not
>>>>>>>>>>>>>>>>>> working
>>>>>>>>>>>>>>>>>> for
>>>>>>>>>>>>>>>>>> you?
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> DropDownChoice indeed does accept a model, see for
>>>>>>>>>>>>>>>>>> instance the
>>>>>>>>>>>>>>>>>> example
>>>>>>>>>>>>>>>>>> in
>>>>>>>>>>>>>>>>>> the class description at
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> This works for me.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Kaspar
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> <!-- HTML: -->
>>>>>>>>>>>>>>>>>> <select wicket:id="site">
>>>>>>>>>>>>>>>>>>        <option>site 1</option>
>>>>>>>>>>>>>>>>>>        <option>site 2</option>
>>>>>>>>>>>>>>>>>> </select>
>>>>>>>>>>>>>>>>>> <ul>
>>>>>>>>>>>>>>>>>> <li wicket:id="site2"><wicket:container
>>>>>>>>>>>>>>>>>> wicket:id="sitename"/></li>
>>>>>>>>>>>>>>>>>> </ul>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> // Code
>>>>>>>>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>>>>>>>>>>>>>>>>>> "The Server Side", "Java Lobby", "Java.Net"
>>>>>>>>>>>>>>>>>> });
>>>>>>>>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>>>>>>>>>>>>>>>>>> form.add(new ListView("site2", SITES)
>>>>>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>>>>> @Override
>>>>>>>>>>>>>>>>>> protected void populateItem(ListItem item)
>>>>>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>>>>> item.add(new Label("sitename", item.getModel()));
>>>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>>>> });
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>>>>>> 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
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> ? extends
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>>> 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
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>> es, the choice
>>>>>>>>>>>
>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>> 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
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>>
>>
>>
>> ---------------------------------------------------------------------
>> 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: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Johannes Schneider <ma...@cedarsoft.com>.
On Wed, 2009-03-04 at 10:04 -0500, Brill Pappin wrote:
> I actually wasn't saying they were the same.
> What I said (meant) was that:
> 
> a) don't lock down

Locking down means *removing* the wildcard. Adding the wildcard *widens*
the collection.

To be clear: 
Wildcard --> it fits for everybody
No wildcard --> it fits only for some special cases (maybe yours)

> b) I prefer the explicit form rather than the "Any of type" form. i.e.  
> <List<T>> rather than <List<? extends T>>.

They mean something completely different. I understand that you prefer
the shorter version. Many do. But it stays wrong...

If the constructor accepts "List<Number>", everybody *has* to give you
exactly a List<Number>.

List<Number> n = new List<Number>;


If the constructor accepts the widened type, you can add all those
lists...

List<? extends Number> n = new List<Number>;
List<? extends Number> n = new List<Integer>;
List<? extends Number> n = new List<Double>;


If you don't believe me, take a look at GlazedLists. Compare version 1.7
and version 1.8. They changed exactly that thing (a non backward
compatible change!). They made exactly the same fault...


Regards,

Johannes

> 
> - Brill
> 
> On 4-Mar-09, at 6:26 AM, Johannes Schneider wrote:
> 
> > On Tue, 2009-03-03 at 16:02 -0500, Brill Pappin wrote:
> >> I'd hate to be
> >> prevented from doing so simply because someone wanted to lock down an
> >> API that didn't really need locking down.
> >
> > You are wrong. *Widening* a collection is the exact opposite of  
> > "locking
> > down".
> > If you want to have some fancy (read "hacky") write access to the  
> > model
> > you are free to simply cast...
> > That is the right choice here. You know that you have a special  
> > model in
> > there, so cast it.
> >
> > But the "common" case is, that you don't know for sure whether the  
> > model
> > supports adding of choices or not.
> >
> >
> > If you don't believe me, take a look at JComboBox.
> > javax.swing.JComboBox#getModel returns a *read only* view of the  
> > model.
> >
> >
> >
> > Regards,
> >
> > Johannes
> >
> >
> >> I think the syntax doesn't really mean read only, and if the wicket
> >> developers really want it to be read only, wrapping the list would be
> >> the way to go.
> >>
> >> I'm for the plain old <List<T>> because its simple and explicit...
> >> <List<? extends T>> would be my next choice because it widens the  
> >> scope.
> >>
> >> - Brill
> >>
> >> On 2-Mar-09, at 3:44 PM, James Carman wrote:
> >>
> >>> Aren't both the "choices" model in DDC and the actual model of
> >>> ListView supposed to be considered read-only (as far as the  
> >>> component
> >>> is concerned)?  The DDC and ListView don't need to be able to alter
> >>> those models anyway, right?  Perhaps my experience is just too
> >>> limited, but I don't think I've ever tried to do either one of your
> >>> usecases (I always consider them read-only).
> >>>
> >>>
> >>> On Mon, Mar 2, 2009 at 3:24 PM, Igor Vaynberg
> >>> <ig...@gmail.com> wrote:
> >>>> see WICKET-2126
> >>>>
> >>>> -igor
> >>>>
> >>>> On Mon, Mar 2, 2009 at 12:19 PM, James Carman
> >>>> <jc...@carmanconsulting.com> wrote:
> >>>>> I vote -0.99 on this (non-binding of course).  I'd vote +1 to  
> >>>>> making
> >>>>> ListView accept List<? extends T> rather than making DDC less
> >>>>> flexible.
> >>>>>
> >>>>> On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin <br...@pappin.ca>
> >>>>> wrote:
> >>>>>> Ok, as suggested, here is the thread, and the first vote.
> >>>>>>
> >>>>>> +1
> >>>>>> for making the generic definition the same for all list type
> >>>>>> components.
> >>>>>>
> >>>>>> FYI -  you can also "vote" in the issue I just created at (which
> >>>>>> might
> >>>>>> actually be a better place to vote):
> >>>>>> https://issues.apache.org/jira/browse/WICKET-2137
> >>>>>>
> >>>>>> - Brill
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
> >>>>>>
> >>>>>>> Perhaps start a vote thread, with the subject something like:
> >>>>>>> "VOTE:
> >>>>>>> Remove
> >>>>>>> ? extends from constructor of DropDownChoice".
> >>>>>>>
> >>>>>>> I'd be +1 non-binding
> >>>>>>>
> >>>>>>>
> >>>>>>> --
> >>>>>>> Jeremy Thomerson
> >>>>>>> http://www.wickettraining.com
> >>>>>>>
> >>>>>>>
> >>>>>>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca>
> >>>>>>> wrote:
> >>>>>>>
> >>>>>>>> I'm of the don't widen it camp anyway :)
> >>>>>>>>
> >>>>>>>> So how do I go about gathering support for having the
> >>>>>>>> DropDownChoice work
> >>>>>>>> with the models the way everything else does?
> >>>>>>>>
> >>>>>>>> - Brill
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
> >>>>>>>>
> >>>>>>>> yes, the choice was intentional. personally i do not care if it
> >>>>>>>> is <T>
> >>>>>>>>>
> >>>>>>>>> all the way, some users complained so we widened it on the
> >>>>>>>>> choices
> >>>>>>>>> model, we cannot widen it on the main model.
> >>>>>>>>>
> >>>>>>>>> -igor
> >>>>>>>>>
> >>>>>>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin
> >>>>>>>>> <br...@pappin.ca> wrote:
> >>>>>>>>>
> >>>>>>>>>> I see... but this would i think because Bar "is a" Foo:
> >>>>>>>>>>
> >>>>>>>>>> class Bar exends Foo {}
> >>>>>>>>>> List<? extends Foo> list = ...
> >>>>>>>>>> list.add(new Bar());
> >>>>>>>>>>
> >>>>>>>>>> Anyway, what your saying is that the generics choice was
> >>>>>>>>>> intentional?
> >>>>>>>>>>
> >>>>>>>>>> - Brill
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
> >>>>>>>>>>
> >>>>>>>>>> list<? extends string> stings=...
> >>>>>>>>>>>
> >>>>>>>>>>> strings.add("asd"); <== wont compile
> >>>>>>>>>>>
> >>>>>>>>>>> -igor
> >>>>>>>>>>>
> >>>>>>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos  
> >>>>>>>>>>> Fernandes
> >>>>>>>>>>> <ad...@gmail.com> wrote:
> >>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>> What do you mean with "read only" here?
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>> Adriano
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>> Igor Vaynberg escreveu:
> >>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> <? extends Foo> collections are read only, it would be too
> >>>>>>>>>>>>> inconvenient to make the model collection read only :)
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> -igor
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
> >>>>>>>>>>>>> <je...@wickettraining.com> wrote:
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>> This is what I was commenting on last week on the list
> >>>>>>>>>>>>>> (or earlier
> >>>>>>>>>>>>>> this
> >>>>>>>>>>>>>> week).  One expects List<? extends Foo> while the other
> >>>>>>>>>>>>>> expects
> >>>>>>>>>>>>>> List<Foo>.
> >>>>>>>>>>>>>> I'm not fully convinced yet that the "? extends" is the
> >>>>>>>>>>>>>> better
> >>>>>>>>>>>>>> option.
> >>>>>>>>>>>>>> Either way, I think they should be the same.
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> --
> >>>>>>>>>>>>>> Jeremy Thomerson
> >>>>>>>>>>>>>> http://www.wickettraining.com
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <brill@pappin.ca
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>> wrote:
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> Roughly what I'm doing is:
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> class TypeA{}
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> class TypeAModel extends LoadableDetachableModel<
> >>>>>>>>>>>>>>> List<TypeA>> {
> >>>>>>>>>>>>>>>  public List<TypeA> load(){
> >>>>>>>>>>>>>>>          ... do the load ...
> >>>>>>>>>>>>>>>          return ...
> >>>>>>>>>>>>>>>  }
> >>>>>>>>>>>>>>> }
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> TypeAModel model = new TypeAModel();
> >>>>>>>>>>>>>>> DropDownChoice< TypeA> ddc = new
> >>>>>>>>>>>>>>> DropDownChoice<TypeA>("id", model
> >>>>>>>>>>>>>>> );
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> which gets complained about... in this case the generic
> >>>>>>>>>>>>>>> def is
> >>>>>>>>>>>>>>> DropDownChoice<List<? extends T>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> I think the problem is that the generic def of the class
> >>>>>>>>>>>>>>> should
> >>>>>>>>>>>>>>> actually
> >>>>>>>>>>>>>>> be
> >>>>>>>>>>>>>>> DropDownChoice<List<T>> because you are already
> >>>>>>>>>>>>>>> identifying the
> >>>>>>>>>>>>>>> type
> >>>>>>>>>>>>>>> when
> >>>>>>>>>>>>>>> you create a new instance.
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> Now... my generics are a bit hazy at this level, because
> >>>>>>>>>>>>>>> I can
> >>>>>>>>>>>>>>> understand
> >>>>>>>>>>>>>>> why it was done that way... does anyone with more  
> >>>>>>>>>>>>>>> generics
> >>>>>>>>>>>>>>> experience
> >>>>>>>>>>>>>>> know
> >>>>>>>>>>>>>>> what it should be? Is this a bug that needs filing?
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> - Brill
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> For some reason the DropDownChoice component doesn't
> >>>>>>>>>>>>>>>> have the
> >>>>>>>>>>>>>>>> same
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>> generics as ListView and it will not accept a model  
> >>>>>>>>>>>>>>>>> that
> >>>>>>>>>>>>>>>>> listview
> >>>>>>>>>>>>>>>>> will,
> >>>>>>>>>>>>>>>>> despite its saying that it will accept an IModel.
> >>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>> Is anyone else having that sort of trouble with
> >>>>>>>>>>>>>>>>> DropDownChoice?
> >>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>> - Brill
> >>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> Can you give us more information on what exactly is not
> >>>>>>>>>>>>>>>> working
> >>>>>>>>>>>>>>>> for
> >>>>>>>>>>>>>>>> you?
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> DropDownChoice indeed does accept a model, see for
> >>>>>>>>>>>>>>>> instance the
> >>>>>>>>>>>>>>>> example
> >>>>>>>>>>>>>>>> in
> >>>>>>>>>>>>>>>> the class description at
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> This works for me.
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> Kaspar
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> --
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> <!-- HTML: -->
> >>>>>>>>>>>>>>>> <select wicket:id="site">
> >>>>>>>>>>>>>>>>         <option>site 1</option>
> >>>>>>>>>>>>>>>>         <option>site 2</option>
> >>>>>>>>>>>>>>>> </select>
> >>>>>>>>>>>>>>>> <ul>
> >>>>>>>>>>>>>>>> <li wicket:id="site2"><wicket:container
> >>>>>>>>>>>>>>>> wicket:id="sitename"/></li>
> >>>>>>>>>>>>>>>> </ul>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> // Code
> >>>>>>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
> >>>>>>>>>>>>>>>> "The Server Side", "Java Lobby", "Java.Net"
> >>>>>>>>>>>>>>>> });
> >>>>>>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
> >>>>>>>>>>>>>>>> form.add(new ListView("site2", SITES)
> >>>>>>>>>>>>>>>> {
> >>>>>>>>>>>>>>>> @Override
> >>>>>>>>>>>>>>>> protected void populateItem(ListItem item)
> >>>>>>>>>>>>>>>> {
> >>>>>>>>>>>>>>>> item.add(new Label("sitename", item.getModel()));
> >>>>>>>>>>>>>>>> }
> >>>>>>>>>>>>>>>> });
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>>>>>>>>> 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
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>> ? extends
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>>>>>> 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
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>> es, the choice
> >>>>>>>>>
> >>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>> 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
> >>>>>
> >>>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> 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
> >
> 
> 
> ---------------------------------------------------------------------
> 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: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Brill Pappin <br...@pappin.ca>.
I actually wasn't saying they were the same.
What I said (meant) was that:

a) don't lock down
b) I prefer the explicit form rather than the "Any of type" form. i.e.  
<List<T>> rather than <List<? extends T>>.

- Brill

On 4-Mar-09, at 6:26 AM, Johannes Schneider wrote:

> On Tue, 2009-03-03 at 16:02 -0500, Brill Pappin wrote:
>> I'd hate to be
>> prevented from doing so simply because someone wanted to lock down an
>> API that didn't really need locking down.
>
> You are wrong. *Widening* a collection is the exact opposite of  
> "locking
> down".
> If you want to have some fancy (read "hacky") write access to the  
> model
> you are free to simply cast...
> That is the right choice here. You know that you have a special  
> model in
> there, so cast it.
>
> But the "common" case is, that you don't know for sure whether the  
> model
> supports adding of choices or not.
>
>
> If you don't believe me, take a look at JComboBox.
> javax.swing.JComboBox#getModel returns a *read only* view of the  
> model.
>
>
>
> Regards,
>
> Johannes
>
>
>> I think the syntax doesn't really mean read only, and if the wicket
>> developers really want it to be read only, wrapping the list would be
>> the way to go.
>>
>> I'm for the plain old <List<T>> because its simple and explicit...
>> <List<? extends T>> would be my next choice because it widens the  
>> scope.
>>
>> - Brill
>>
>> On 2-Mar-09, at 3:44 PM, James Carman wrote:
>>
>>> Aren't both the "choices" model in DDC and the actual model of
>>> ListView supposed to be considered read-only (as far as the  
>>> component
>>> is concerned)?  The DDC and ListView don't need to be able to alter
>>> those models anyway, right?  Perhaps my experience is just too
>>> limited, but I don't think I've ever tried to do either one of your
>>> usecases (I always consider them read-only).
>>>
>>>
>>> On Mon, Mar 2, 2009 at 3:24 PM, Igor Vaynberg
>>> <ig...@gmail.com> wrote:
>>>> see WICKET-2126
>>>>
>>>> -igor
>>>>
>>>> On Mon, Mar 2, 2009 at 12:19 PM, James Carman
>>>> <jc...@carmanconsulting.com> wrote:
>>>>> I vote -0.99 on this (non-binding of course).  I'd vote +1 to  
>>>>> making
>>>>> ListView accept List<? extends T> rather than making DDC less
>>>>> flexible.
>>>>>
>>>>> On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin <br...@pappin.ca>
>>>>> wrote:
>>>>>> Ok, as suggested, here is the thread, and the first vote.
>>>>>>
>>>>>> +1
>>>>>> for making the generic definition the same for all list type
>>>>>> components.
>>>>>>
>>>>>> FYI -  you can also "vote" in the issue I just created at (which
>>>>>> might
>>>>>> actually be a better place to vote):
>>>>>> https://issues.apache.org/jira/browse/WICKET-2137
>>>>>>
>>>>>> - Brill
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>>>>>>
>>>>>>> Perhaps start a vote thread, with the subject something like:
>>>>>>> "VOTE:
>>>>>>> Remove
>>>>>>> ? extends from constructor of DropDownChoice".
>>>>>>>
>>>>>>> I'd be +1 non-binding
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Jeremy Thomerson
>>>>>>> http://www.wickettraining.com
>>>>>>>
>>>>>>>
>>>>>>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> I'm of the don't widen it camp anyway :)
>>>>>>>>
>>>>>>>> So how do I go about gathering support for having the
>>>>>>>> DropDownChoice work
>>>>>>>> with the models the way everything else does?
>>>>>>>>
>>>>>>>> - Brill
>>>>>>>>
>>>>>>>>
>>>>>>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>>>>>>>>
>>>>>>>> yes, the choice was intentional. personally i do not care if it
>>>>>>>> is <T>
>>>>>>>>>
>>>>>>>>> all the way, some users complained so we widened it on the
>>>>>>>>> choices
>>>>>>>>> model, we cannot widen it on the main model.
>>>>>>>>>
>>>>>>>>> -igor
>>>>>>>>>
>>>>>>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin
>>>>>>>>> <br...@pappin.ca> wrote:
>>>>>>>>>
>>>>>>>>>> I see... but this would i think because Bar "is a" Foo:
>>>>>>>>>>
>>>>>>>>>> class Bar exends Foo {}
>>>>>>>>>> List<? extends Foo> list = ...
>>>>>>>>>> list.add(new Bar());
>>>>>>>>>>
>>>>>>>>>> Anyway, what your saying is that the generics choice was
>>>>>>>>>> intentional?
>>>>>>>>>>
>>>>>>>>>> - Brill
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>>>>>>>>>>
>>>>>>>>>> list<? extends string> stings=...
>>>>>>>>>>>
>>>>>>>>>>> strings.add("asd"); <== wont compile
>>>>>>>>>>>
>>>>>>>>>>> -igor
>>>>>>>>>>>
>>>>>>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos  
>>>>>>>>>>> Fernandes
>>>>>>>>>>> <ad...@gmail.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> What do you mean with "read only" here?
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Adriano
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Igor Vaynberg escreveu:
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> <? extends Foo> collections are read only, it would be too
>>>>>>>>>>>>> inconvenient to make the model collection read only :)
>>>>>>>>>>>>>
>>>>>>>>>>>>> -igor
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>>>>>>>>>>>>> <je...@wickettraining.com> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>> This is what I was commenting on last week on the list
>>>>>>>>>>>>>> (or earlier
>>>>>>>>>>>>>> this
>>>>>>>>>>>>>> week).  One expects List<? extends Foo> while the other
>>>>>>>>>>>>>> expects
>>>>>>>>>>>>>> List<Foo>.
>>>>>>>>>>>>>> I'm not fully convinced yet that the "? extends" is the
>>>>>>>>>>>>>> better
>>>>>>>>>>>>>> option.
>>>>>>>>>>>>>> Either way, I think they should be the same.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> --
>>>>>>>>>>>>>> Jeremy Thomerson
>>>>>>>>>>>>>> http://www.wickettraining.com
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <brill@pappin.ca
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Roughly what I'm doing is:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> class TypeA{}
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> class TypeAModel extends LoadableDetachableModel<
>>>>>>>>>>>>>>> List<TypeA>> {
>>>>>>>>>>>>>>>  public List<TypeA> load(){
>>>>>>>>>>>>>>>          ... do the load ...
>>>>>>>>>>>>>>>          return ...
>>>>>>>>>>>>>>>  }
>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> TypeAModel model = new TypeAModel();
>>>>>>>>>>>>>>> DropDownChoice< TypeA> ddc = new
>>>>>>>>>>>>>>> DropDownChoice<TypeA>("id", model
>>>>>>>>>>>>>>> );
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> which gets complained about... in this case the generic
>>>>>>>>>>>>>>> def is
>>>>>>>>>>>>>>> DropDownChoice<List<? extends T>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I think the problem is that the generic def of the class
>>>>>>>>>>>>>>> should
>>>>>>>>>>>>>>> actually
>>>>>>>>>>>>>>> be
>>>>>>>>>>>>>>> DropDownChoice<List<T>> because you are already
>>>>>>>>>>>>>>> identifying the
>>>>>>>>>>>>>>> type
>>>>>>>>>>>>>>> when
>>>>>>>>>>>>>>> you create a new instance.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Now... my generics are a bit hazy at this level, because
>>>>>>>>>>>>>>> I can
>>>>>>>>>>>>>>> understand
>>>>>>>>>>>>>>> why it was done that way... does anyone with more  
>>>>>>>>>>>>>>> generics
>>>>>>>>>>>>>>> experience
>>>>>>>>>>>>>>> know
>>>>>>>>>>>>>>> what it should be? Is this a bug that needs filing?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> For some reason the DropDownChoice component doesn't
>>>>>>>>>>>>>>>> have the
>>>>>>>>>>>>>>>> same
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> generics as ListView and it will not accept a model  
>>>>>>>>>>>>>>>>> that
>>>>>>>>>>>>>>>>> listview
>>>>>>>>>>>>>>>>> will,
>>>>>>>>>>>>>>>>> despite its saying that it will accept an IModel.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Is anyone else having that sort of trouble with
>>>>>>>>>>>>>>>>> DropDownChoice?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Can you give us more information on what exactly is not
>>>>>>>>>>>>>>>> working
>>>>>>>>>>>>>>>> for
>>>>>>>>>>>>>>>> you?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> DropDownChoice indeed does accept a model, see for
>>>>>>>>>>>>>>>> instance the
>>>>>>>>>>>>>>>> example
>>>>>>>>>>>>>>>> in
>>>>>>>>>>>>>>>> the class description at
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> This works for me.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Kaspar
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> <!-- HTML: -->
>>>>>>>>>>>>>>>> <select wicket:id="site">
>>>>>>>>>>>>>>>>         <option>site 1</option>
>>>>>>>>>>>>>>>>         <option>site 2</option>
>>>>>>>>>>>>>>>> </select>
>>>>>>>>>>>>>>>> <ul>
>>>>>>>>>>>>>>>> <li wicket:id="site2"><wicket:container
>>>>>>>>>>>>>>>> wicket:id="sitename"/></li>
>>>>>>>>>>>>>>>> </ul>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> // Code
>>>>>>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>>>>>>>>>>>>>>>> "The Server Side", "Java Lobby", "Java.Net"
>>>>>>>>>>>>>>>> });
>>>>>>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>>>>>>>>>>>>>>>> form.add(new ListView("site2", SITES)
>>>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>>> @Override
>>>>>>>>>>>>>>>> protected void populateItem(ListItem item)
>>>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>>> item.add(new Label("sitename", item.getModel()));
>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>> });
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>>>> 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
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>> ? extends
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>> 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
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> es, the choice
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> 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
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>


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


Re: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Johannes Schneider <ma...@cedarsoft.com>.
On Tue, 2009-03-03 at 16:02 -0500, Brill Pappin wrote:
> I'd hate to be  
> prevented from doing so simply because someone wanted to lock down an  
> API that didn't really need locking down.

You are wrong. *Widening* a collection is the exact opposite of "locking
down".
If you want to have some fancy (read "hacky") write access to the model
you are free to simply cast...
That is the right choice here. You know that you have a special model in
there, so cast it.

But the "common" case is, that you don't know for sure whether the model
supports adding of choices or not.


If you don't believe me, take a look at JComboBox.
javax.swing.JComboBox#getModel returns a *read only* view of the model.



Regards,

Johannes


> I think the syntax doesn't really mean read only, and if the wicket  
> developers really want it to be read only, wrapping the list would be  
> the way to go.
> 
> I'm for the plain old <List<T>> because its simple and explicit...  
> <List<? extends T>> would be my next choice because it widens the scope.
> 
> - Brill
> 
> On 2-Mar-09, at 3:44 PM, James Carman wrote:
> 
> > Aren't both the "choices" model in DDC and the actual model of
> > ListView supposed to be considered read-only (as far as the component
> > is concerned)?  The DDC and ListView don't need to be able to alter
> > those models anyway, right?  Perhaps my experience is just too
> > limited, but I don't think I've ever tried to do either one of your
> > usecases (I always consider them read-only).
> >
> >
> > On Mon, Mar 2, 2009 at 3:24 PM, Igor Vaynberg  
> > <ig...@gmail.com> wrote:
> >> see WICKET-2126
> >>
> >> -igor
> >>
> >> On Mon, Mar 2, 2009 at 12:19 PM, James Carman
> >> <jc...@carmanconsulting.com> wrote:
> >>> I vote -0.99 on this (non-binding of course).  I'd vote +1 to making
> >>> ListView accept List<? extends T> rather than making DDC less
> >>> flexible.
> >>>
> >>> On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin <br...@pappin.ca>  
> >>> wrote:
> >>>> Ok, as suggested, here is the thread, and the first vote.
> >>>>
> >>>> +1
> >>>> for making the generic definition the same for all list type  
> >>>> components.
> >>>>
> >>>> FYI -  you can also "vote" in the issue I just created at (which  
> >>>> might
> >>>> actually be a better place to vote):
> >>>> https://issues.apache.org/jira/browse/WICKET-2137
> >>>>
> >>>> - Brill
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
> >>>>
> >>>>> Perhaps start a vote thread, with the subject something like:  
> >>>>> "VOTE:
> >>>>> Remove
> >>>>> ? extends from constructor of DropDownChoice".
> >>>>>
> >>>>> I'd be +1 non-binding
> >>>>>
> >>>>>
> >>>>> --
> >>>>> Jeremy Thomerson
> >>>>> http://www.wickettraining.com
> >>>>>
> >>>>>
> >>>>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca>  
> >>>>> wrote:
> >>>>>
> >>>>>> I'm of the don't widen it camp anyway :)
> >>>>>>
> >>>>>> So how do I go about gathering support for having the  
> >>>>>> DropDownChoice work
> >>>>>> with the models the way everything else does?
> >>>>>>
> >>>>>> - Brill
> >>>>>>
> >>>>>>
> >>>>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
> >>>>>>
> >>>>>> yes, the choice was intentional. personally i do not care if it  
> >>>>>> is <T>
> >>>>>>>
> >>>>>>> all the way, some users complained so we widened it on the  
> >>>>>>> choices
> >>>>>>> model, we cannot widen it on the main model.
> >>>>>>>
> >>>>>>> -igor
> >>>>>>>
> >>>>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin  
> >>>>>>> <br...@pappin.ca> wrote:
> >>>>>>>
> >>>>>>>> I see... but this would i think because Bar "is a" Foo:
> >>>>>>>>
> >>>>>>>> class Bar exends Foo {}
> >>>>>>>> List<? extends Foo> list = ...
> >>>>>>>> list.add(new Bar());
> >>>>>>>>
> >>>>>>>> Anyway, what your saying is that the generics choice was  
> >>>>>>>> intentional?
> >>>>>>>>
> >>>>>>>> - Brill
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
> >>>>>>>>
> >>>>>>>> list<? extends string> stings=...
> >>>>>>>>>
> >>>>>>>>> strings.add("asd"); <== wont compile
> >>>>>>>>>
> >>>>>>>>> -igor
> >>>>>>>>>
> >>>>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos Fernandes
> >>>>>>>>> <ad...@gmail.com> wrote:
> >>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> What do you mean with "read only" here?
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> Adriano
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> Igor Vaynberg escreveu:
> >>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> <? extends Foo> collections are read only, it would be too
> >>>>>>>>>>> inconvenient to make the model collection read only :)
> >>>>>>>>>>>
> >>>>>>>>>>> -igor
> >>>>>>>>>>>
> >>>>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
> >>>>>>>>>>> <je...@wickettraining.com> wrote:
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>> This is what I was commenting on last week on the list  
> >>>>>>>>>>>> (or earlier
> >>>>>>>>>>>> this
> >>>>>>>>>>>> week).  One expects List<? extends Foo> while the other  
> >>>>>>>>>>>> expects
> >>>>>>>>>>>> List<Foo>.
> >>>>>>>>>>>> I'm not fully convinced yet that the "? extends" is the  
> >>>>>>>>>>>> better
> >>>>>>>>>>>> option.
> >>>>>>>>>>>> Either way, I think they should be the same.
> >>>>>>>>>>>>
> >>>>>>>>>>>> --
> >>>>>>>>>>>> Jeremy Thomerson
> >>>>>>>>>>>> http://www.wickettraining.com
> >>>>>>>>>>>>
> >>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <brill@pappin.ca 
> >>>>>>>>>>>> >
> >>>>>>>>>>>> wrote:
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>> Roughly what I'm doing is:
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> class TypeA{}
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> class TypeAModel extends LoadableDetachableModel<  
> >>>>>>>>>>>>> List<TypeA>> {
> >>>>>>>>>>>>>   public List<TypeA> load(){
> >>>>>>>>>>>>>           ... do the load ...
> >>>>>>>>>>>>>           return ...
> >>>>>>>>>>>>>   }
> >>>>>>>>>>>>> }
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> TypeAModel model = new TypeAModel();
> >>>>>>>>>>>>> DropDownChoice< TypeA> ddc = new  
> >>>>>>>>>>>>> DropDownChoice<TypeA>("id", model
> >>>>>>>>>>>>> );
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> which gets complained about... in this case the generic  
> >>>>>>>>>>>>> def is
> >>>>>>>>>>>>> DropDownChoice<List<? extends T>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> I think the problem is that the generic def of the class  
> >>>>>>>>>>>>> should
> >>>>>>>>>>>>> actually
> >>>>>>>>>>>>> be
> >>>>>>>>>>>>> DropDownChoice<List<T>> because you are already  
> >>>>>>>>>>>>> identifying the
> >>>>>>>>>>>>> type
> >>>>>>>>>>>>> when
> >>>>>>>>>>>>> you create a new instance.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Now... my generics are a bit hazy at this level, because  
> >>>>>>>>>>>>> I can
> >>>>>>>>>>>>> understand
> >>>>>>>>>>>>> why it was done that way... does anyone with more generics
> >>>>>>>>>>>>> experience
> >>>>>>>>>>>>> know
> >>>>>>>>>>>>> what it should be? Is this a bug that needs filing?
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> - Brill
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>> For some reason the DropDownChoice component doesn't  
> >>>>>>>>>>>>>> have the
> >>>>>>>>>>>>>> same
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> generics as ListView and it will not accept a model that
> >>>>>>>>>>>>>>> listview
> >>>>>>>>>>>>>>> will,
> >>>>>>>>>>>>>>> despite its saying that it will accept an IModel.
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> Is anyone else having that sort of trouble with  
> >>>>>>>>>>>>>>> DropDownChoice?
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> - Brill
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Can you give us more information on what exactly is not  
> >>>>>>>>>>>>>> working
> >>>>>>>>>>>>>> for
> >>>>>>>>>>>>>> you?
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> DropDownChoice indeed does accept a model, see for  
> >>>>>>>>>>>>>> instance the
> >>>>>>>>>>>>>> example
> >>>>>>>>>>>>>> in
> >>>>>>>>>>>>>> the class description at
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> This works for me.
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Kaspar
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> --
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> <!-- HTML: -->
> >>>>>>>>>>>>>> <select wicket:id="site">
> >>>>>>>>>>>>>>          <option>site 1</option>
> >>>>>>>>>>>>>>          <option>site 2</option>
> >>>>>>>>>>>>>> </select>
> >>>>>>>>>>>>>> <ul>
> >>>>>>>>>>>>>> <li wicket:id="site2"><wicket:container
> >>>>>>>>>>>>>> wicket:id="sitename"/></li>
> >>>>>>>>>>>>>> </ul>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> // Code
> >>>>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
> >>>>>>>>>>>>>>  "The Server Side", "Java Lobby", "Java.Net"
> >>>>>>>>>>>>>> });
> >>>>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
> >>>>>>>>>>>>>> form.add(new ListView("site2", SITES)
> >>>>>>>>>>>>>> {
> >>>>>>>>>>>>>> @Override
> >>>>>>>>>>>>>> protected void populateItem(ListItem item)
> >>>>>>>>>>>>>> {
> >>>>>>>>>>>>>>  item.add(new Label("sitename", item.getModel()));
> >>>>>>>>>>>>>> }
> >>>>>>>>>>>>>> });
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>>>>>>> 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
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>> ? extends
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>>>> 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
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>> es, the choice
> >>>>>>>
> >>>>>>> ---------------------------------------------------------------------
> >>>>>>> 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
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> 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


Re: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Brill Pappin <br...@pappin.ca>.
I usually think of them as read only as well, however why would you  
presume read only?

they are pretty much exactly the same semantically and if I thought of  
some cool trick I could do modifying the list, I'd hate to be  
prevented from doing so simply because someone wanted to lock down an  
API that didn't really need locking down.
I think the syntax doesn't really mean read only, and if the wicket  
developers really want it to be read only, wrapping the list would be  
the way to go.

I'm for the plain old <List<T>> because its simple and explicit...  
<List<? extends T>> would be my next choice because it widens the scope.

- Brill

On 2-Mar-09, at 3:44 PM, James Carman wrote:

> Aren't both the "choices" model in DDC and the actual model of
> ListView supposed to be considered read-only (as far as the component
> is concerned)?  The DDC and ListView don't need to be able to alter
> those models anyway, right?  Perhaps my experience is just too
> limited, but I don't think I've ever tried to do either one of your
> usecases (I always consider them read-only).
>
>
> On Mon, Mar 2, 2009 at 3:24 PM, Igor Vaynberg  
> <ig...@gmail.com> wrote:
>> see WICKET-2126
>>
>> -igor
>>
>> On Mon, Mar 2, 2009 at 12:19 PM, James Carman
>> <jc...@carmanconsulting.com> wrote:
>>> I vote -0.99 on this (non-binding of course).  I'd vote +1 to making
>>> ListView accept List<? extends T> rather than making DDC less
>>> flexible.
>>>
>>> On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin <br...@pappin.ca>  
>>> wrote:
>>>> Ok, as suggested, here is the thread, and the first vote.
>>>>
>>>> +1
>>>> for making the generic definition the same for all list type  
>>>> components.
>>>>
>>>> FYI -  you can also "vote" in the issue I just created at (which  
>>>> might
>>>> actually be a better place to vote):
>>>> https://issues.apache.org/jira/browse/WICKET-2137
>>>>
>>>> - Brill
>>>>
>>>>
>>>>
>>>>
>>>> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>>>>
>>>>> Perhaps start a vote thread, with the subject something like:  
>>>>> "VOTE:
>>>>> Remove
>>>>> ? extends from constructor of DropDownChoice".
>>>>>
>>>>> I'd be +1 non-binding
>>>>>
>>>>>
>>>>> --
>>>>> Jeremy Thomerson
>>>>> http://www.wickettraining.com
>>>>>
>>>>>
>>>>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca>  
>>>>> wrote:
>>>>>
>>>>>> I'm of the don't widen it camp anyway :)
>>>>>>
>>>>>> So how do I go about gathering support for having the  
>>>>>> DropDownChoice work
>>>>>> with the models the way everything else does?
>>>>>>
>>>>>> - Brill
>>>>>>
>>>>>>
>>>>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>>>>>>
>>>>>> yes, the choice was intentional. personally i do not care if it  
>>>>>> is <T>
>>>>>>>
>>>>>>> all the way, some users complained so we widened it on the  
>>>>>>> choices
>>>>>>> model, we cannot widen it on the main model.
>>>>>>>
>>>>>>> -igor
>>>>>>>
>>>>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin  
>>>>>>> <br...@pappin.ca> wrote:
>>>>>>>
>>>>>>>> I see... but this would i think because Bar "is a" Foo:
>>>>>>>>
>>>>>>>> class Bar exends Foo {}
>>>>>>>> List<? extends Foo> list = ...
>>>>>>>> list.add(new Bar());
>>>>>>>>
>>>>>>>> Anyway, what your saying is that the generics choice was  
>>>>>>>> intentional?
>>>>>>>>
>>>>>>>> - Brill
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>>>>>>>>
>>>>>>>> list<? extends string> stings=...
>>>>>>>>>
>>>>>>>>> strings.add("asd"); <== wont compile
>>>>>>>>>
>>>>>>>>> -igor
>>>>>>>>>
>>>>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos Fernandes
>>>>>>>>> <ad...@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> What do you mean with "read only" here?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Adriano
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Igor Vaynberg escreveu:
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> <? extends Foo> collections are read only, it would be too
>>>>>>>>>>> inconvenient to make the model collection read only :)
>>>>>>>>>>>
>>>>>>>>>>> -igor
>>>>>>>>>>>
>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>>>>>>>>>>> <je...@wickettraining.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> This is what I was commenting on last week on the list  
>>>>>>>>>>>> (or earlier
>>>>>>>>>>>> this
>>>>>>>>>>>> week).  One expects List<? extends Foo> while the other  
>>>>>>>>>>>> expects
>>>>>>>>>>>> List<Foo>.
>>>>>>>>>>>> I'm not fully convinced yet that the "? extends" is the  
>>>>>>>>>>>> better
>>>>>>>>>>>> option.
>>>>>>>>>>>> Either way, I think they should be the same.
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> Jeremy Thomerson
>>>>>>>>>>>> http://www.wickettraining.com
>>>>>>>>>>>>
>>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <brill@pappin.ca 
>>>>>>>>>>>> >
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>> Roughly what I'm doing is:
>>>>>>>>>>>>>
>>>>>>>>>>>>> class TypeA{}
>>>>>>>>>>>>>
>>>>>>>>>>>>> class TypeAModel extends LoadableDetachableModel<  
>>>>>>>>>>>>> List<TypeA>> {
>>>>>>>>>>>>>   public List<TypeA> load(){
>>>>>>>>>>>>>           ... do the load ...
>>>>>>>>>>>>>           return ...
>>>>>>>>>>>>>   }
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>> TypeAModel model = new TypeAModel();
>>>>>>>>>>>>> DropDownChoice< TypeA> ddc = new  
>>>>>>>>>>>>> DropDownChoice<TypeA>("id", model
>>>>>>>>>>>>> );
>>>>>>>>>>>>>
>>>>>>>>>>>>> which gets complained about... in this case the generic  
>>>>>>>>>>>>> def is
>>>>>>>>>>>>> DropDownChoice<List<? extends T>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> I think the problem is that the generic def of the class  
>>>>>>>>>>>>> should
>>>>>>>>>>>>> actually
>>>>>>>>>>>>> be
>>>>>>>>>>>>> DropDownChoice<List<T>> because you are already  
>>>>>>>>>>>>> identifying the
>>>>>>>>>>>>> type
>>>>>>>>>>>>> when
>>>>>>>>>>>>> you create a new instance.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Now... my generics are a bit hazy at this level, because  
>>>>>>>>>>>>> I can
>>>>>>>>>>>>> understand
>>>>>>>>>>>>> why it was done that way... does anyone with more generics
>>>>>>>>>>>>> experience
>>>>>>>>>>>>> know
>>>>>>>>>>>>> what it should be? Is this a bug that needs filing?
>>>>>>>>>>>>>
>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>> For some reason the DropDownChoice component doesn't  
>>>>>>>>>>>>>> have the
>>>>>>>>>>>>>> same
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> generics as ListView and it will not accept a model that
>>>>>>>>>>>>>>> listview
>>>>>>>>>>>>>>> will,
>>>>>>>>>>>>>>> despite its saying that it will accept an IModel.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Is anyone else having that sort of trouble with  
>>>>>>>>>>>>>>> DropDownChoice?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Can you give us more information on what exactly is not  
>>>>>>>>>>>>>> working
>>>>>>>>>>>>>> for
>>>>>>>>>>>>>> you?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> DropDownChoice indeed does accept a model, see for  
>>>>>>>>>>>>>> instance the
>>>>>>>>>>>>>> example
>>>>>>>>>>>>>> in
>>>>>>>>>>>>>> the class description at
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> This works for me.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Kaspar
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <!-- HTML: -->
>>>>>>>>>>>>>> <select wicket:id="site">
>>>>>>>>>>>>>>          <option>site 1</option>
>>>>>>>>>>>>>>          <option>site 2</option>
>>>>>>>>>>>>>> </select>
>>>>>>>>>>>>>> <ul>
>>>>>>>>>>>>>> <li wicket:id="site2"><wicket:container
>>>>>>>>>>>>>> wicket:id="sitename"/></li>
>>>>>>>>>>>>>> </ul>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> // Code
>>>>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>>>>>>>>>>>>>>  "The Server Side", "Java Lobby", "Java.Net"
>>>>>>>>>>>>>> });
>>>>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>>>>>>>>>>>>>> form.add(new ListView("site2", SITES)
>>>>>>>>>>>>>> {
>>>>>>>>>>>>>> @Override
>>>>>>>>>>>>>> protected void populateItem(ListItem item)
>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>  item.add(new Label("sitename", item.getModel()));
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>> });
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>> 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
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>> ? extends
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>> 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
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> es, the choice
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> 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
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> 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: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by James Carman <jc...@carmanconsulting.com>.
Aren't both the "choices" model in DDC and the actual model of
ListView supposed to be considered read-only (as far as the component
is concerned)?  The DDC and ListView don't need to be able to alter
those models anyway, right?  Perhaps my experience is just too
limited, but I don't think I've ever tried to do either one of your
usecases (I always consider them read-only).


On Mon, Mar 2, 2009 at 3:24 PM, Igor Vaynberg <ig...@gmail.com> wrote:
> see WICKET-2126
>
> -igor
>
> On Mon, Mar 2, 2009 at 12:19 PM, James Carman
> <jc...@carmanconsulting.com> wrote:
>> I vote -0.99 on this (non-binding of course).  I'd vote +1 to making
>> ListView accept List<? extends T> rather than making DDC less
>> flexible.
>>
>> On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin <br...@pappin.ca> wrote:
>>> Ok, as suggested, here is the thread, and the first vote.
>>>
>>> +1
>>> for making the generic definition the same for all list type components.
>>>
>>> FYI -  you can also "vote" in the issue I just created at (which might
>>> actually be a better place to vote):
>>> https://issues.apache.org/jira/browse/WICKET-2137
>>>
>>> - Brill
>>>
>>>
>>>
>>>
>>> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>>>
>>>> Perhaps start a vote thread, with the subject something like: "VOTE:
>>>> Remove
>>>> ? extends from constructor of DropDownChoice".
>>>>
>>>> I'd be +1 non-binding
>>>>
>>>>
>>>> --
>>>> Jeremy Thomerson
>>>> http://www.wickettraining.com
>>>>
>>>>
>>>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>>
>>>>> I'm of the don't widen it camp anyway :)
>>>>>
>>>>> So how do I go about gathering support for having the DropDownChoice work
>>>>> with the models the way everything else does?
>>>>>
>>>>> - Brill
>>>>>
>>>>>
>>>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>>>>>
>>>>> yes, the choice was intentional. personally i do not care if it is <T>
>>>>>>
>>>>>> all the way, some users complained so we widened it on the choices
>>>>>> model, we cannot widen it on the main model.
>>>>>>
>>>>>> -igor
>>>>>>
>>>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>>>>
>>>>>>> I see... but this would i think because Bar "is a" Foo:
>>>>>>>
>>>>>>> class Bar exends Foo {}
>>>>>>> List<? extends Foo> list = ...
>>>>>>> list.add(new Bar());
>>>>>>>
>>>>>>> Anyway, what your saying is that the generics choice was intentional?
>>>>>>>
>>>>>>> - Brill
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>>>>>>>
>>>>>>> list<? extends string> stings=...
>>>>>>>>
>>>>>>>> strings.add("asd"); <== wont compile
>>>>>>>>
>>>>>>>> -igor
>>>>>>>>
>>>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos Fernandes
>>>>>>>> <ad...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> What do you mean with "read only" here?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Adriano
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Igor Vaynberg escreveu:
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> <? extends Foo> collections are read only, it would be too
>>>>>>>>>> inconvenient to make the model collection read only :)
>>>>>>>>>>
>>>>>>>>>> -igor
>>>>>>>>>>
>>>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>>>>>>>>>> <je...@wickettraining.com> wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> This is what I was commenting on last week on the list (or earlier
>>>>>>>>>>> this
>>>>>>>>>>> week).  One expects List<? extends Foo> while the other expects
>>>>>>>>>>> List<Foo>.
>>>>>>>>>>> I'm not fully convinced yet that the "? extends" is the better
>>>>>>>>>>> option.
>>>>>>>>>>> Either way, I think they should be the same.
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> Jeremy Thomerson
>>>>>>>>>>> http://www.wickettraining.com
>>>>>>>>>>>
>>>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <br...@pappin.ca>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> Roughly what I'm doing is:
>>>>>>>>>>>>
>>>>>>>>>>>> class TypeA{}
>>>>>>>>>>>>
>>>>>>>>>>>> class TypeAModel extends LoadableDetachableModel< List<TypeA>> {
>>>>>>>>>>>>   public List<TypeA> load(){
>>>>>>>>>>>>           ... do the load ...
>>>>>>>>>>>>           return ...
>>>>>>>>>>>>   }
>>>>>>>>>>>> }
>>>>>>>>>>>>
>>>>>>>>>>>> TypeAModel model = new TypeAModel();
>>>>>>>>>>>> DropDownChoice< TypeA> ddc = new DropDownChoice<TypeA>("id", model
>>>>>>>>>>>> );
>>>>>>>>>>>>
>>>>>>>>>>>> which gets complained about... in this case the generic def is
>>>>>>>>>>>> DropDownChoice<List<? extends T>>
>>>>>>>>>>>>
>>>>>>>>>>>> I think the problem is that the generic def of the class should
>>>>>>>>>>>> actually
>>>>>>>>>>>> be
>>>>>>>>>>>> DropDownChoice<List<T>> because you are already identifying the
>>>>>>>>>>>> type
>>>>>>>>>>>> when
>>>>>>>>>>>> you create a new instance.
>>>>>>>>>>>>
>>>>>>>>>>>> Now... my generics are a bit hazy at this level, because I can
>>>>>>>>>>>> understand
>>>>>>>>>>>> why it was done that way... does anyone with more generics
>>>>>>>>>>>> experience
>>>>>>>>>>>> know
>>>>>>>>>>>> what it should be? Is this a bug that needs filing?
>>>>>>>>>>>>
>>>>>>>>>>>> - Brill
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>> For some reason the DropDownChoice component doesn't have the
>>>>>>>>>>>>> same
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>> generics as ListView and it will not accept a model that
>>>>>>>>>>>>>> listview
>>>>>>>>>>>>>> will,
>>>>>>>>>>>>>> despite its saying that it will accept an IModel.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Is anyone else having that sort of trouble with DropDownChoice?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>> Can you give us more information on what exactly is not working
>>>>>>>>>>>>> for
>>>>>>>>>>>>> you?
>>>>>>>>>>>>>
>>>>>>>>>>>>> DropDownChoice indeed does accept a model, see for instance the
>>>>>>>>>>>>> example
>>>>>>>>>>>>> in
>>>>>>>>>>>>> the class description at
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>>>>>>>>>>>>>
>>>>>>>>>>>>> This works for me.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Kaspar
>>>>>>>>>>>>>
>>>>>>>>>>>>> --
>>>>>>>>>>>>>
>>>>>>>>>>>>> <!-- HTML: -->
>>>>>>>>>>>>> <select wicket:id="site">
>>>>>>>>>>>>>          <option>site 1</option>
>>>>>>>>>>>>>          <option>site 2</option>
>>>>>>>>>>>>> </select>
>>>>>>>>>>>>> <ul>
>>>>>>>>>>>>> <li wicket:id="site2"><wicket:container
>>>>>>>>>>>>> wicket:id="sitename"/></li>
>>>>>>>>>>>>> </ul>
>>>>>>>>>>>>>
>>>>>>>>>>>>> // Code
>>>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>>>>>>>>>>>>>  "The Server Side", "Java Lobby", "Java.Net"
>>>>>>>>>>>>> });
>>>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>>>>>>>>>>>>> form.add(new ListView("site2", SITES)
>>>>>>>>>>>>> {
>>>>>>>>>>>>> @Override
>>>>>>>>>>>>> protected void populateItem(ListItem item)
>>>>>>>>>>>>> {
>>>>>>>>>>>>>  item.add(new Label("sitename", item.getModel()));
>>>>>>>>>>>>> }
>>>>>>>>>>>>> });
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>> 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
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>> ? extends
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>> 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
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> es, the choice
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>
>>
>
> ---------------------------------------------------------------------
> 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: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Igor Vaynberg <ig...@gmail.com>.
see WICKET-2126

-igor

On Mon, Mar 2, 2009 at 12:19 PM, James Carman
<jc...@carmanconsulting.com> wrote:
> I vote -0.99 on this (non-binding of course).  I'd vote +1 to making
> ListView accept List<? extends T> rather than making DDC less
> flexible.
>
> On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin <br...@pappin.ca> wrote:
>> Ok, as suggested, here is the thread, and the first vote.
>>
>> +1
>> for making the generic definition the same for all list type components.
>>
>> FYI -  you can also "vote" in the issue I just created at (which might
>> actually be a better place to vote):
>> https://issues.apache.org/jira/browse/WICKET-2137
>>
>> - Brill
>>
>>
>>
>>
>> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>>
>>> Perhaps start a vote thread, with the subject something like: "VOTE:
>>> Remove
>>> ? extends from constructor of DropDownChoice".
>>>
>>> I'd be +1 non-binding
>>>
>>>
>>> --
>>> Jeremy Thomerson
>>> http://www.wickettraining.com
>>>
>>>
>>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>
>>>> I'm of the don't widen it camp anyway :)
>>>>
>>>> So how do I go about gathering support for having the DropDownChoice work
>>>> with the models the way everything else does?
>>>>
>>>> - Brill
>>>>
>>>>
>>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>>>>
>>>> yes, the choice was intentional. personally i do not care if it is <T>
>>>>>
>>>>> all the way, some users complained so we widened it on the choices
>>>>> model, we cannot widen it on the main model.
>>>>>
>>>>> -igor
>>>>>
>>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>>>
>>>>>> I see... but this would i think because Bar "is a" Foo:
>>>>>>
>>>>>> class Bar exends Foo {}
>>>>>> List<? extends Foo> list = ...
>>>>>> list.add(new Bar());
>>>>>>
>>>>>> Anyway, what your saying is that the generics choice was intentional?
>>>>>>
>>>>>> - Brill
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>>>>>>
>>>>>> list<? extends string> stings=...
>>>>>>>
>>>>>>> strings.add("asd"); <== wont compile
>>>>>>>
>>>>>>> -igor
>>>>>>>
>>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos Fernandes
>>>>>>> <ad...@gmail.com> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> What do you mean with "read only" here?
>>>>>>>>
>>>>>>>>
>>>>>>>> Adriano
>>>>>>>>
>>>>>>>>
>>>>>>>> Igor Vaynberg escreveu:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> <? extends Foo> collections are read only, it would be too
>>>>>>>>> inconvenient to make the model collection read only :)
>>>>>>>>>
>>>>>>>>> -igor
>>>>>>>>>
>>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>>>>>>>>> <je...@wickettraining.com> wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> This is what I was commenting on last week on the list (or earlier
>>>>>>>>>> this
>>>>>>>>>> week).  One expects List<? extends Foo> while the other expects
>>>>>>>>>> List<Foo>.
>>>>>>>>>> I'm not fully convinced yet that the "? extends" is the better
>>>>>>>>>> option.
>>>>>>>>>> Either way, I think they should be the same.
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Jeremy Thomerson
>>>>>>>>>> http://www.wickettraining.com
>>>>>>>>>>
>>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <br...@pappin.ca>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> Roughly what I'm doing is:
>>>>>>>>>>>
>>>>>>>>>>> class TypeA{}
>>>>>>>>>>>
>>>>>>>>>>> class TypeAModel extends LoadableDetachableModel< List<TypeA>> {
>>>>>>>>>>>   public List<TypeA> load(){
>>>>>>>>>>>           ... do the load ...
>>>>>>>>>>>           return ...
>>>>>>>>>>>   }
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> TypeAModel model = new TypeAModel();
>>>>>>>>>>> DropDownChoice< TypeA> ddc = new DropDownChoice<TypeA>("id", model
>>>>>>>>>>> );
>>>>>>>>>>>
>>>>>>>>>>> which gets complained about... in this case the generic def is
>>>>>>>>>>> DropDownChoice<List<? extends T>>
>>>>>>>>>>>
>>>>>>>>>>> I think the problem is that the generic def of the class should
>>>>>>>>>>> actually
>>>>>>>>>>> be
>>>>>>>>>>> DropDownChoice<List<T>> because you are already identifying the
>>>>>>>>>>> type
>>>>>>>>>>> when
>>>>>>>>>>> you create a new instance.
>>>>>>>>>>>
>>>>>>>>>>> Now... my generics are a bit hazy at this level, because I can
>>>>>>>>>>> understand
>>>>>>>>>>> why it was done that way... does anyone with more generics
>>>>>>>>>>> experience
>>>>>>>>>>> know
>>>>>>>>>>> what it should be? Is this a bug that needs filing?
>>>>>>>>>>>
>>>>>>>>>>> - Brill
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>>>>>>>>>>>
>>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> For some reason the DropDownChoice component doesn't have the
>>>>>>>>>>>> same
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>> generics as ListView and it will not accept a model that
>>>>>>>>>>>>> listview
>>>>>>>>>>>>> will,
>>>>>>>>>>>>> despite its saying that it will accept an IModel.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Is anyone else having that sort of trouble with DropDownChoice?
>>>>>>>>>>>>>
>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>> Can you give us more information on what exactly is not working
>>>>>>>>>>>> for
>>>>>>>>>>>> you?
>>>>>>>>>>>>
>>>>>>>>>>>> DropDownChoice indeed does accept a model, see for instance the
>>>>>>>>>>>> example
>>>>>>>>>>>> in
>>>>>>>>>>>> the class description at
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>>>>>>>>>>>>
>>>>>>>>>>>> This works for me.
>>>>>>>>>>>>
>>>>>>>>>>>> Kaspar
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>>
>>>>>>>>>>>> <!-- HTML: -->
>>>>>>>>>>>> <select wicket:id="site">
>>>>>>>>>>>>          <option>site 1</option>
>>>>>>>>>>>>          <option>site 2</option>
>>>>>>>>>>>> </select>
>>>>>>>>>>>> <ul>
>>>>>>>>>>>> <li wicket:id="site2"><wicket:container
>>>>>>>>>>>> wicket:id="sitename"/></li>
>>>>>>>>>>>> </ul>
>>>>>>>>>>>>
>>>>>>>>>>>> // Code
>>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>>>>>>>>>>>>  "The Server Side", "Java Lobby", "Java.Net"
>>>>>>>>>>>> });
>>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>>>>>>>>>>>> form.add(new ListView("site2", SITES)
>>>>>>>>>>>> {
>>>>>>>>>>>> @Override
>>>>>>>>>>>> protected void populateItem(ListItem item)
>>>>>>>>>>>> {
>>>>>>>>>>>>  item.add(new Label("sitename", item.getModel()));
>>>>>>>>>>>> }
>>>>>>>>>>>> });
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>> 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
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>> ? extends
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> 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
>>>>>>
>>>>>>
>>>>>>
>>>>> es, the choice
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>
>

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


Re: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by James Carman <jc...@carmanconsulting.com>.
I vote -0.99 on this (non-binding of course).  I'd vote +1 to making
ListView accept List<? extends T> rather than making DDC less
flexible.

On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin <br...@pappin.ca> wrote:
> Ok, as suggested, here is the thread, and the first vote.
>
> +1
> for making the generic definition the same for all list type components.
>
> FYI -  you can also "vote" in the issue I just created at (which might
> actually be a better place to vote):
> https://issues.apache.org/jira/browse/WICKET-2137
>
> - Brill
>
>
>
>
> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>
>> Perhaps start a vote thread, with the subject something like: "VOTE:
>> Remove
>> ? extends from constructor of DropDownChoice".
>>
>> I'd be +1 non-binding
>>
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca> wrote:
>>
>>> I'm of the don't widen it camp anyway :)
>>>
>>> So how do I go about gathering support for having the DropDownChoice work
>>> with the models the way everything else does?
>>>
>>> - Brill
>>>
>>>
>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>>>
>>> yes, the choice was intentional. personally i do not care if it is <T>
>>>>
>>>> all the way, some users complained so we widened it on the choices
>>>> model, we cannot widen it on the main model.
>>>>
>>>> -igor
>>>>
>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>>
>>>>> I see... but this would i think because Bar "is a" Foo:
>>>>>
>>>>> class Bar exends Foo {}
>>>>> List<? extends Foo> list = ...
>>>>> list.add(new Bar());
>>>>>
>>>>> Anyway, what your saying is that the generics choice was intentional?
>>>>>
>>>>> - Brill
>>>>>
>>>>>
>>>>>
>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>>>>>
>>>>> list<? extends string> stings=...
>>>>>>
>>>>>> strings.add("asd"); <== wont compile
>>>>>>
>>>>>> -igor
>>>>>>
>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos Fernandes
>>>>>> <ad...@gmail.com> wrote:
>>>>>>
>>>>>>>
>>>>>>> What do you mean with "read only" here?
>>>>>>>
>>>>>>>
>>>>>>> Adriano
>>>>>>>
>>>>>>>
>>>>>>> Igor Vaynberg escreveu:
>>>>>>>
>>>>>>>>
>>>>>>>> <? extends Foo> collections are read only, it would be too
>>>>>>>> inconvenient to make the model collection read only :)
>>>>>>>>
>>>>>>>> -igor
>>>>>>>>
>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>>>>>>>> <je...@wickettraining.com> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>> This is what I was commenting on last week on the list (or earlier
>>>>>>>>> this
>>>>>>>>> week).  One expects List<? extends Foo> while the other expects
>>>>>>>>> List<Foo>.
>>>>>>>>> I'm not fully convinced yet that the "? extends" is the better
>>>>>>>>> option.
>>>>>>>>> Either way, I think they should be the same.
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Jeremy Thomerson
>>>>>>>>> http://www.wickettraining.com
>>>>>>>>>
>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <br...@pappin.ca>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Roughly what I'm doing is:
>>>>>>>>>>
>>>>>>>>>> class TypeA{}
>>>>>>>>>>
>>>>>>>>>> class TypeAModel extends LoadableDetachableModel< List<TypeA>> {
>>>>>>>>>>   public List<TypeA> load(){
>>>>>>>>>>           ... do the load ...
>>>>>>>>>>           return ...
>>>>>>>>>>   }
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> TypeAModel model = new TypeAModel();
>>>>>>>>>> DropDownChoice< TypeA> ddc = new DropDownChoice<TypeA>("id", model
>>>>>>>>>> );
>>>>>>>>>>
>>>>>>>>>> which gets complained about... in this case the generic def is
>>>>>>>>>> DropDownChoice<List<? extends T>>
>>>>>>>>>>
>>>>>>>>>> I think the problem is that the generic def of the class should
>>>>>>>>>> actually
>>>>>>>>>> be
>>>>>>>>>> DropDownChoice<List<T>> because you are already identifying the
>>>>>>>>>> type
>>>>>>>>>> when
>>>>>>>>>> you create a new instance.
>>>>>>>>>>
>>>>>>>>>> Now... my generics are a bit hazy at this level, because I can
>>>>>>>>>> understand
>>>>>>>>>> why it was done that way... does anyone with more generics
>>>>>>>>>> experience
>>>>>>>>>> know
>>>>>>>>>> what it should be? Is this a bug that needs filing?
>>>>>>>>>>
>>>>>>>>>> - Brill
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>>>>>>>>>>
>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> For some reason the DropDownChoice component doesn't have the
>>>>>>>>>>> same
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> generics as ListView and it will not accept a model that
>>>>>>>>>>>> listview
>>>>>>>>>>>> will,
>>>>>>>>>>>> despite its saying that it will accept an IModel.
>>>>>>>>>>>>
>>>>>>>>>>>> Is anyone else having that sort of trouble with DropDownChoice?
>>>>>>>>>>>>
>>>>>>>>>>>> - Brill
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>> Can you give us more information on what exactly is not working
>>>>>>>>>>> for
>>>>>>>>>>> you?
>>>>>>>>>>>
>>>>>>>>>>> DropDownChoice indeed does accept a model, see for instance the
>>>>>>>>>>> example
>>>>>>>>>>> in
>>>>>>>>>>> the class description at
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>>>>>>>>>>>
>>>>>>>>>>> This works for me.
>>>>>>>>>>>
>>>>>>>>>>> Kaspar
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>>
>>>>>>>>>>> <!-- HTML: -->
>>>>>>>>>>> <select wicket:id="site">
>>>>>>>>>>>          <option>site 1</option>
>>>>>>>>>>>          <option>site 2</option>
>>>>>>>>>>> </select>
>>>>>>>>>>> <ul>
>>>>>>>>>>> <li wicket:id="site2"><wicket:container
>>>>>>>>>>> wicket:id="sitename"/></li>
>>>>>>>>>>> </ul>
>>>>>>>>>>>
>>>>>>>>>>> // Code
>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>>>>>>>>>>>  "The Server Side", "Java Lobby", "Java.Net"
>>>>>>>>>>> });
>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>>>>>>>>>>> form.add(new ListView("site2", SITES)
>>>>>>>>>>> {
>>>>>>>>>>> @Override
>>>>>>>>>>> protected void populateItem(ListItem item)
>>>>>>>>>>> {
>>>>>>>>>>>  item.add(new Label("sitename", item.getModel()));
>>>>>>>>>>> }
>>>>>>>>>>> });
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>> 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
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>> ? extends
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> 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
>>>>>
>>>>>
>>>>>
>>>> es, the choice
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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


Re: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Brill Pappin <br...@pappin.ca>.
Might as well merge the two then... I did do a quick check to see if  
there was another ticket, but obviously a bit too quick :)

- Brill Pappin

On 2-Mar-09, at 3:15 PM, Igor Vaynberg wrote:

> have you seen this thread? looks like someone beat you to it.
>
> [vote] In Wicket 1.4 and onwards, remove widening from the list of
> choices model in DropDownChoice, changing it from IModel<List<?
> extends Foo>> to IModel<List<Foo>>
>
> -igor
>
> On Mon, Mar 2, 2009 at 12:11 PM, Brill Pappin <br...@pappin.ca> wrote:
>> Ok, as suggested, here is the thread, and the first vote.
>>
>> +1
>> for making the generic definition the same for all list type  
>> components.
>>
>> FYI -  you can also "vote" in the issue I just created at (which  
>> might
>> actually be a better place to vote):
>> https://issues.apache.org/jira/browse/WICKET-2137
>>
>> - Brill
>>
>>
>>
>>
>> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>>
>>> Perhaps start a vote thread, with the subject something like: "VOTE:
>>> Remove
>>> ? extends from constructor of DropDownChoice".
>>>
>>> I'd be +1 non-binding
>>>
>>>
>>> --
>>> Jeremy Thomerson
>>> http://www.wickettraining.com
>>>
>>>
>>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca>  
>>> wrote:
>>>
>>>> I'm of the don't widen it camp anyway :)
>>>>
>>>> So how do I go about gathering support for having the  
>>>> DropDownChoice work
>>>> with the models the way everything else does?
>>>>
>>>> - Brill
>>>>
>>>>
>>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>>>>
>>>> yes, the choice was intentional. personally i do not care if it  
>>>> is <T>
>>>>>
>>>>> all the way, some users complained so we widened it on the choices
>>>>> model, we cannot widen it on the main model.
>>>>>
>>>>> -igor
>>>>>
>>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin <br...@pappin.ca>  
>>>>> wrote:
>>>>>
>>>>>> I see... but this would i think because Bar "is a" Foo:
>>>>>>
>>>>>> class Bar exends Foo {}
>>>>>> List<? extends Foo> list = ...
>>>>>> list.add(new Bar());
>>>>>>
>>>>>> Anyway, what your saying is that the generics choice was  
>>>>>> intentional?
>>>>>>
>>>>>> - Brill
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>>>>>>
>>>>>> list<? extends string> stings=...
>>>>>>>
>>>>>>> strings.add("asd"); <== wont compile
>>>>>>>
>>>>>>> -igor
>>>>>>>
>>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos Fernandes
>>>>>>> <ad...@gmail.com> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> What do you mean with "read only" here?
>>>>>>>>
>>>>>>>>
>>>>>>>> Adriano
>>>>>>>>
>>>>>>>>
>>>>>>>> Igor Vaynberg escreveu:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> <? extends Foo> collections are read only, it would be too
>>>>>>>>> inconvenient to make the model collection read only :)
>>>>>>>>>
>>>>>>>>> -igor
>>>>>>>>>
>>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>>>>>>>>> <je...@wickettraining.com> wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> This is what I was commenting on last week on the list (or  
>>>>>>>>>> earlier
>>>>>>>>>> this
>>>>>>>>>> week).  One expects List<? extends Foo> while the other  
>>>>>>>>>> expects
>>>>>>>>>> List<Foo>.
>>>>>>>>>> I'm not fully convinced yet that the "? extends" is the  
>>>>>>>>>> better
>>>>>>>>>> option.
>>>>>>>>>> Either way, I think they should be the same.
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Jeremy Thomerson
>>>>>>>>>> http://www.wickettraining.com
>>>>>>>>>>
>>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <brill@pappin.ca 
>>>>>>>>>> >
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> Roughly what I'm doing is:
>>>>>>>>>>>
>>>>>>>>>>> class TypeA{}
>>>>>>>>>>>
>>>>>>>>>>> class TypeAModel extends LoadableDetachableModel<  
>>>>>>>>>>> List<TypeA>> {
>>>>>>>>>>>   public List<TypeA> load(){
>>>>>>>>>>>           ... do the load ...
>>>>>>>>>>>           return ...
>>>>>>>>>>>   }
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> TypeAModel model = new TypeAModel();
>>>>>>>>>>> DropDownChoice< TypeA> ddc = new  
>>>>>>>>>>> DropDownChoice<TypeA>("id", model
>>>>>>>>>>> );
>>>>>>>>>>>
>>>>>>>>>>> which gets complained about... in this case the generic  
>>>>>>>>>>> def is
>>>>>>>>>>> DropDownChoice<List<? extends T>>
>>>>>>>>>>>
>>>>>>>>>>> I think the problem is that the generic def of the class  
>>>>>>>>>>> should
>>>>>>>>>>> actually
>>>>>>>>>>> be
>>>>>>>>>>> DropDownChoice<List<T>> because you are already  
>>>>>>>>>>> identifying the
>>>>>>>>>>> type
>>>>>>>>>>> when
>>>>>>>>>>> you create a new instance.
>>>>>>>>>>>
>>>>>>>>>>> Now... my generics are a bit hazy at this level, because I  
>>>>>>>>>>> can
>>>>>>>>>>> understand
>>>>>>>>>>> why it was done that way... does anyone with more generics
>>>>>>>>>>> experience
>>>>>>>>>>> know
>>>>>>>>>>> what it should be? Is this a bug that needs filing?
>>>>>>>>>>>
>>>>>>>>>>> - Brill
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>>>>>>>>>>>
>>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> For some reason the DropDownChoice component doesn't have  
>>>>>>>>>>>> the
>>>>>>>>>>>> same
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>> generics as ListView and it will not accept a model that
>>>>>>>>>>>>> listview
>>>>>>>>>>>>> will,
>>>>>>>>>>>>> despite its saying that it will accept an IModel.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Is anyone else having that sort of trouble with  
>>>>>>>>>>>>> DropDownChoice?
>>>>>>>>>>>>>
>>>>>>>>>>>>> - Brill
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>> Can you give us more information on what exactly is not  
>>>>>>>>>>>> working
>>>>>>>>>>>> for
>>>>>>>>>>>> you?
>>>>>>>>>>>>
>>>>>>>>>>>> DropDownChoice indeed does accept a model, see for  
>>>>>>>>>>>> instance the
>>>>>>>>>>>> example
>>>>>>>>>>>> in
>>>>>>>>>>>> the class description at
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>>>>>>>>>>>>
>>>>>>>>>>>> This works for me.
>>>>>>>>>>>>
>>>>>>>>>>>> Kaspar
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>>
>>>>>>>>>>>> <!-- HTML: -->
>>>>>>>>>>>> <select wicket:id="site">
>>>>>>>>>>>>          <option>site 1</option>
>>>>>>>>>>>>          <option>site 2</option>
>>>>>>>>>>>> </select>
>>>>>>>>>>>> <ul>
>>>>>>>>>>>> <li wicket:id="site2"><wicket:container
>>>>>>>>>>>> wicket:id="sitename"/></li>
>>>>>>>>>>>> </ul>
>>>>>>>>>>>>
>>>>>>>>>>>> // Code
>>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>>>>>>>>>>>>  "The Server Side", "Java Lobby", "Java.Net"
>>>>>>>>>>>> });
>>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>>>>>>>>>>>> form.add(new ListView("site2", SITES)
>>>>>>>>>>>> {
>>>>>>>>>>>> @Override
>>>>>>>>>>>> protected void populateItem(ListItem item)
>>>>>>>>>>>> {
>>>>>>>>>>>>  item.add(new Label("sitename", item.getModel()));
>>>>>>>>>>>> }
>>>>>>>>>>>> });
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>> 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
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>> ? extends
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> 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
>>>>>>
>>>>>>
>>>>>>
>>>>> es, the choice
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>


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


Re: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Igor Vaynberg <ig...@gmail.com>.
have you seen this thread? looks like someone beat you to it.

[vote] In Wicket 1.4 and onwards, remove widening from the list of
choices model in DropDownChoice, changing it from IModel<List<?
extends Foo>> to IModel<List<Foo>>

-igor

On Mon, Mar 2, 2009 at 12:11 PM, Brill Pappin <br...@pappin.ca> wrote:
> Ok, as suggested, here is the thread, and the first vote.
>
> +1
> for making the generic definition the same for all list type components.
>
> FYI -  you can also "vote" in the issue I just created at (which might
> actually be a better place to vote):
> https://issues.apache.org/jira/browse/WICKET-2137
>
> - Brill
>
>
>
>
> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>
>> Perhaps start a vote thread, with the subject something like: "VOTE:
>> Remove
>> ? extends from constructor of DropDownChoice".
>>
>> I'd be +1 non-binding
>>
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca> wrote:
>>
>>> I'm of the don't widen it camp anyway :)
>>>
>>> So how do I go about gathering support for having the DropDownChoice work
>>> with the models the way everything else does?
>>>
>>> - Brill
>>>
>>>
>>> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>>>
>>> yes, the choice was intentional. personally i do not care if it is <T>
>>>>
>>>> all the way, some users complained so we widened it on the choices
>>>> model, we cannot widen it on the main model.
>>>>
>>>> -igor
>>>>
>>>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin <br...@pappin.ca> wrote:
>>>>
>>>>> I see... but this would i think because Bar "is a" Foo:
>>>>>
>>>>> class Bar exends Foo {}
>>>>> List<? extends Foo> list = ...
>>>>> list.add(new Bar());
>>>>>
>>>>> Anyway, what your saying is that the generics choice was intentional?
>>>>>
>>>>> - Brill
>>>>>
>>>>>
>>>>>
>>>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
>>>>>
>>>>> list<? extends string> stings=...
>>>>>>
>>>>>> strings.add("asd"); <== wont compile
>>>>>>
>>>>>> -igor
>>>>>>
>>>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos Fernandes
>>>>>> <ad...@gmail.com> wrote:
>>>>>>
>>>>>>>
>>>>>>> What do you mean with "read only" here?
>>>>>>>
>>>>>>>
>>>>>>> Adriano
>>>>>>>
>>>>>>>
>>>>>>> Igor Vaynberg escreveu:
>>>>>>>
>>>>>>>>
>>>>>>>> <? extends Foo> collections are read only, it would be too
>>>>>>>> inconvenient to make the model collection read only :)
>>>>>>>>
>>>>>>>> -igor
>>>>>>>>
>>>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
>>>>>>>> <je...@wickettraining.com> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>> This is what I was commenting on last week on the list (or earlier
>>>>>>>>> this
>>>>>>>>> week).  One expects List<? extends Foo> while the other expects
>>>>>>>>> List<Foo>.
>>>>>>>>> I'm not fully convinced yet that the "? extends" is the better
>>>>>>>>> option.
>>>>>>>>> Either way, I think they should be the same.
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Jeremy Thomerson
>>>>>>>>> http://www.wickettraining.com
>>>>>>>>>
>>>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <br...@pappin.ca>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Roughly what I'm doing is:
>>>>>>>>>>
>>>>>>>>>> class TypeA{}
>>>>>>>>>>
>>>>>>>>>> class TypeAModel extends LoadableDetachableModel< List<TypeA>> {
>>>>>>>>>>   public List<TypeA> load(){
>>>>>>>>>>           ... do the load ...
>>>>>>>>>>           return ...
>>>>>>>>>>   }
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> TypeAModel model = new TypeAModel();
>>>>>>>>>> DropDownChoice< TypeA> ddc = new DropDownChoice<TypeA>("id", model
>>>>>>>>>> );
>>>>>>>>>>
>>>>>>>>>> which gets complained about... in this case the generic def is
>>>>>>>>>> DropDownChoice<List<? extends T>>
>>>>>>>>>>
>>>>>>>>>> I think the problem is that the generic def of the class should
>>>>>>>>>> actually
>>>>>>>>>> be
>>>>>>>>>> DropDownChoice<List<T>> because you are already identifying the
>>>>>>>>>> type
>>>>>>>>>> when
>>>>>>>>>> you create a new instance.
>>>>>>>>>>
>>>>>>>>>> Now... my generics are a bit hazy at this level, because I can
>>>>>>>>>> understand
>>>>>>>>>> why it was done that way... does anyone with more generics
>>>>>>>>>> experience
>>>>>>>>>> know
>>>>>>>>>> what it should be? Is this a bug that needs filing?
>>>>>>>>>>
>>>>>>>>>> - Brill
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
>>>>>>>>>>
>>>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> For some reason the DropDownChoice component doesn't have the
>>>>>>>>>>> same
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> generics as ListView and it will not accept a model that
>>>>>>>>>>>> listview
>>>>>>>>>>>> will,
>>>>>>>>>>>> despite its saying that it will accept an IModel.
>>>>>>>>>>>>
>>>>>>>>>>>> Is anyone else having that sort of trouble with DropDownChoice?
>>>>>>>>>>>>
>>>>>>>>>>>> - Brill
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>> Can you give us more information on what exactly is not working
>>>>>>>>>>> for
>>>>>>>>>>> you?
>>>>>>>>>>>
>>>>>>>>>>> DropDownChoice indeed does accept a model, see for instance the
>>>>>>>>>>> example
>>>>>>>>>>> in
>>>>>>>>>>> the class description at
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
>>>>>>>>>>>
>>>>>>>>>>> This works for me.
>>>>>>>>>>>
>>>>>>>>>>> Kaspar
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>>
>>>>>>>>>>> <!-- HTML: -->
>>>>>>>>>>> <select wicket:id="site">
>>>>>>>>>>>          <option>site 1</option>
>>>>>>>>>>>          <option>site 2</option>
>>>>>>>>>>> </select>
>>>>>>>>>>> <ul>
>>>>>>>>>>> <li wicket:id="site2"><wicket:container
>>>>>>>>>>> wicket:id="sitename"/></li>
>>>>>>>>>>> </ul>
>>>>>>>>>>>
>>>>>>>>>>> // Code
>>>>>>>>>>> List SITES = Arrays.asList(new String[] {
>>>>>>>>>>>  "The Server Side", "Java Lobby", "Java.Net"
>>>>>>>>>>> });
>>>>>>>>>>> form.add(new DropDownChoice("site", SITES));
>>>>>>>>>>> form.add(new ListView("site2", SITES)
>>>>>>>>>>> {
>>>>>>>>>>> @Override
>>>>>>>>>>> protected void populateItem(ListItem item)
>>>>>>>>>>> {
>>>>>>>>>>>  item.add(new Label("sitename", item.getModel()));
>>>>>>>>>>> }
>>>>>>>>>>> });
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>> 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
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>> ? extends
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> 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
>>>>>
>>>>>
>>>>>
>>>> es, the choice
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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


Re: VOTE: Remove ? extends from constructor of DropDownChoice

Posted by Johannes Schneider <ma...@cedarsoft.com>.
On Mon, 2009-03-02 at 15:11 -0500, Brill Pappin wrote:
> Ok, as suggested, here is the thread, and the first vote.
> 
> +1
> for making the generic definition the same for all list type components.

Yes, you are right. All those list type components should have the same
generic definition.

But: Don't "fix" those components that have the correct definition.
Please fix those that have the wrong (without wildcard) definition.


I think the core problem is, that IModel has a setter. But it doesn't
make any sense to offer a setter on a model providing a collection.

If all those list type components accept "IReadOnlyModel", most of the
discussed points will become obvious.


I think I will create another post, explaining the problem with IModel
and Collections...



Regards,

Johannes

> 
> FYI -  you can also "vote" in the issue I just created at (which might  
> actually be a better place to vote):
> https://issues.apache.org/jira/browse/WICKET-2137
> 
> - Brill
> 
> 
> 
> 
> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
> 
> > Perhaps start a vote thread, with the subject something like: "VOTE:  
> > Remove
> > ? extends from constructor of DropDownChoice".
> >
> > I'd be +1 non-binding
> >
> >
> > -- 
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
> >
> > On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin <br...@pappin.ca> wrote:
> >
> >> I'm of the don't widen it camp anyway :)
> >>
> >> So how do I go about gathering support for having the  
> >> DropDownChoice work
> >> with the models the way everything else does?
> >>
> >> - Brill
> >>
> >>
> >> On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
> >>
> >> yes, the choice was intentional. personally i do not care if it is  
> >> <T>
> >>> all the way, some users complained so we widened it on the choices
> >>> model, we cannot widen it on the main model.
> >>>
> >>> -igor
> >>>
> >>> On Fri, Feb 27, 2009 at 8:51 PM, Brill Pappin <br...@pappin.ca>  
> >>> wrote:
> >>>
> >>>> I see... but this would i think because Bar "is a" Foo:
> >>>>
> >>>> class Bar exends Foo {}
> >>>> List<? extends Foo> list = ...
> >>>> list.add(new Bar());
> >>>>
> >>>> Anyway, what your saying is that the generics choice was  
> >>>> intentional?
> >>>>
> >>>> - Brill
> >>>>
> >>>>
> >>>>
> >>>> On 27-Feb-09, at 3:19 PM, Igor Vaynberg wrote:
> >>>>
> >>>> list<? extends string> stings=...
> >>>>> strings.add("asd"); <== wont compile
> >>>>>
> >>>>> -igor
> >>>>>
> >>>>> On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos Fernandes
> >>>>> <ad...@gmail.com> wrote:
> >>>>>
> >>>>>>
> >>>>>> What do you mean with "read only" here?
> >>>>>>
> >>>>>>
> >>>>>> Adriano
> >>>>>>
> >>>>>>
> >>>>>> Igor Vaynberg escreveu:
> >>>>>>
> >>>>>>>
> >>>>>>> <? extends Foo> collections are read only, it would be too
> >>>>>>> inconvenient to make the model collection read only :)
> >>>>>>>
> >>>>>>> -igor
> >>>>>>>
> >>>>>>> On Thu, Feb 26, 2009 at 8:34 PM, Jeremy Thomerson
> >>>>>>> <je...@wickettraining.com> wrote:
> >>>>>>>
> >>>>>>>
> >>>>>>>> This is what I was commenting on last week on the list (or  
> >>>>>>>> earlier
> >>>>>>>> this
> >>>>>>>> week).  One expects List<? extends Foo> while the other expects
> >>>>>>>> List<Foo>.
> >>>>>>>> I'm not fully convinced yet that the "? extends" is the better
> >>>>>>>> option.
> >>>>>>>> Either way, I think they should be the same.
> >>>>>>>>
> >>>>>>>> --
> >>>>>>>> Jeremy Thomerson
> >>>>>>>> http://www.wickettraining.com
> >>>>>>>>
> >>>>>>>> On Thu, Feb 26, 2009 at 8:27 PM, Brill Pappin <br...@pappin.ca>
> >>>>>>>> wrote:
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>> Roughly what I'm doing is:
> >>>>>>>>>
> >>>>>>>>> class TypeA{}
> >>>>>>>>>
> >>>>>>>>> class TypeAModel extends LoadableDetachableModel<  
> >>>>>>>>> List<TypeA>> {
> >>>>>>>>>    public List<TypeA> load(){
> >>>>>>>>>            ... do the load ...
> >>>>>>>>>            return ...
> >>>>>>>>>    }
> >>>>>>>>> }
> >>>>>>>>>
> >>>>>>>>> TypeAModel model = new TypeAModel();
> >>>>>>>>> DropDownChoice< TypeA> ddc = new DropDownChoice<TypeA>("id",  
> >>>>>>>>> model
> >>>>>>>>> );
> >>>>>>>>>
> >>>>>>>>> which gets complained about... in this case the generic def is
> >>>>>>>>> DropDownChoice<List<? extends T>>
> >>>>>>>>>
> >>>>>>>>> I think the problem is that the generic def of the class  
> >>>>>>>>> should
> >>>>>>>>> actually
> >>>>>>>>> be
> >>>>>>>>> DropDownChoice<List<T>> because you are already identifying  
> >>>>>>>>> the type
> >>>>>>>>> when
> >>>>>>>>> you create a new instance.
> >>>>>>>>>
> >>>>>>>>> Now... my generics are a bit hazy at this level, because I can
> >>>>>>>>> understand
> >>>>>>>>> why it was done that way... does anyone with more generics
> >>>>>>>>> experience
> >>>>>>>>> know
> >>>>>>>>> what it should be? Is this a bug that needs filing?
> >>>>>>>>>
> >>>>>>>>> - Brill
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> On 26-Feb-09, at 6:03 PM, Kaspar Fischer wrote:
> >>>>>>>>>
> >>>>>>>>> On 26.02.2009, at 22:52, Brill Pappin wrote:
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>> For some reason the DropDownChoice component doesn't have  
> >>>>>>>>>> the same
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>> generics as ListView and it will not accept a model that  
> >>>>>>>>>>> listview
> >>>>>>>>>>> will,
> >>>>>>>>>>> despite its saying that it will accept an IModel.
> >>>>>>>>>>>
> >>>>>>>>>>> Is anyone else having that sort of trouble with  
> >>>>>>>>>>> DropDownChoice?
> >>>>>>>>>>>
> >>>>>>>>>>> - Brill
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>> Can you give us more information on what exactly is not  
> >>>>>>>>>> working for
> >>>>>>>>>> you?
> >>>>>>>>>>
> >>>>>>>>>> DropDownChoice indeed does accept a model, see for instance  
> >>>>>>>>>> the
> >>>>>>>>>> example
> >>>>>>>>>> in
> >>>>>>>>>> the class description at
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html
> >>>>>>>>>>
> >>>>>>>>>> This works for me.
> >>>>>>>>>>
> >>>>>>>>>> Kaspar
> >>>>>>>>>>
> >>>>>>>>>> --
> >>>>>>>>>>
> >>>>>>>>>> <!-- HTML: -->
> >>>>>>>>>> <select wicket:id="site">
> >>>>>>>>>>           <option>site 1</option>
> >>>>>>>>>>           <option>site 2</option>
> >>>>>>>>>> </select>
> >>>>>>>>>> <ul>
> >>>>>>>>>> <li wicket:id="site2"><wicket:container
> >>>>>>>>>> wicket:id="sitename"/></li>
> >>>>>>>>>> </ul>
> >>>>>>>>>>
> >>>>>>>>>> // Code
> >>>>>>>>>> List SITES = Arrays.asList(new String[] {
> >>>>>>>>>>   "The Server Side", "Java Lobby", "Java.Net"
> >>>>>>>>>> });
> >>>>>>>>>> form.add(new DropDownChoice("site", SITES));
> >>>>>>>>>> form.add(new ListView("site2", SITES)
> >>>>>>>>>> {
> >>>>>>>>>> @Override
> >>>>>>>>>> protected void populateItem(ListItem item)
> >>>>>>>>>> {
> >>>>>>>>>>   item.add(new Label("sitename", item.getModel()));
> >>>>>>>>>> }
> >>>>>>>>>> });
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>>> 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
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>> ? extends
> >>>>>>>
> >>>>>>> ---------------------------------------------------------------------
> >>>>>>> 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
> >>>>
> >>>>
> >>>>
> >>> es, the choice
> >>>
> >>> ---------------------------------------------------------------------
> >>> 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