Yup, that should do it. Maps make great beans when you're too lazy to
actually write a new bean. :) Especially Wicket's ValueMap.

On 7/11/05, frank bengtsson <[EMAIL PROTECTED]> wrote:
> This is nice, does this means that both models are automatically updated  ?
> 
> So "onsubmit" all i have do is something like this ?
> customerDAO.saveOrUpdate(((Map) getModelObject()).get("customer"));
> 
> Thanx in advance !
> 
> /Frank
> 
> On Monday 11 July 2005 19:54, Phil Kulak wrote:
> > Oh sure, not a problem.
> >
> > Say you have two models that you want one form to manipulate. You
> > could have them both as one model like so:
> >
> > Customer customer = ...
> > Producet product = ..
> >
> > Map modelMap = new TreeMap(2);
> > modelMap.put("customer", customer);
> > modelMap.put("product", product);
> > IModel model = new Model(modelMap);
> >
> > add(new DetailForm("detailForm", model, feedback));
> >
> > The trick that makes this work is that OGNL will treat a map of
> > objects like a bean with a getter and setter for each object. So, to
> > reference the customer's name, would be "customer.name".
> >
> > Hope that helps.
> >
> > -Phil
> >
> > On 7/11/05, frank bengtsson <[EMAIL PROTECTED]> wrote:
> > > my first day with wicket so please explain it in a bit more detailed
> > > way...
> > >
> > > Page:
> > > add(new DetailForm("detailForm", model, feedback));
> > >
> > > where du you want to put the map ?
> > >
> > >
> > > /Frank B.
> > >
> > > On Monday 11 July 2005 19:31, Phil Kulak wrote:
> > > > You could just throw them in a map.
> > > >
> > > > -Phil
> > > >
> > > > On 7/11/05, frank bengtsson <[EMAIL PROTECTED]> wrote:
> > > > > Hi all,
> > > > >
> > > > > Scenario 1:
> > > > >
> > > > > I have TWO POJO's(models) from backend(Hibernate). I need to display
> > > > > both on ONE form on a page. But i can only give ONE model in
> > > > > constructor to the form ?
> > > > >
> > > > > Does this mean i have to make a new model, which inlcudes both POJO's
> > > > > ? or have one of the POJO's in constructor and the other ?
> > > > >
> > > > > As i understand these models, they should eliminate the typical
> > > > > transfer from domain objects to the form(ala Struts etc.) ???
> > > > >
> > > > > All the examples(library etc) i have seen so far "Happens" to have
> > > > > ONE model that fill the needs to what needs to be displayed...so an
> > > > > example(or explanation/help) would be greatly appreciated :)
> > > > >
> > > > > Best regards,
> > > > > Frank
> > > > > --
> > > > > Frank Kastell Bengtsson
> > > > > Kastell
> > > > >
> > > > >
> > > > > -------------------------------------------------------
> > > > > This SF.Net email is sponsored by the 'Do More With Dual!' webinar
> > > > > happening July 14 at 8am PDT/11am EDT. We invite you to explore the
> > > > > latest in dual core and dual graphics technology at this free one
> > > > > hour event hosted by HP, AMD, and NVIDIA.  To register visit
> > > > > http://www.hp.com/go/dualwebinar
> > > > > _______________________________________________
> > > > > Wicket-user mailing list
> > > > > [email protected]
> > > > > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > >
> > > > -------------------------------------------------------
> > > > This SF.Net email is sponsored by the 'Do More With Dual!' webinar
> > > > happening July 14 at 8am PDT/11am EDT. We invite you to explore the
> > > > latest in dual core and dual graphics technology at this free one hour
> > > > event hosted by HP, AMD, and NVIDIA.  To register visit
> > > > http://www.hp.com/go/dualwebinar
> > > > _______________________________________________
> > > > Wicket-user mailing list
> > > > [email protected]
> > > > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > >
> > > --
> > > Frank Kastell Bengtsson
> > > Kastell
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by the 'Do More With Dual!' webinar
> > > happening July 14 at 8am PDT/11am EDT. We invite you to explore the
> > > latest in dual core and dual graphics technology at this free one hour
> > > event hosted by HP, AMD, and NVIDIA.  To register visit
> > > http://www.hp.com/go/dualwebinar
> > > _______________________________________________
> > > Wicket-user mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by the 'Do More With Dual!' webinar
> > happening July 14 at 8am PDT/11am EDT. We invite you to explore the latest
> > in dual core and dual graphics technology at this free one hour event
> > hosted by HP, AMD, and NVIDIA.  To register visit
> > http://www.hp.com/go/dualwebinar
> > _______________________________________________
> > Wicket-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> 
> --
> Frank Kastell Bengtsson
> Kastell
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
> July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> core and dual graphics technology at this free one hour event hosted by HP,
> AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to