4 Replies Latest reply on Dec 12, 2006 11:10 PM by smokingapipe

    DataModelSelection and master-detail pages

    smokingapipe

      Here's the simple situation: I have a first page, which shows a table, using a DataModel. In the session bean that has the DataModel, there is also a @DataModelSelection element.

      What I want to do is have links in the table, on Page 1, which then set the DataModelSelection element AND bring the user to another page where the details of that object can be viewed.

      I have tried doing this in various ways and it seems like the DataModelSelection is always null on the second page.

      Any suggestions on this? This should be possible to do, right? I'm trying to use a link like this, within the table:

      <s:link view="/admin/details.jsp" value="Details"/>

      and the DataModelSelection always appears to be null on the details page.

        • 1. Re: DataModelSelection and master-detail pages
          pmuir

          Are you in / starting a conversation?

          • 2. Re: DataModelSelection and master-detail pages
            gavin.king

            What does the renderd HTML for the link look like?

            • 3. Re: DataModelSelection and master-detail pages
              smokingapipe

              So I think that's the problem. I think what's happening is that I am having my session beans take the default scope, which is conversation. But the problem is that in this case, they are being used in temporary conversations, which means that the session bean is being disposed of at the end of the request. I need to make these conversations into real conversations that persist for as long as the user is doing stuff. That's what I need to figure out here.

              • 4. Re: DataModelSelection and master-detail pages
                smokingapipe

                Ok, now it is making sense. I had to have a @Begin method, which then took the DataModelSelection and put it into another variable which is outjected. The @Begin makes the conversation long-lasting instead of temporary, and then the object is outjected and can be accessed. So that's very cool, it now works.

                I'm also now using the Seam-managed persistence context. Hopefully that will stop any LIEs from showing up. I'll find out soon.

                This temporary conversation thing wasn't obvoius to me, and neither was the SMPC, because SMPC is only really talked about in detail in Chapter 9 of the Seam docs. But that's ok, now I'm figuring out how to make it all work.