Re: using a model with DropDownChoice

2009-02-28 Thread Brill Pappin

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
adrian...@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
jer...@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
ListFoo.
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 ListTypeA {
 public ListTypeA load(){
 ... do the load ...
 return ...
 }
}

TypeAModel model = new TypeAModel();
DropDownChoice TypeA ddc = new DropDownChoiceTypeA(id,  
model );


which gets complained about... in this case the generic def is
DropDownChoiceList? extends T

I think the problem is that the generic def of the class should
actually
be
DropDownChoiceListT 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
optionsite 1/option
optionsite 2/option
 /select
 ul
 li wicket:id=site2wicket: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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





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





? extends

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





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




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




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




es, the choice

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





Re: using a model with DropDownChoice

2009-02-28 Thread Jeremy Thomerson
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
 adrian...@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
 jer...@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
 ListFoo.
 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 ListTypeA {
 public ListTypeA load(){
 ... do the load ...
 return ...
 }
 }

 TypeAModel model = new TypeAModel();
 DropDownChoice TypeA ddc = new DropDownChoiceTypeA(id, model
 );

 which gets complained about... in this case the generic def is
 DropDownChoiceList? extends T

 I think the problem is that the generic def of the class should
 actually
 be
 DropDownChoiceListT 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
optionsite 1/option
optionsite 2/option
  /select
  ul
  li wicket:id=site2wicket: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-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





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




 ? extends

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




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



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



 -
 To unsubscribe, e-mail: 

Re: using a model with DropDownChoice

2009-02-27 Thread Adriano dos Santos Fernandes

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
jer...@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 ListFoo.
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 ListTypeA {
   public ListTypeA load(){
   ... do the load ...
   return ...
   }
}

TypeAModel model = new TypeAModel();
DropDownChoice TypeA ddc = new DropDownChoiceTypeA(id, model );

which gets complained about... in this case the generic def is
DropDownChoiceList? extends T

I think the problem is that the generic def of the class should actually be
DropDownChoiceListT 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
  optionsite 1/option
  optionsite 2/option
 /select
 ul
 li wicket:id=site2wicket: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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




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


  


? extends

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

  



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



Re: using a model with DropDownChoice

2009-02-27 Thread Igor Vaynberg
list? extends string stings=...
strings.add(asd); == wont compile

-igor

On Fri, Feb 27, 2009 at 11:13 AM, Adriano dos Santos Fernandes
adrian...@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
 jer...@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
 ListFoo.
 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 ListTypeA {
       public ListTypeA load(){
               ... do the load ...
               return ...
       }
 }

 TypeAModel model = new TypeAModel();
 DropDownChoice TypeA ddc = new DropDownChoiceTypeA(id, model );

 which gets complained about... in this case the generic def is
 DropDownChoiceList? extends T

 I think the problem is that the generic def of the class should actually
 be
 DropDownChoiceListT 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
              optionsite 1/option
              optionsite 2/option
  /select
  ul
  li wicket:id=site2wicket: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-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




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




 ? extends

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




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



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



Re: using a model with DropDownChoice

2009-02-27 Thread Brill Pappin

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
adrian...@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
jer...@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
ListFoo.
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 ListTypeA {
  public ListTypeA load(){
  ... do the load ...
  return ...
  }
}

TypeAModel model = new TypeAModel();
DropDownChoice TypeA ddc = new DropDownChoiceTypeA(id,  
model );


which gets complained about... in this case the generic def is
DropDownChoiceList? extends T

I think the problem is that the generic def of the class should  
actually

be
DropDownChoiceListT 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
 optionsite 1/option
 optionsite 2/option
 /select
 ul
 li wicket:id=site2wicket: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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





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





? extends

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





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




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




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



Re: using a model with DropDownChoice

