2 Replies Latest reply on Dec 22, 2009 12:43 AM by kragoth

    Nested conversation and usage of the same bean.

    idyoshin

      Good day community.


      I've started to use nested conversation for better user performance. almost every navigation is running from nested conversations, so user can find the whole trac to the page from the starting view.  And that performs well, as I can imagine.


      But I faced out one problem. In some cases I have the tree-like structure in database i.e. foreign key on the same table... And definitly I'm using entityHome superclass for that application using CONVERSATION scope.


      the problem appears when user need to create the element and the parent element for it.


      user originally enters the edit page, where it has the link for the same view with nested conversation (for editing parent element). when user saves the parent object and returns to the parent conversation via seam-breadcrumb the entityHome is working with the parent object, not the newly created object (as in the starting view). So in nested conversation the same entityHome is used :(


      Can someone help me with handling this stuff: i.e. how to use the same POJO in nested conversations with.


      Regards,


      Ilya Dyoshin.

        • 1. Re: Nested conversation and usage of the same bean.
          idyoshin

          Sorry for my bad english..


          Ilya Dyoshin

          • 2. Re: Nested conversation and usage of the same bean.
            kragoth

            What you are trying to do is not fully supported. Well, at least according to the last doco I read.


            There is an annotation @PerNestedConversation that can be used to allow nested conversations to contain individual instances of Seam beans. However, according to the java doc on the class it is not recommended that applications use this feature.


            In otherwords. In this scenario you are going to have to not create a nested conversation, but rather create a brand new conversation and do your work in there. Unfortunately the out of box features of Seam do not really work well for applications that have this scenario.


            I spent a fair bit of time experimenting with various navigation models for Seam apps. All of which have some serious draw backs.


            If you are only just getting started on the navigation stuff I would recommend building your own navigation framework to make this side of things a lot easier to build and maintain.


            If you would like to see how I've done this I have written a fairly long explanation in this thread here. http://www.seamframework.org/Community/CrazyIdeaProgrammaticNavigationStaticOrDynamic


            And I'm following up a current issue with my design on this thread http://www.seamframework.org/Community/EndingNestedNaturalConversations


            One day I really really should actually write my own thread for this instead of tagging onto the end of other people's :P