10 Replies Latest reply on Apr 16, 2008 10:02 AM by baz

    Problem with selectOneMenu and Conversation

    baz

      Hello,


      i do have a problem which i assume to be reported in the past. But i can not find any sign of it:-(
      So here it goes again. If someone can give me a hint how to solve it or a pointer to the original problem it will be very helpful.


      This is my page.xml (a conversation is started)


      <page ...>
      
            
      
          <description>generateFieldplan</description>
      
          <begin-conversation join="true"/>
      
       [...]
      
      </page>
      
      



      This is the corresponding xhtml page with a selectOneMenu and three buttons.


      <rich:panel>
      
           <f:facet name="header">
      
                <h:outputText value="Select Accessions" />
      
           </f:facet>
      
           <h:form>
      
                <h:selectOneMenu value="#{selectEvaluation.evaluation}" id="evalselect">
      
                     <s:selectItems value="#{evaluationList}" var="eval"
      
                                    label="#{eval.evaluationId}" noSelectionLabel="Please select..." />
      
                     <s:convertEntity />
      
                     <a4j:support action="#{selectEvaluation.selectEvaluation}" event="onchange"/>
      
                               
      
                </h:selectOneMenu>
      
                <s:button value="select Standards" view="/fieldplan/html/selectStandards"/>
      
                <s:button value="select Targets" view="/fieldplan/html/selectTargets"/>
      
                <h:commandButton value="Generate Fieldplan" action="#{selectAccession.generate}"/>
      
           </h:form>
      
      </rich:panel>
      
      




      Problem is:






      when visiting the page the user can select from the menu and the selection is stored in the context. All subpages (calles with the button) are referencing the correct selected value.


      But when returning from a subpage the selectOneMenu does not show the selected value and further more there is no list to choose from:-(


      Here comes the backing bean:


      @Name("selectEvaluation")
      
      @Scope(ScopeType.CONVERSATION)
      
      public class SelectEvaluationBacking {
      
           @Logger Log log;
      
           
      
           @Out(required=false)
      
           private Evaluation evaluation;
      
      
           @Out(required=false)
      
           private Evaluation selectedEvaluation;
      
           @In EvaluationQuery evaluationQuery;
      
           
      
           @DataModel
      
           List<Evaluation> evaluationList;
      
           
      
           @Create
      
           public void initialize(){
      
                log.info("selectEvaluation created");
      
           }
      
           
      
           @Factory("evaluationList")
      
           public void initEvaluationList(){
      
                log.info("selectEvaluation created");
      
                evaluationList=evaluationQuery.getResultList();
      
           }
      
           public void selectEvaluation(){
      
                log.info("selectEvaluation: #0", evaluation);
      
                selectedEvaluation=evaluation;
      
           }
      
      [getters and setters stripped of]
      
      



      I suppose that this is not a seam problem. But perhaps someone can shed a little bit of light on this,(again?)


      Ciao,

      Carsten