Hi all,
I'm getting a null model object error when submitting a form that
includes a date form macro-component that is a composite of simple
drop down fields for year, month and day. This custom component model
is initialized to be a compound model of a (not null) date passed as
argument:
public DateComponent(String id, Date date) {
super(id, new CompoundPropertyModel(date));
....
}
The sub components are then created as:
new DropDownChoice("day", getRange(...), renderer);
new DropDownChoice("month", getRange(...), renderer);
new DropDownChoice("year", getRange(...), renderer);
But during form submission I get the error trace quoted below, as if
the compound model is not being taken into account for the children
updateModel():
WicketMessage: Null object setting value: 16 with expression: day
Root cause:
org.apache.wicket.WicketRuntimeException: Null object setting value:
16 with expression: day
at
org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:123)
at
org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:152)
at org.apache.wicket.Component.setModelObject(Component.java:2057)
at
org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:724)
at org.apache.wicket.markup.html.form.Form$10.validate(Form.java:982)
at
org.apache.wicket.markup.html.form.Form$ValidationVisitor.formComponent(Form.java:167)
at org.apache.wicket.markup.html.form.Form$4.component(Form.java:542)
at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:793)
at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:808)
Am I missing something?
TIA.
Cheers,
Carlos
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user