2 Replies Latest reply on Oct 13, 2009 9:14 PM by valerio de minico

    problem using @Factory

    valerio de minico Newbie

      I have problem using @Factory and @DataModel annotations.
      I'd want to load a data list into a selectOneMenu widget. Action code is:

      public class RegioneAction {
           RegioneService regioneService;
           Log logger;
           List<Regione> regioni=null;
           public void retrieveAllRegioni()
                logger.debug("Executing Factory method");
                regioni = regioneService.retrieveAllRegione();
              public List<Regione> getRegioni()
                return this.regioni;
           public void setRegioni(List<Regione> reg)

      Instead the xhtml code is:

      <h:selectOneMenu id="regione" value="#{regione}" require="true">
                               <s:selectItems value="#{regioneAction.regioni}" var="reg" label="#{reg.nome}"/>

      The Factory method is never invoked and so the selectItems receives a null argument object for regioneAction.regioni.

      Which could be the solution?