Your issue with the generics is you need to tell it that 'T extends
Indetifiable', or take it out entirely if you are going to explicitly tell
it that you are using the Parent class.

Also feel free to make the argument match what your load method requires.
The article could be referencing code that is old or whatever. Also keep in
mind that the class Long implements Serializable, but the primitive long
(lower case 'l') isn't an object and doesn't have a type inheritance (even
though it will serialize, but that's a disfferent topic).


-Clint



public class EntityModel<T *extends Identifiable*> extends
AbstractEntityModel<T> {
       public EntityModel(Class<? extends T> clazz, Serializable id) {
               super(clazz, id);
       }
       @Override
       protected T load(Class clazz, Serializable id) {
               return WicketApplication.get().get_
service().load(clazz, id);
       }
}


On Mon, Apr 18, 2011 at 6:16 AM, lucast <lucastol...@hotmail.com> wrote:

> Hi jcgarciam,
> I have made sure that my original class Parent does implement class
> Identifiable<Serializable> and I have now modified EntityModel<T> to public
> class EntityModel<T> extends AbstractEntityModel<Parent> {. That got rid
> the
> error message.  So that's great. Thanks!
> I will try to have it running later on during the day.
>
> Why does AbstractEntityModel class on
> http://wicketinaction.com/2008/09/building-a-smart-entitymodel/
> http://wicketinaction.com/2008/09/building-a-smart-entitymodel/  uses
> Serializable id, when later on,  under "Using EntityModel to bind to Forms"
> it is passing a value of type Long to initialise the EntityModel class?
> Based on the example of the EntityModel.load() function, should I change my
> WicketApplication.get().get_service().load(clazz, id) to accept
> Serialisable
> instead of Long?
> Maybe I'm missing something basic here. But your suggestion helped to get
> past the initial hurdle.
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Refreshing-loadable-detachable-model-object-inside-an-ajax-call-tp3446979p3457227.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to