[jboss-user] [JBoss Seam] - Re: Data disappeared when clicking on Conversation outjectio

gus888 do-not-reply at jboss.com
Thu Jan 10 00:08:18 EST 2008


"jacob.orshalick" wrote : Without some code (the view, the navigation, etc), I don't think anyone is going to be able to help here...
Thank you, Jacob. Following are my code snippets:pages.xml
  | <page view-id="*">
  | 	<navigation>
  | 		<rule if-outcome="emailList">
  | 			<redirect view-id="/emails.xhtml"/>
  | 		</rule>
  | 		<rule if-outcome="phoneList">
  | 			<redirect view-id="/phones.xhtml"/>
  | 		</rule>
  | 		....
  | 
  | sidebar.xhtml
  | 	<div>
  | 		<ice:commandLink value="Contact Emails"
  | 				action="#{contactServicer.retrieveEmails}"/>
  | 	</div>
  | 
  | 	<div>
  | 		<ice:commandLink value="Contact Phones"
  | 				action="#{contactServicer.retrievePhones}"/>
  | 	</div>
  | 	...
  | 
  | emails.xhtml
  | 	<ice:panelSeries style="clear: both;"
  | 			value="#{emailList}"
  | 			var="email" rendered="#{!empty emailList}">
  | 		<div class="row">
  | 			<ice:outputText value="#{email.emailAddress}"/>
  | 		</div>
  | 		....
  | 
  | phones.xhtml
  | 	<ice:panelSeries style="clear: both;"
  | 			value="#{phoneList}"
  | 			var="phone" rendered="#{!empty phoneList}">
  | 		<div class="row">
  | 			<ice:outputText value="#{phone.phoneNumber}"/>
  | 		</div>
  | 		....
  | 
  | @Name("contactServicer")
  | @Stateless
  | @Scope(ScopeType.STATELESS)
  | public class ContactServicerBean implements ContactServicer {
  | 
  | 
  | 	@Out(required=false, scope=ScopeType.CONVERSATION) //EVENT and PAGE don't work
  | 	private List<Email> emailList;
  | 
  | 	@Out(required=false, scope=ScopeType.CONVERSATION) //EVENT and PAGE don't work
  | 	private List<Phone> phoneList;
  | 
  | 
  | 	public String retrieveEmails() {
  | 		emailList = em.createNamedQuery("...").getResultList();
  | 		return "emailList"
  | 	}
  | 
  | 	public String retrievePhones() {
  | 		phoneList = em.createNamedQuery("...").getResultList();
  | 		return "phoneList";
  | 	}
  | 
  | 	....
  | }
  | 
"jacob.orshalick" wrote : If you outject to the conversation, you must begin a long-running conversation to have the data available on the next request (the next click of a commandLink).  Otherwise, the temporary conversation will be destroyed and your data is gone on the next request.I don't know which pattern is good for enterprise project based on my codes above. Seam wiki pagination sample is using Stateless bean + Event outjection, but I couldn't make this work.

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

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



More information about the jboss-user mailing list