2009-02-27 Thread Igor Vaynberg
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
 adrian...@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
 jer...@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
 ListFoo.
 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 ListTypeA {
      public ListTypeA load(){
              ... do the load ...
              return ...
      }
 }

 TypeAModel model = new TypeAModel();
 DropDownChoice TypeA ddc = new DropDownChoiceTypeA(id, model );

 which gets complained about... in this case the generic def is
 DropDownChoiceList? extends T

 I think the problem is that the generic def of the class should
 actually
 be
 DropDownChoiceListT 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
             optionsite 1/option
             optionsite 2/option
  /select
  ul
  li wicket:id=site2wicket: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-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




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




 ? extends

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




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



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



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



es, the choice

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



using a model with DropDownChoice

2009-02-26 Thread Brill Pappin
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


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



Re: using a model with DropDownChoice

2009-02-26 Thread Kaspar Fischer

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
optionsite 1/option
optionsite 2/option
  /select
  ul
   li wicket:id=site2wicket: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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: using a model with DropDownChoice

2009-02-26 Thread Brill Pappin

Roughly what I'm doing is:

class TypeA{}

class TypeAModel extends LoadableDetachableModel ListTypeA {
public ListTypeA load(){
... do the load ...
return ...
}
}

TypeAModel model = new TypeAModel();
DropDownChoice TypeA ddc = new DropDownChoiceTypeA(id, model );

which gets complained about... in this case the generic def is  
DropDownChoiceList? extends T


I think the problem is that the generic def of the class should  
actually be DropDownChoiceListT 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
   optionsite 1/option
   optionsite 2/option
 /select
 ul
  li wicket:id=site2wicket: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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




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



Re: using a model with DropDownChoice

2009-02-26 Thread Jeremy Thomerson
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 ListFoo.
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 ListTypeA {
public ListTypeA load(){
... do the load ...
return ...
}
 }

 TypeAModel model = new TypeAModel();
 DropDownChoice TypeA ddc = new DropDownChoiceTypeA(id, model );

 which gets complained about... in this case the generic def is
 DropDownChoiceList? extends T

 I think the problem is that the generic def of the class should actually be
 DropDownChoiceListT 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
   optionsite 1/option
   optionsite 2/option
  /select
  ul
  li wicket:id=site2wicket: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-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



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




Re: using a model with DropDownChoice

2009-02-26 Thread Igor Vaynberg
? 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
jer...@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 ListFoo.
 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 ListTypeA {
        public ListTypeA load(){
                ... do the load ...
                return ...
        }
 }

 TypeAModel model = new TypeAModel();
 DropDownChoice TypeA ddc = new DropDownChoiceTypeA(id, model );

 which gets complained about... in this case the generic def is
 DropDownChoiceList? extends T

 I think the problem is that the generic def of the class should actually be
 DropDownChoiceListT 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
               optionsite 1/option
               optionsite 2/option
  /select
  ul
  li wicket:id=site2wicket: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-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



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




? extends

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



Re: using a model with DropDownChoice

2009-02-26 Thread Brill Pappin
Do you mean that I should do something to make the list read only or  
that it should have the same generic definition?


IMO they should all work the same way... so I'm +1 for the ListFoo.  
syntax.


Also, I'm not sure that they mean read only. AFAIK it just means  
that the unknown object must be assignable to Foo (although I could be  
wrong about that).


- Brill Pappin


On 26-Feb-09, at 11:50 PM, Igor Vaynberg wrote:


? 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
jer...@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  
ListFoo.
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 ListTypeA {
   public ListTypeA load(){
   ... do the load ...
   return ...
   }
}

TypeAModel model = new TypeAModel();
DropDownChoice TypeA ddc = new DropDownChoiceTypeA(id,  
model );


which gets complained about... in this case the generic def is
DropDownChoiceList? extends T

I think the problem is that the generic def of the class should  
actually be
DropDownChoiceListT 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
  optionsite 1/option
  optionsite 2/option
 /select
 ul
 li wicket:id=site2wicket: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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




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






? extends

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




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