using PropertyModel in abstract class

2008-03-27 Thread Artur W.

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: using PropertyModel in abstract class

2008-03-27 Thread Gerolf Seitz
 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


Re: using PropertyModel in abstract class

2008-03-27 Thread Artur W.

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]