title: Enums as dropdown list in Primefaces
body: <p>I am also trying the same to get the City codes which are defined in the enum "CityCodes.java" which is my enum class where I have the definition as below:</p>
  
  <pre><code>public enum Cities {
  
  AL("Alabama","1"),
  AK("Alaska","2"),
          .......
  WY("Wyoming","51");
  
    ---------------------------------------------------   
    ******** My managed bean definition*************
    ---------------------------------------------------
  
  public class CityCodes {                                    
       public Cities[] getCityCodes(){
       return Cities.values();
  }   
  </code></pre>
  
  <p>I have the same defined in config.faces.xml</p>
  
  <pre><code>&lt;managed-bean&gt;
  &lt;managed-bean-name&gt;cityCodes&lt;/managed-bean-name&gt;
  &lt;managed-bean-class&gt;com.web.form.CityCodes&lt;/managed-bean-class&gt;
  &lt;managed-bean-scope&gt;session&lt;/managed-bean-scope&gt;
  &lt;/managed-bean&gt;
  </code></pre>
  
  <p>While calling the same in my UI I have the code as below</p>
  
  <pre><code>&lt;h:outputText value="#{msg.stateName}" /&gt;
  &lt;p:selectOneMenu value="#{addressForm.stateCode}"&gt;
    &lt;f:selectItems itemLabel="#{cityCodes.getCityCodes}" /&gt;
  &lt;/p:selectOneMenu&gt;
  </code></pre>
  
  <p>When I run the build and deploy the app....I don't get any error also I don't get the dropdown populated with the State Codes.</p>