Hi Clint, 
Here is the example of EntityModel as taken from 
http://wicketinaction.com/2008/09/building-a-smart-entitymodel/
http://wicketinaction.com/2008/09/building-a-smart-entitymodel/ .
I've added the constructor that calls super().
public class EntityModel<T> 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);
        }
}
Now my I have two errors from my IDE (Eclipse), the first one on extends
AbstractEntityModel<T> {. On type T, it says: Bound mismatch: The type T is
not a valid substitute for the bounded parameter <T extends Identifiable<?>>
of the type AbstractEntityModel<T>.
Would you know what is going on here? I am following the exact example.

The second error my IDE is complaining about is on return
WicketApplication.get().get_service().load(clazz, id);: The method
load(Class<T>, long) in the type Service is not applicable for the arguments
(Class, Serializable).
That's fair enough since all the objects ID i'm persisting to DB are of type
Long. 
But why is the example using type Serializable instead of Long? 
If you look at the section "Using EntityModel to bind to Forms", from the
link above you will see that the values passed are class and Long:
 public EditPersonPage(Long personId)
    {
        this(new EntityModel<Person>(Person.class, personId));
    }

I fear I'm missing a very small detail that's stopping me from having this
working.
Thanks, Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Refreshing-loadable-detachable-model-object-inside-an-ajax-call-tp3446979p3456789.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