2 Replies Latest reply on Nov 3, 2006 2:30 AM by Louis Coetzee

    EL enhancement with Enums

    Louis Coetzee Apprentice

      Hi,

      we would like to use the EL enhancement which would allow us to send a Enum param back. allLanguagesManager is an arraylist containing all the enums:

      <t:dataList value="#{allLanguagesManager}" var="currentLanguage"
       rendered="#{not empty allLanguagesManager}" id="dt1">
       <h:column id="col">
       <li>
       <s:link action="#{userEnvironment.setLanguage(currentLanguage)}" >
       <h:outputText id="lang" value="#{currentLanguage}"
       converter="languageconverter" />
       </s:link>
       </li>
      
       </h:column>
       </t:dataList>


      userEnvironment is a POJO with a public method:
      public void setLanguage(LanguageEnum language) {
      
       if (null == language) logger.info("oops language is null");
       logger.info("language class is of type" + language.getClass().toString());
       logger.info("setting the language in userEnvironment");
      
      .
      .
      

      For some reason the language param is null when the method gets invoked by Seam. If I change things around to send a literal string (and changing the pojo method) the literal is passed on to the method.

      Any suggestions ?

      Thanks

      L