10 Replies Latest reply on Mar 26, 2007 11:37 AM by Pete Muir

    selectOne

    Konstantin Kauz Novice

      I don's now what i do wrong:

      @Name("fahrzeugact")
      @Stateful
      public class Fahrzeug implements FahrzeugInterface {
       @DataModel
       private List<Hersteller> hrList;
      
       @DataModelSelection("hrList")
       private Hersteller selectedHer;
      
       @PersistenceContext
       private EntityManager em;
      
       @In(required=false)
       private Hersteller hersteller;
      
       @Begin(join=true)
       @Factory("hrList")
       public void getHer(){
       hrList = em.createQuery("from Hersteller where akzept = true").getResultList();
      
       }
       public void setModel(){
       System.out.println("--------------- ");
       }
      
       @End
       public void reset() {}
      
       @Destroy
       @Remove
       public void destroy() {}
      }
      
      }



       <a4j:region>
       <s:div id="frm">
       <a4j:form>
      
       <h:selectOneMenu value="#{hersteller}" required="true">
       <s:convertEntity />
       <s:selectItems value="#{hrList}" var="her" label="#{her.bezeichnung}" noSelectionLabel="Bitte waehlen..."/>
       <a4j:support event="onchange" action="#{fahrzeugact.setModel}"/>
       </h:selectOneMenu>
      
      
       </a4j:form>
       </s:div>
       </a4j:region>
      
       <a4j:region>
       <s:div id="msg"><h:messages globalOnly="false"/> </s:div>
       </a4j:region>
      



      I get i error "Invalid Value".