Isn't it easier to do the following?
ParentModel extends Model
{
ParentModel() {}
protected Object onGetObject(final Component component)
{
return component.getParent().getModel().getModelObject();
}
}
On 9/14/05, Johan Compagner <[EMAIL PROTECTED]> wrote:
> and why can't a new object not be deatached??
>
> If you have a detachable model with roomID is the thing you store
> if roomID is filled in then you do a query because you where editting an
> existing Room object
> if roomID == null then you just create a new Room object.
> Ofcourse if you have a multi page form then you need to store the complete
> Room object in the roomId (or what you call it then)
> So still it can be very easy the same model.
>
> And see my example if you really want to query always for the parents
> model, then just don't use the parents model directly in the propertymodels
> but a model that i described that has a reference to the parent component
> instead of a parents model. So it can be very easily done what you want.
>
>
> On 9/14/05, Ralf Ebert <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > > i never had the need to have 2 special models for new and existing
> > > objects
> > > What is then the difference?
> > > The only thing a model really does it getting the modelObject. So
> > > what you put in that can be an existing one or just a new Room()
> > > Please give a better usecase for this
> > but "getting the modelObject" could differ. An existing object can be
> > detached, so a LoadableDetachableModel could be used, while a new
> > object may not be detached and needs to be stored in the session. I
> > know this could be done with a DetachableModel itself and so it's a
> > bad usecase.
> > I'm just wondering why there is no way bind child objects and their
> > properties in exactly the same way in which normal properties are
> > bound - automatically using the id of a container in between... But
> > for me it's ok to use the PropertyModel as well, I just thought I
> > should avoid this as replacing the model is allowed...
> >
> > Regards,
> > Ralf
> >
> >
> > -------------------------------------------------------
> > SF.Net email is sponsored by:
> > Tame your development challenges with Apache's Geronimo App Server.
> Download
> > it for free - -and be entered to win a 42" plasma tv or your very own
> > Sony(tm)PSP. Click here to play:
> http://sourceforge.net/geronimo.php
> > _______________________________________________
> > Wicket-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user