0 Replies Latest reply on Nov 16, 2007 7:14 AM by mschmidke

    Preferred way to implement Master/Detail selection

    mschmidke

      Hello all,

      I have to do a simple master/detail selection (just like in hotel booking example), but I am overwhelmed by the number of different possibilities I have to achieve it (use pages.xml or not, use faces-config or not and so on).

      The hotel booking example has a master page (which displays the hotel liste) and a detail page (to book a hotel).

      Navigation from master to detail is done by

      <s:link id="viewHotel" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
      


      , in other words by calling an action method which is located in the bean of the detail page, not in the bean of the master page.

      For my case, I don't like this very much, because I am not iterating over the detail objects themselves, but over a kind of composite objects, and I want to have some logic which extracts the object to display in detail from the iterated object.

      This logic, I want to place in the master page's bean because the composite objects are built an maintained in the master page, so there is no need for the detail page to know about the big objects.

      So what I want to do is to write an action method in the master view's bean which starts a conversation, creates and prepares a conversation scoped detail view's bean, and finally redirects to the detail page.

      Possibly sounds simple to experienced Seam users, but I am still a little confused.

      Where to put @Begin? On the master bean's action method? On the detail bean's @Create method?

      How to create the detail bean? It should only be created if the link is clicked, so an @In(create=true) in the master bean is not an option.

      Or shall I use pages.xml in some way? How?

      There are too many options, I am totally confused.

      Please help me ...

      Marcus.