3 Replies Latest reply on Feb 26, 2010 7:44 PM by dgolovin

    Code Assist and Validation of Static Methods (3.1 CR2)

    clerum

      I just upgraded to 3.1 CR2 for my seam ear project and for the first time enabled JSF and validated the syntax of my project.

       

      I got everything cleaned up except for static methods in EL

       

      for example I have

       

      a seam POJO

       

      @Name("searchTools")
      public class SearchTools
      {
         public static String getClassName(Object object)
         {
            if(object.getClass().getSimpleName().contains("$$"))
            {         
               return object.getClass().getSuperclass().getSimpleName();
            }
            else
            {
               return object.getClass().getSimpleName();
            }
         }   
      }
      
      which is called by
       <h:outputText value="Organization" rendered="#{searchTools.getClassName(result) == 'Organization'}" />
      
      This code works fine but it throws a warning "getClassName" cannot be resolved" and autocomplete doesn't work.
      This same problem happens when using seams
      <h:outputText value="#{_invoiceLineItem.dateServiceEnd.time}">
           <s:convertDateTime type="date" pattern="MM/dd/yyyy" timeZone="#{timeZone.getTimeZone('GMT')}"/>                                      
      </h:outputText>
      
      The code works fine but since getTimeZone is a static method on java.util.Timezone (timeZone is a builtin seam component)
      Any ideas? AFAIK this wasn't working in CR1 either.