Java 1.7 / JSF 2 / JPA 2 / Hibernate 4
I have read a number of tutorial and posts about @ConversationScoped
and in all of them the message is the same: use it when you have many views for one backing bean.
However, I have a business process scenario where I have to:
The editing page is complex and have many dependencies that do not make sense to be in the listing backing bean, that's why I prefer to have two backing beans working over two different pages, but in one single business context.
Can that be achieved? What are the steps?
After some testing, I could make it to work. All I had to do was to add the cdi button parameter on my edit button. In order to make it to work, my edit button had to be something like this:
<p:commandButton title="Edit"
action="#{myMB.nextView}"
ajax="false">
<f:param name="id" value="#{bean.id}"/>
<f:param name="cid" value="#{myMB.conversation.id}"/>
</p:commandButton>