[jboss-user] [JBoss Seam] - Re: Seam gen edit pages, update without press save button

Delphi's Ghost do-not-reply at jboss.com
Sat Jul 7 00:43:11 EDT 2007


I've come across this problem before, and pretty much used the same solution to solve it. 

When you move from your edit page to the view page after canceling your changes, the conversation object itself is re-used, and uses the same entity manager. The entity manager contains an instance of the object you were just editing, and therefore when it 'loads' it, it just uses the version it already has which is dirty. 

Add the following to the bottom of your template : 


  | <h:outputText value="Entity Manager : #{enityManager}"/><br/>
  | <h:outputText value="Conversation : #{conversation}"/>
  | 

You can see how the same instance is used from one page to the next. 

So, I just always use explicit saveChanges() and cancelChanges() methods which either saves the changes, or refreshes the entity. Ending the conversation can be handled from the @End annotation, or within the pages.xml or the pageflow depending on the String returned from the method.

I don't use the entity home stuff, but it should work the same.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061546#4061546

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061546



More information about the jboss-user mailing list