yes, you are right, the red squiggle i got in the ide was actually :
error: this variable might not have been initialized :|

-igor

On Fri, Mar 13, 2009 at 1:39 PM, James Carman
<[email protected]> wrote:
> As I said before, my patch for WICKET-2165 doesn't change any test or
> example code at all and everything builds just fine.  There are plenty
> of examples in the test and example code where you pass in a
> IModel<List<T>> to the constructor and it all is still working.  Take
> for example the FileListView class in the MultiUploadPage example from
> wicket-examples.  It's passing an IModel<List<File>> to its
> superclass' (ListView) constructor.  No issues.
>
> On Fri, Mar 13, 2009 at 4:33 PM, James Carman
> <[email protected]> wrote:
>> I did!  I added a simple class to my wicket development project that
>> has all of my changes applied for WICKET-2165.  In IDEA when I hit
>> Ctrl-B (go to declaration) it takes me to a constructor with this
>> signature:
>>
>> public ListView(final String id, final IModel<? extends List<? extends
>> T>> model)
>>
>> If you don't believe me, just try this to verify:
>>
>> public class ListManager<T> extends Panel
>> {
>>    public ListManager(String id, IModel<List<T>> entries)
>>    {
>>        super(id);
>>        someMethod(entries);
>>    }
>>
>>    private void someMethod(IModel<? extends List<? extends T>> model)
>>    {
>>        // Do nothing!
>>    }
>> }
>>
>> This compiles just fine.
>>
>> On Fri, Mar 13, 2009 at 4:25 PM, Igor Vaynberg <[email protected]> 
>> wrote:
>>> now change listview to take imodel<? extends List<? extends T>>
>>>
>>> -igor
>>>
>>> On Fri, Mar 13, 2009 at 1:00 PM, James Carman
>>> <[email protected]> wrote:
>>>> Ok, what part are you talking about that doesn't compile?  In my IDE
>>>> right now, I have:
>>>>
>>>> public class ListManager<T> extends Panel
>>>> {
>>>>    public ListManager(String id, IModel<List<T>> entries)
>>>>    {
>>>>        super(id);
>>>>        add(new ListView<T>("list", entries)
>>>>        {
>>>>            protected void populateItem(ListItem<T> item)
>>>>            {
>>>>
>>>>            }
>>>>        });
>>>>    }
>>>> }
>>>>
>>>> This all checks out fine.  I didn't use the form part because Panel's
>>>> getDefaultModelObject() method returns Object, and you can't call
>>>> add() on that, so I assumed that was just for illustrative purposes.
>>>>
>>>>
>>>> On Fri, Mar 13, 2009 at 2:57 PM, Igor Vaynberg <[email protected]> 
>>>> wrote:
>>>>> yes, sorry
>>>>>
>>>>> class listmanager<t> extends panel {
>>>>>
>>>>> public listmanager(string id, imodel<list<t>> entries) {
>>>>>  add(new form("form") { onsubmit() {
>>>>> listmanager.this.getmodelobject().add(someentry);}}
>>>>>  add(new listview<t>("list", entries){});
>>>>>
>>>>>
>>>>> -igor
>>>>>
>>>>> On Fri, Mar 13, 2009 at 11:51 AM, James Carman
>>>>> <[email protected]> wrote:
>>>>>> If T is the element type, then you can't use an IModel<T> for the 
>>>>>> choices.
>>>>>> You can't do that with the current API.  Did you mean to pass in an
>>>>>> IModel<List<T>> to the constructor?
>>>>>>
>>>>>> On Mar 13, 2009 2:45 PM, "Igor Vaynberg" <[email protected]> wrote:
>>>>>>
>>>>>> t is the type of a list element, see below
>>>>>>
>>>>>> class listmanager<t> extends panel {
>>>>>>
>>>>>> public listmanager(string id, imodel<t> entries) {
>>>>>>   add(new form("form") { onsubmit() {
>>>>>> listmanager.this.getmodelobject().add(someentry);}}
>>>>>>   add(new listview<t>("list", entries){});
>>>>>>
>>>>>> ^ wont compile because you cant assign imodel<t> to imodel<? extends 
>>>>>> list<?
>>>>>> extends t>> so we ha...
>>>>>>
>>>>>> On Fri, Mar 13, 2009 at 8:59 AM, James Carman 
>>>>>> <[email protected]>
>>>>>> wrote: > T has to be a ...
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [email protected]
>>>>> For additional commands, e-mail: [email protected]
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [email protected]
>>>> For additional commands, e-mail: [email protected]
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to