On Mon, Aug 16, 2010 at 5:42 AM, nivs <shravann...@gmail.com> wrote:
> 2. firstName = new TextField("studyName",new
> PropertyModel<Study>(pModel.getObject().getStudyName(),"studyName"));
>

It should be:

new PropertyModel<String>(pModel, "studyName").

The first argument to PropertyModel's constructor is the "root" for
the property expression.  If it's a model, Wicket knows to get the
model's object and apply the property expression to that.  What you're
doing is telling Wicket to set up a property model where a String is
the "root" and the propertyExpression is "studyName."  There is no
"studyName" property on the String class, so that won't work.  Also,
your expression and your model type (<Study>) don't match here.
You're telling it to traverse to the study name (which is a String I
assume) and you're saying the model is of type Study.  The property
navigation you're trying to do won't work either.  All that does is
traverse the property before the method is called and passes its value
in to the method as a parameter.  It's not "recording" anything.  I
would just go with the simplest solution for now to get you going.
Don't try to get too fancy too fast.  Walk before you run.

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

Reply via email to