1 Reply Latest reply on Jul 21, 2010 1:13 AM by keven

    Conversation in portial submit

    keven

      Hi, everyone ,


      I have an issue with conversation scoped-data that I want to access from two different Seam components. The use-case is quite simple: In one class a DTO object is outjected to the conversation context. In the other class this DTO object should be injected. However, the injected data always happens to be null.


      In my understanding that should not be a problem, the two classes both access the same (conversation) context. However, it looks like they don't. Now I am wondering how to form a conversation? How can the DTO object in the two different classes reference the object in the same Conversation context?


      Here's the relevant code:




      Class trying to inject the data:
      @Name("fileTransferCheckAction")
      @Scope(ScopeType.EVENT)
      public class CpfFileTransferCheckAction implements {
          @In(required=true, scope = ScopeType.SESSION)
          @Out(required=false, scope = ScopeType.SESSION)
          private CpfFileTransferDTO fileTransDto;
      
          public void serverKindChange(final ValueChangeEvent event) {
              // here the fileTransDto will be used
          }
      }



      @Name("editScenarioAction")
      @Scope(ScopeType.SESSION)
      public class CpfFileTransferEditScenarioAction CpfScdlIF {
          @In(required = false, scope = ScopeType.SESSION)
          @Out(required = false, scope = ScopeType.SESSION)
          private CpfFileTransferDTO fileTransDto;
      
          public String  fileTransInit() {
              // here fileTransDto will be instantiate
          }
      }


      In the pages.xml,




      <?xml version="1.0" encoding="UTF-8"?>
      <pages xmlns="http://jboss.com/products/seam/pages"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://jboss.com/products/seam/pages 
      http://jboss.com/products/seam/pages-2.1.xsd">
      
      <page action="#{editScenarioAction.fileTransInit}" 
      view-id="/pages/cpf/filetransfer/fileTransfer.xhtml"/>
      </pages>






      In the fileTransfer.xhtml, fileTransferCheckAction is used as the actionListener. We used ICEFaces tag ice:selecOneMenu



      <ice:selectOneMenu id="fltr_srv1type_select"          
          value="#{fileTransDto.serverLeft.serverKind}"
          style="width:170px;"
          disabled="#{fileTransDto.serverLeft.serverKindListDisabled}"
          valueChangeListener="#{fileTransferCheckAction.serverKindChange}"
          partialSubmit="true">
           <f:selectItems value="#{fileTransDto.serverLeft.serverKindList}"/>
      </ice:selectOneMenu>





      Is there any recommended way how to deal with the problem?
      Thanks in advance,
      Keven






        • 1. Re: Conversation in portial submit
          keven

          I can put the fileTransDto object in the session context, then the null problem will be solved. But i don't think it's a good solution. Anyone happened get the same problem before?
          And how was it solved?Thanks.