3 Replies Latest reply on Apr 21, 2007 3:25 PM by pmuir

    Seems to be a bug

    konikoni

      Environment jboss as 4.2.0CR2, seam 1.2.1 cvs today.

      Value of selectOneMenu will not be set:

      1.

       @In(required=false)
       @Out(required=false)
       private Kfz kfz;
      
      @DataModel
       private List<Kfz> bearbkfzList;
      
       @Begin(join=true)
       public String searchKfz(){
      
       currentPage=0;
       if ( ! bid.equals("") ){
       try{
       lid = Long.parseLong(bid);
       }catch(NumberFormatException ex){
       facesMessages.add("FNr ist keine Ziffer!");
       return "null";
       }
       }else{
       lid = 0L;
       }
       updateResults();
       if ((bearbkfzList == null) || (bearbkfzList.isEmpty()) ){
       facesMessages.add("Keine Treffer");
       return "null";
       }
      
       return "/kfzresultbearb";
       }
      

      2.From kfzresultbearb

      @DataModelSelection("bearbkfzList")
       Kfz selectedKfz;
      
       public String editKfz() {
       kfz = selectedKfz;
       return "/editkfz";
       }
      



      Than to follow view


      <h:form>
       <rich:panel>
       <h:panelGroup id="frms">
       <h:panelGrid columns="2">
       <h:outputText value="FNr: "/> <h:outputText value="#{kfz.id}"/>
       </h:panelGrid>
       <h:panelGrid columns="3">
       <h:outputText value="Fabrikat: "/>
       <h:panelGroup style="display:block">
       <a4j:region renderRegionOnly="false">
       <h:selectOneMenu id="hrs23" value="#{kfz.hersteller}" required="true">
       <s:convertEntity />
       <s:selectItems value="#{hListe.resultList}" var="her" label="#{her.bezeichnung}" noSelectionLabel="Bitte waehlen..." />
       <a4j:support event="onchange"
       reRender="modelsel" />
       </h:selectOneMenu>
      
       </a4j:region>
       </h:panelGroup>
       <h:message for="hrs23" />



      <framework:entity-query name="hListe" ejbql="select h from Hersteller h" />





      All take place in a session statefull bean

        • 1. Re: Seems to be a bug
          pmuir

          No error messages? What you are doing is very close to the ui example - so take a look at that to :) You'll probably find it easier to get it working with a4j support, then add that in later.

          • 2. Re: Seems to be a bug
            konikoni

            thanks for answer,

            you don't understand me, sorry for my terriblly english!

            the functions work fine,

            after update seam with occurs on the side the values of selectOneMenus are not set,

            Items are in but <h:selectOneMenu id="hrs23" value="#{kfz.hersteller}" required="true">

            default value "value="#{kfz.herteller}"" is not set.

            if i add to the Page h:outputText value="#{kfz.herteller.bezeichung}"/> this string is shown.

            Logs are clear and no errro messages.


            -----------------------------------------------------------------

            Ajax4j and functionalities work fine, this is not the problem.

            • 3. Re: Seems to be a bug
              pmuir

              Again, I'd point you at the ui example. Things to look at - is the the value from #{kfz.herteller} .equals() to the value that should be selected in the list. Remember you need to be in a conversation (or use ID equality)