6 Replies Latest reply on Sep 6, 2011 6:42 AM by hantsy

    How to use Conversation in Seam 3...

    hantsy

      I used a Conversation scoped bean to process add/edit action...The problem is


      1. If validation failed, the input values are missing(restored to the default, add is empty and 'edit' is the unchanged), in the Seam 2 application, all like these worked well.
      Where is wrong


      2. I used Richfaces 4.0.0.Final, and I wanted to use a popupPanel to update the some content(added some areacode in the cityEdit page), the field values in the popupPanel were not updated.


      3. When the validation was failed in the popupPanel, it did not stop to close popupPanel(closed the popupPanel)...and when I opened the popupPanel again, it highlight the field label and input field...why the validation was delayed...



      
      @Stateful
      @ConversationScoped
      @Named("cityEdit")
      public class CityEditAction {
           
           //private static final org.slf4j.Logger logger=LoggerFactory.getLogger(CityEditAction.class);
      
           @PersistenceContext()
           EntityManager em;
      
           @Inject
           Logger log;
      
           private City currentCity;
      
           private String areaCode;
      
           @Inject
           private Event<City> citySavedEventSrc;
      
           @Inject
           Messages messages;
      
           public City getCurrentCity() {
                return currentCity;
           }
      
           public void setCurrentCity(City currentCity) {
                this.currentCity = currentCity;
           }
      
      
           public String getAreaCode() {
                return areaCode;
           }
      
           public void setAreaCode(String areaCode) {
                this.areaCode = areaCode;
           }
      
           @PostConstruct
           public void init() {
                if (log.isDebugEnabled()) {
                     log.debug("call init...");
                }
           }
      
           @Begin
           public void initAdd() {
                if (log.isDebugEnabled()) {
                     log.debug("call initAdd...");
                }
                this.currentCity = new City();
           }
      
           @Begin
           public void initEdit(City city) {
                if (log.isDebugEnabled()) {
                     log.debug("call initEdit...@" + city);
                }
                this.currentCity = em.merge(city);
           }
      
           public void saveAreaCode() {
                if (log.isDebugEnabled()) {
                     log.debug("call saveAreaCode...");
                     log.debug("areacode @"+this.areaCode);
                }
                
                //logger.debug("areacode @"+this.areaCode);
      
                this.currentCity.addAreaCode(new CityAreaCode(this.areaCode));
           }
      
           public void initAddAreaCode() {
                if (log.isDebugEnabled()) {
                     log.debug("call initAddAreaCode...");
                }
                this.areaCode ="";
           }
      
           public void deleteAreaCode(CityAreaCode c) {
                if (log.isDebugEnabled()) {
                     log.debug("call initAddAreaCode...");
                }
                this.currentCity.removeAreaCode(c);
           }
      
           @End
           public void save() {
                if (log.isDebugEnabled()) {
                     log.debug("call save...");
                }
      
                if (this.currentCity.getId() == null) {
                     em.persist(this.currentCity);
                } else {
                     this.currentCity = em.merge(this.currentCity);
                }
                
                System.out.print("@current city @"+this.currentCity);
                this.citySavedEventSrc.fire(this.currentCity);
           }
      
           public void onSaved(
                     @Observes(during = TransactionPhase.AFTER_SUCCESS) City city) {
                messages.info(new DefaultBundleKey("city_saved"))
                          .defaults("City saved").params(city.getName());
           }
      
           @End
           public void cancel() {
                if (log.isDebugEnabled()) {
                     log.debug("call end...");
                }
                em.clear();
           }
      }
      
      
      




      CityEdit.xhtml



           <ui:define name="content">
                <div class="section">
                     <h1>#{cityEdit.currentCity.id==null?'Add City':'Edit City'}</h1>
                     <a4j:outputPanel id="editPane">
                          <h:form id="editForm">
      
                               <fieldset>
                                    <p:input id="cityCountry" label="#{messages['City.Country']}"
                                         required="true">
                                         <h:selectOneMenu value="#{cityEdit.currentCity.country}"
                                              style="width:200px" required="true">
                                              <f:selectItems value="#{countries}" var="c"
                                                   itemLabel="#{c.name}" />
                                              <f:validateRequired />
                                              <f:converter converterId="countryConverter" />
                                         </h:selectOneMenu>
                                    </p:input>
                                    <p:input id="cityName" label="#{messages['City.Name']}"
                                         required="true">
                                         <h:inputText id="input" value="#{cityEdit.currentCity.name}"
                                              style="width:200px">
                                              <f:validateRequired />
                                         </h:inputText>
                                    </p:input>
                                    <p:output id="cityAreaCodeOP" label="#{messages['City.AreaCode']}"
                                         verbatim="true">
                                         <a4j:outputPanel id="areaCodeField">
                                              <ui:repeat var="a" value="#{cityEdit.currentCity.areaCodes}"
                                                   varStatus="s">
                                                   #{a.areaCode}
                                                   <a4j:commandLink styleClass="no-decor" render="areaCodeField"
                                                        execute="@this" action="#{cityEdit.deleteAreaCode(a)}"
                                                        immediate="true"
                                                        onclick="if(confirm('#{messages['Confirmation.Delete']}')){return true;}">
                                                        <h:graphicImage value="/images/icons/delete.gif"
                                                             alt="Delete areacode" />
                                                   </a4j:commandLink>
                                                   <ui:fragment
                                                        rendered="#{not empty cityEdit.currentCity.areaCodes and s.index!=fn:length(cityEdit.currentCity.areaCodes)-1}">
                                                             ,
                                                   </ui:fragment>
      
                                              </ui:repeat>
                                              #{' '}
                                              <h:graphicImage value="/images/icons/new.gif" alt="new areacode" />
                                              <a4j:commandLink styleClass="no-decor"
                                                   render="areaCodeFormInputs" execute="@this"
                                                   actionListener="#{cityEdit.initAddAreaCode}"
                                                   oncomplete="#{rich:component('newAreaCodePane')}.show();">
                                                   <h:outputText value="#{messages['Link.AddAreaCode']}" />
                                              </a4j:commandLink>
                                         </a4j:outputPanel>
                                    </p:output>
      
                                    <div class="buttonBox">
                                         <h:commandButton id="save" value="#{messages['Buttons.Save']}"
                                              action="#{cityEdit.save}" />
                                         #{' or '}
                                         <h:commandLink value="#{messages['Buttons.Cancel']}"
                                              action="#{cityEdit.cancel}" immediate="true" />
                                    </div>
                               </fieldset>
      
      
      
                               <rich:popupPanel id="newAreaCodePane" autosized="true"
                                    resizeable="false" model="true" width="480" height="180">
                                    <f:facet name="header">
                                    #{messages['City.Title.AddCityAreaCode']}
                                    </f:facet>
      
                                    <a4j:outputPanel id="areaCodeFormInputs" layout="block">
      
                                         <p:input id="cityAreaCode" label="#{messages['City.AreaCode']}"
                                              required="true">
                                              <h:inputText id="input" value="#{cityEdit.areaCode}"
                                                   required="true">
                                              </h:inputText>
                                         </p:input>
      
                                         <div class="buttonBox">
                                              <a4j:commandButton id="saveAreaCode"
                                                   value="#{messages['Buttons.Save']}"
                                                   action="#{cityEdit.saveAreaCode}"
                                                   render="editForm:cityAreaCodeOP:areaCodeField, areaCodeFormInputs"
                                                   execute="newAreaCodePane"
                                                   oncomplete="if (#{facesContext.maximumSeverity==null}) {#{rich:component('newAreaCodePane')}.hide();}" />
                                              #{' or '}
                                              <a4j:commandLink value="#{messages['Buttons.Cancel']}"
                                                   onclick="#{rich:component('newAreaCodePane')}.hide(); return false;" />
                                         </div>
                                    </a4j:outputPanel>
                               </rich:popupPanel>
                          </h:form>
                     </a4j:outputPanel>
                </div>
           </ui:define>
      

        • 1. Re: How to use Conversation in Seam 3...
          hantsy

          Any help is appreciated.

          • 2. Re: How to use Conversation in Seam 3...
            hantsy

            I really do not understand the Seam 3 converstation(3.1.0.Beta2)... I modified the PortEditAction code(in fact I copied the code form Seam Booking)...


            @Stateful
            @ConversationScoped
            @Named("portEdit")
            public class PortEditAction {
            
                 @PersistenceContext(type = PersistenceContextType.EXTENDED)
                 EntityManager em;
            
                 // @Inject
                 private static final Logger log = Logger.getLogger(PortEditAction.class);
            
                 private Port currentPort;
            
                 @Inject
                 private Event<Port> portSavedEventSrc;
            
                 @Inject
                 Messages messages;
            
                 public Port getCurrentPort() {
                      return currentPort;
                 }
            
                 public void setCurrentPort(Port currentPort) {
                      this.currentPort = currentPort;
                 }
            
                 // @Begin()
                 public void initAdd() {
                      if (log.isDebugEnabled()) {
                           log.debug("call init...");
                      }
            
                      this.currentPort = new Port();
            
                 }
            
                 // @Begin
                 public void initEdit(Port port) {
                      if (log.isDebugEnabled()) {
                           log.debug("call initEdit...@" + port);
                      }
                      this.currentPort = port;
                 }
            
                 @Begin
                 public void select(Long _portId) {
                      if (log.isDebugEnabled()) {
                           log.debug("call select...@" + _portId);
                      }
                      if (_portId != null) {
                           this.currentPort = em.find(Port.class, _portId);
                      } else {
                           this.currentPort = new Port();
                      }
                 }
            
                 @End
                 public void save() {
                      if (log.isDebugEnabled()) {
                           log.debug("call save...");
                      }
            
                      if (this.currentPort.getId() == null) {
                           em.persist(this.currentPort);
                      } else {
                           this.currentPort = em.merge(this.currentPort);
                      }
            
                      this.portSavedEventSrc.fire(this.currentPort);
                 }
            
                 public void onSaved(
                           @Observes(during = TransactionPhase.AFTER_SUCCESS) Port port) {
                      messages.info(new DefaultBundleKey("port_saved"))
                                .defaults("Port saved").params(port.getName());
                 }
            
                 @End
                 public void cancel() {
                      if (log.isDebugEnabled()) {
                           log.debug("call end...");
                      }
            
                 }
            }
            
            





            And I got the exception.



            javax.faces.el.EvaluationException: javax.ejb.EJBException: Found extended persistence context in SFSB invocation call stack but that cannot be used because the transaction already has a transactional context associated with it.  This can be avoided by changing application code, either eliminate the extended persistence context or the transactional context.  See JPA spec 2.0 section 7.6.3.1.  Scoped persistence unit name=siorc.war#siorcPU, persistence context already in transaction =org.hibernate.ejb.EntityManagerImpl@113bd2d, extended persistence context =ExtendedEntityManager [siorc.war#siorcPU]
                 at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
                 at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
                 at javax.faces.component.UICommand.broadcast(UICommand.java:315)
                 at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787)
                 at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)
                 at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
                 at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
                 at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
                 at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
                 at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:118)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
                 at org.jboss.seam.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
                 at org.jboss.seam.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:72)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
                 at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139)
                 at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57)
                 at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:49)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
                 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667)
                 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952)
                 at java.lang.Thread.run(Thread.java:662)
            Caused by: javax.ejb.EJBException: Found extended persistence context in SFSB invocation call stack but that cannot be used because the transaction already has a transactional context associated with it.  This can be avoided by changing application code, either eliminate the extended persistence context or the transactional context.  See JPA spec 2.0 section 7.6.3.1.  Scoped persistence unit name=siorc.war#siorcPU, persistence context already in transaction =org.hibernate.ejb.EntityManagerImpl@113bd2d, extended persistence context =ExtendedEntityManager [siorc.war#siorcPU]
                 at org.jboss.as.jpa.container.ExtendedEntityManager.getEntityManager(ExtendedEntityManager.java:88)
                 at org.jboss.as.jpa.container.AbstractEntityManager.merge(AbstractEntityManager.java:560)
                 at com.telopsys.siorc.addressee.PortEditAction.save(PortEditAction.java:90)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:597)
                 at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:51)
                 at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
                 at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370)
                 at org.jboss.as.weld.ejb.DelegatingInterceptorInvocationContext.proceed(DelegatingInterceptorInvocationContext.java:80)
                 at org.jboss.seam.faces.context.conversation.ConversationBoundaryInterceptor.around(ConversationBoundaryInterceptor.java:61)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:597)
                 at org.jboss.interceptor.proxy.InterceptorInvocation$InterceptorMethodInvocation.invoke(InterceptorInvocation.java:72)
                 at org.jboss.interceptor.proxy.SimpleInterceptionChain.invokeNextInterceptor(SimpleInterceptionChain.java:82)
                 at org.jboss.weld.bean.InterceptorImpl.intercept(InterceptorImpl.java:98)
                 at org.jboss.as.weld.ejb.DelegatingInterceptorInvocationContext.proceed(DelegatingInterceptorInvocationContext.java:70)
                 at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.delegateInterception(Jsr299BindingsInterceptor.java:99)
                 at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:112)
                 at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:122)
                 at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
                 at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
                 at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
                 at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:45)
                 at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
                 at org.jboss.as.ejb3.component.stateful.StatefulSessionSynchronizationInterceptor.processInvocation(StatefulSessionSynchronizationInterceptor.java:132)
                 at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
                 at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)
                 at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
                 at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
                 at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
                 at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
                 at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
                 at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
                 at org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)
                 at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
                 at org.jboss.as.jpa.interceptor.SFSBInvocationInterceptor.processInvocation(SFSBInvocationInterceptor.java:58)
                 at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
                 at org.jboss.as.ejb3.component.stateful.StatefulComponentInstanceInterceptor.processInvocation(StatefulComponentInstanceInterceptor.java:61)
                 at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
                 at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor$CustomSessionInvocationContext.proceed(SessionInvocationContextInterceptor.java:126)
                 at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:233)
                 at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:363)
                 at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:219)
                 at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:35)
                 at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
                 at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor.processInvocation(SessionInvocationContextInterceptor.java:71)
                 at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
                 at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
                 at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:146)
                 at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
                 at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
                 at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:76)
                 at com.telopsys.siorc.addressee.PortEditAction$$$view33.save(Unknown Source)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:597)
                 at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
                 at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
                 at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
                 at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
                 at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:125)
                 at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:62)
                 at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125)
                 at com.telopsys.siorc.addressee.PortEditAction$Proxy$_$$_Weld$Proxy$.save(PortEditAction$Proxy$_$$_Weld$Proxy$.java)
                 at com.telopsys.siorc.addressee.PortEditAction$Proxy$_$$_WeldClientProxy.save(PortEditAction$Proxy$_$$_WeldClientProxy.java)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:597)
                 at org.apache.el.parser.AstValue.invoke(AstValue.java:196)
                 at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                 at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43)
                 at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:56)
                 at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
                 at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
                 ... 35 more
            

            • 3. Re: How to use Conversation in Seam 3...
              shane.bryzak

              Where are the @Begin and @End annotations that you're using in your code coming from?  It seems like you're not promoting your conversation to long-running, you need to inject the Conversation object like so:




              @Inject Conversation conversation;





              Once you do that, you can call conversation.begin() and conversation.end() at the places where you want to begin and end the conversation.

              • 4. Re: How to use Conversation in Seam 3...
                shane.bryzak

                I should add, that just in case you're using the new conversation annotations from the Seam Faces module (the ones that haven't even been released or documented yet), then you probably haven't enabled ConversationBoundaryInterceptor in your beans.xml.

                • 5. Re: How to use Conversation in Seam 3...
                  hantsy

                  it is enabled...



                       <interceptors>
                            <class>org.jboss.seam.faces.context.conversation.ConversationBoundaryInterceptor</class>
                       </interceptors>
                  
                  

                  • 6. Re: How to use Conversation in Seam 3...
                    hantsy

                    it seems use the manual way is more stable...I removed the Extened type attribute on the @PersistenceContext


                    but the three problems are still there...


                    1. If validation failed, the input values are missing(restored to the default, add is empty and 'edit' is the unchanged one), in the Seam 2 application, all like these worked well. Where was wrong?
                    
                    2. I used Richfaces 4.0.0.Final, and I wanted to use a popupPanel to update the some content(added some areacode in the cityEdit page), the field values in the popupPanel were not updated(empty string in the areaCode in the example).
                    
                    3. When the validation was failed in the popupPanel, it did not stop to close popupPanel(closed the popupPanel)...and when I opened the popupPanel again, it highlight the field label and input field...why the validation was delayed...