You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Artur W." <a_...@gazeta.pl> on 2008/03/27 09:00:19 UTC

using PropertyModel in abstract class

Hi!

When I use PropertyModel  like this:

public abstract class Parent extends WebPage {
    private int field;
    public Parent() {
        Form form = new Form("form");
        add(form);
        form.add(new TextField("field", new PropertyModel(this, "field")));
    }
    public int getField() { return field;}
    public void setField(int field) { this.field = field; };

    [some other stuff...]
}

public class Child extends Parent {
    [some other stuff...]
}

I've got error:

org.apache.wicket.WicketRuntimeException: No get method defined for class:
class com.domain.Child expression: filed
     at
org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:433)
     at
org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
     at
org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
     at
org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113)
     at org.apache.wicket.Component.getModelObject(Component.java:1551)
     at
org.apache.wicket.Component.getModelObjectAsString(Component.java:1573)
     at
org.apache.wicket.markup.html.form.FormComponent.getModelValue(FormComponent.java:1267)
     at
org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:780)
     at
org.apache.wicket.markup.html.form.TextField.onComponentTag(TextField.java:100)


Is is a bug? I use wicket 1.3.2

Thanks for help,
Artur

-- 
View this message in context: http://www.nabble.com/using-PropertyModel-in-abstract-class-tp16323331p16323331.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: using PropertyModel in abstract class

Posted by "Artur W." <a_...@gazeta.pl>.
Sorry, it was my bug..

PropertyModel works great! :)


Artur

-- 
View this message in context: http://www.nabble.com/using-PropertyModel-in-abstract-class-tp16323331p16323342.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: using PropertyModel in abstract class

Posted by Gerolf Seitz <ge...@gmail.com>.
> org.apache.wicket.WicketRuntimeException: No get method defined for class:
> class com.domain.Child expression: filed
>

looks like you mispelled the property name in the propertymodel constructor?

  Gerolf