Re: Wicket 6.5 CompoundPropertyModel constructor ambiguity

2013-01-28 Thread Eric Jablow
On Fri, Jan 25, 2013 at 4:24 AM, Pieter Claassen
 wrote:
> When I try to create the following model after migrating to wicket 6.5.0
>
> new CompoundPropertyModel(reportWebModel)
>
> *where*
>
> ReportWebModel extends BaseWebModel
>
> *and*
>
> BaseWebModel implements IModel
>
> My IDE (Intellij) shows no problem with type checking the code but when I
> try to compile it I get:
>
> java: reference to CompoundPropertyModel is ambiguous, both constructor
> CompoundPropertyModel(org.apache.wicket.model.IModel) in
> org.apache.wicket.model.CompoundPropertyModel and constructor
> CompoundPropertyModel(T) in org.apache.wicket.model.CompoundPropertyModel
> match
>
> The problem goes away when I remove the generics but then I also lose the
> type checking.
>
> Any suggestions?
>
> Thanks,
> Pieter

Why do you have a CompoundPropertyModel with a Model as its generic
type? I would
expect you to want a CompoundPropertyModel.

Given

class ReportWebModel implementsIModel {...}

ReportWebModel reportWebModel = ...;
IModel cpm = new CompoundPropertyModel(reportWebModel);

should succeed, because it matches the CPM constructor:
public class CompoundPropertyModel {
public CompoundPropertyModel(IModel model) {..}
}

Remember, Java Generics have to match exactly.

Respectfully,
Eric Jablow

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



Re: Wicket 6.5 CompoundPropertyModel constructor ambiguity

2013-01-28 Thread Martin Grigorov
I believe that this question has been asked recently and it got a response.

http://markmail.org/thread/rfcqarnvct3t2gh3


On Fri, Jan 25, 2013 at 11:24 AM, Pieter Claassen  wrote:

> When I try to create the following model after migrating to wicket 6.5.0
>
> new CompoundPropertyModel(reportWebModel)
>
> *where*
>
> ReportWebModel extends BaseWebModel
>
> *and*
>
> BaseWebModel implements IModel
>
> My IDE (Intellij) shows no problem with type checking the code but when I
> try to compile it I get:
>
> java: reference to CompoundPropertyModel is ambiguous, both constructor
> CompoundPropertyModel(org.apache.wicket.model.IModel) in
> org.apache.wicket.model.CompoundPropertyModel and constructor
> CompoundPropertyModel(T) in org.apache.wicket.model.CompoundPropertyModel
> match
>
> The problem goes away when I remove the generics but then I also lose the
> type checking.
>
> Any suggestions?
>
> Thanks,
> Pieter
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com 


Re: Wicket 6.5 CompoundPropertyModel constructor ambiguity

2013-01-25 Thread Bas Gooren

Well, from the looks of it it's a bit odd that you write

new CompoundPropertyModel(reportWebModel)

instead of

new CompoundPropertyModel(reportWebModel)

since ReportWebModel extends BaseWebModel

The CPM constructor expects either a type literal or a model. In your 
case it is both, and you tell the CPM (through the generic type) that 
you will provide a type literal.


Does your CPM have to be of type ?

Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 25-1-2013 12:02, schreef Pieter Claassen:

When I try to create the following model after migrating to wicket 6.5.0

new CompoundPropertyModel(reportWebModel)

*where*

ReportWebModel extends BaseWebModel

*and*

BaseWebModel implements IModel

My IDE (Intellij) shows no problem with type checking the code but when I
try to compile it I get:

java: reference to CompoundPropertyModel is ambiguous, both constructor
CompoundPropertyModel(org.apache.wicket.model.IModel) in
org.apache.wicket.model.CompoundPropertyModel and constructor
CompoundPropertyModel(T) in org.apache.wicket.model.CompoundPropertyModel
match

The problem goes away when I remove the generics but then I also lose the
type checking.

Any suggestions?

Thanks,
Pieter





Wicket 6.5 CompoundPropertyModel constructor ambiguity

2013-01-25 Thread Pieter Claassen
When I try to create the following model after migrating to wicket 6.5.0

new CompoundPropertyModel(reportWebModel)

*where*

ReportWebModel extends BaseWebModel

*and*

BaseWebModel implements IModel

My IDE (Intellij) shows no problem with type checking the code but when I
try to compile it I get:

java: reference to CompoundPropertyModel is ambiguous, both constructor
CompoundPropertyModel(org.apache.wicket.model.IModel) in
org.apache.wicket.model.CompoundPropertyModel and constructor
CompoundPropertyModel(T) in org.apache.wicket.model.CompoundPropertyModel
match

The problem goes away when I remove the generics but then I also lose the
type checking.

Any suggestions?

Thanks,
Pieter

-- 
- - - - - - - - - - - - - - - - - - - -
  Pieter Claassen
  Musmato B.V.
  e: pieter.claas...@musmato.com
  t: +31 877 848259
  w: http://musmato.com
- - - - - - - - - - - - - - - - - - - -