You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by fernandospr <fe...@gmail.com> on 2011/03/19 15:44:09 UTC

Edit page and LDM

Hi,

I need to build an edit page.

I saw:
https://cwiki.apache.org/WICKET/using-detachable-models-in-edit-pages.html
and
http://www.theserverside.com/news/1363828/Introducing-Apache-Wicket (Edit
Contact part)

But I guess they are no longer valid as the setModel method does not exist
anymore. How is this done now?

Also, I've seen it's possible to pass an id or a model to the edit page
constructor, not sure which is the best approach.

Thanks.


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Edit-page-and-LDM-tp3389748p3389748.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Edit page and LDM

Posted by fernandospr <fe...@gmail.com>.
Thanks again Martin. 
Now suppose that in the edit page I'm filling a form for a new object binded
through the LoadableDetachableModel (I mean no id was passed to the page
constructor so LoadableDetachableModel returned a new instance). 
Now before I hit save suppose I need to add another object to the first one
by filling another form in another page. 

I guess in this situation I should pass the LoadableDetachableModel to the
second Page through the constructor, create another LoadableDetachableModel
for the second object, bind it to the form, fill it, associate the second
object with the first one and finally return to the first page passing the
first LoadableDetachModel. 

Right?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Edit-page-and-LDM-tp3389748p3390347.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Edit page and LDM

Posted by Martin Grigorov <mg...@apache.org>.
On Sat, Mar 19, 2011 at 8:15 PM, fernandospr <fe...@gmail.com> wrote:

> Thanks Martin, and what about passing directly the domain object to the
> constructor?
>
> Unless you save it as a member variable it is OK.
Just pass it to LDM's constructor and open yourself a beer ;-)


>  --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Edit-page-and-LDM-tp3389748p3390135.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Re: Edit page and LDM

Posted by fernandospr <fe...@gmail.com>.
Thanks Martin, and what about passing directly the domain object to the
constructor?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Edit-page-and-LDM-tp3389748p3390135.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Edit page and LDM

Posted by Martin Grigorov <mg...@apache.org>.
On Sat, Mar 19, 2011 at 3:44 PM, fernandospr <fe...@gmail.com> wrote:

> Hi,
>
> I need to build an edit page.
>
> I saw:
> https://cwiki.apache.org/WICKET/using-detachable-models-in-edit-pages.html
> and
> http://www.theserverside.com/news/1363828/Introducing-Apache-Wicket (Edit
> Contact part)
>
> But I guess they are no longer valid as the setModel method does not exist
> anymore. How is this done now?
>
the new name is setDefaultModel()

>
> Also, I've seen it's possible to pass an id or a model to the edit page
> constructor, not sure which is the best approach.
>
Both are fine. Just try to keep it as lightweight as possible. I.e. don't
keep references to heavy objects.

>
> Thanks.
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Edit-page-and-LDM-tp3389748p3389748.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>