You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by William Hoover <wh...@nemours.org> on 2007/11/09 16:41:24 UTC

Using a Form BoundCompoundPropertyModel and exluded model property references

Is there a way to exclude properties from being resolved in the BoundCompoundPropertyModel?

I'm using:

// in page form
SomeModel someModel = new SomeBean();
Form someForm = new Form("some-form-id", new BoundCompoundPropertyModel(someModel));
someForm.add(someModel.bind(new TextField("some-property-id"), "someModelProperty"));
someForm.add(new SomePanel("some-form-panel-id").setRenderBodyOnly(true));
add(someForm);

// in SomePanel 
WebMarkupContainerWithAssociatedMarkup fieldset = new WebMarkupContainerWithAssociatedMarkup("some-panel-fieldset");
fieldset.add(new Label("some-panel-legend").add(new SomeBehaviourToAddStringResourceForLegend()));
add(fieldset);

...but I get an exception:

org.apache.wicket.WicketRuntimeException: No get method defined for class: class com.example.model.SomeModel expression: some-panel-legend





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


RE: Using a Form BoundCompoundPropertyModel and exluded model property references

Posted by William Hoover <wh...@nemours.org>.
Found the problem... I forgot to add a model to the "new SomePanel("some-form-panel-id", new Model())".

I added this to the wiki http://cwiki.apache.org/confluence/display/WICKET/Working+with+Wicket+models

-----Original Message-----
From: William Hoover [mailto:whoover@nemours.org]
Sent: Friday, November 09, 2007 10:41 AM
To: users@wicket.apache.org
Subject: Using a Form BoundCompoundPropertyModel and exluded model
property references


Is there a way to exclude properties from being resolved in the BoundCompoundPropertyModel?

I'm using:

// in page form
SomeModel someModel = new SomeBean();
Form someForm = new Form("some-form-id", new BoundCompoundPropertyModel(someModel));
someForm.add(someModel.bind(new TextField("some-property-id"), "someModelProperty"));
someForm.add(new SomePanel("some-form-panel-id").setRenderBodyOnly(true));
add(someForm);

// in SomePanel 
WebMarkupContainerWithAssociatedMarkup fieldset = new WebMarkupContainerWithAssociatedMarkup("some-panel-fieldset");
fieldset.add(new Label("some-panel-legend").add(new SomeBehaviourToAddStringResourceForLegend()));
add(fieldset);

...but I get an exception:

org.apache.wicket.WicketRuntimeException: No get method defined for class: class com.example.model.SomeModel expression: some-panel-legend





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



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