You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Martijn Lindhout <ml...@jointeffort.nl> on 2008/02/15 12:15:39 UTC
Model update doesn't work with TabbedPanel?
Hi all,
I have two 'almost' identical situations, both are using a plain form
updating a simple Hibernate POJO. The same code is used for creating new
entities and editing existing ones.
One situation is really plain in the sense that it is just that, the other
one is that the form is wrapped in a TabbedPanel. The one without the
TabbedPanel creates and updates my models correctly, I see the changes in
the database. The one with the TabbedPanel works for creating new objects,
but when editing existing ones, the update's doesn't seem to propagate to my
models. I use a DetachableLoadableModel. I see the model load, but when the
Hibernate POJO is sent back to the persistence layer, it contains all
unmodified fields....
Do I need to take special actions when using forms inside TabbedPanels?
--
Martijn Lindhout
JointEffort IT Services
http://www.jointeffort.nl
mlindhout@jointeffort.nl
+31 (0)6 18 47 25 29
Re: Model update doesn't work with TabbedPanel?
Posted by Martijn Lindhout <ml...@jointeffort.nl>.
ok, shame on me. The two cases were not so identical as I said. This was the
problem:
The working scenario had this:
TextField naamField = new TextField("naam", new PropertyModel(getModel(), "
naam.value"));
The not working one this:
INawGegevens naw = ((IMedewerker)getModel)).getNawGegevens();
TextField voornaam = new TextField("voornamen", new PropertyModel(naw, "
voornamen.value"));
Of course the LoadableDetachableModel doesn't work anymore, because the
target of the model is the Hibernate POJO and not the LDM.
Everything works fine when I changed it to this:
TextField voornaam = new TextField("voornamen", new PropertyModel(getModel(),
"nawGegevens.voornamen.value"));
2008/2/15, Martijn Lindhout <ml...@jointeffort.nl>:
>
> Hi all,
>
> I have two 'almost' identical situations, both are using a plain form
> updating a simple Hibernate POJO. The same code is used for creating new
> entities and editing existing ones.
> One situation is really plain in the sense that it is just that, the other
> one is that the form is wrapped in a TabbedPanel. The one without the
> TabbedPanel creates and updates my models correctly, I see the changes in
> the database. The one with the TabbedPanel works for creating new objects,
> but when editing existing ones, the update's doesn't seem to propagate to my
> models. I use a DetachableLoadableModel. I see the model load, but when the
> Hibernate POJO is sent back to the persistence layer, it contains all
> unmodified fields....
>
> Do I need to take special actions when using forms inside TabbedPanels?
>
> --
> Martijn Lindhout
> JointEffort IT Services
> http://www.jointeffort.nl
> mlindhout@jointeffort.nl
> +31 (0)6 18 47 25 29
--
Martijn Lindhout
JointEffort IT Services
http://www.jointeffort.nl
mlindhout@jointeffort.nl
+31 (0)6 18 47 25 29