3 Replies Latest reply on Jan 14, 2008 6:31 AM by Thorsten Kunz

    test enum values in EL expressions

    Thorsten Kunz Novice

      I know its not exactly Seam related but maybe somebody did it before and can point me in the right direction:

      I have a public enum with a few values used in an Entity to keep states.

      @Name("someEntity")
      @Entity
      public class SomeEntity {
      
       public enum SomeState { OPEN, CLOSED, LOCKED, DELETED }
      
       public SomeState someState = SomeState.OPEN;
      
       [...]
      
      }
      


      Now I'd like to test the state in an EL expression like this
      <h:inputText rendered="#{someEntity.someState eq 'OPEN'}" />
      

      But it does not work and after trying a few different variations I am not sure if I am on the right way here. Am I missing something?

      Thanks