-
1. Re: Nested conversation for master-detail implementation
luxspes Feb 6, 2009 7:37 PM (in response to lukebk)If this is for CRUD I recommend you to avoid nested Conversations completely, go for modalPanels, and please vote for JBSEAM-3903.
Conversations (specially nested ones) I have found are not really suited for CRUD, but they are really good for stuff that is pretty much read-only
-
2. Re: Nested conversation for master-detail implementation
marios Feb 9, 2009 10:59 AM (in response to lukebk)Thanks for the links: I've read them all and before giving any hope up, I'd like to submit this "simplified example" to the community:
1. I show the list.
2. I select an item: @Begin
[The master pages open and the CID is shown on the URL]
<s:link value="View Entity" action="#{list.showEntity}"/>@Name(\"list\") public class EntityList { @Begin public void showEntity(){ } }
3. I click on "Add child": @Begin( nested = true )
<h:commandLink action="#{parent.child}">Go to child</h:commandLink>@Name(\"parent\") @Scope(ScopeType.CONVERSATION) public class Parent { @Begin(nested \= true) public String child(){ return \"child\"; } @End(root \= true) public String die(){ return \"/home.xhtml\"; } @End(beforeRedirect\=true) public String endNested(){ return \"/parent.xhtml\"; } }
[The child form is shown, SEAM recognizes the master CID and the nested conversation CID ]
4. I press back on the child form
<s:button value="Back to parent" action="#{parent.endNested}"/>[The nested conversation is killed but instead of returning to the old parent conversation, a new one is created (with long running = false)]
If I manually change the URL in order to point to the previous parent CID, I get my entity back, so I'm pretty lost: is this a bug or some kind of wanted behavior for nested conversations?!?
Thanks
-
3. Re: Nested conversation for master-detail implementation
lukebk Feb 11, 2009 9:41 AM (in response to lukebk)Looking for more infos in the forum I've found that someone else had the
same problem and it (seems) should be a bug:However I've found a little
work around
that should works for now:
In the child element I've recovered the parent's conversation idpid = Conversation.instance().getParentId();
Then when I press
back
button I pass this param trought pages.xml<rule if-outcome="back"> <redirect view-id="/entity/parent.xhtml" > <param name="cid" value="#{childHome.pid}"/> </redirect> </rule>
I hope this could help someone else...
Bye,
Luca