title: How to use PrimeFaces SelectOneMenu ItemLabel & ItemValue with Lists?
body: <p>As far as im aware the correct way to display information in a SelectOneMenu is by having a list of objects and using it's properties like so:</p>
  
  <pre><code>&lt;p:selectOneMenu id="player" value=""&gt;  
      &lt;f:selectItem itemLabel="Select" itemValue="" /&gt;  
      &lt;f:selectItems value="#{players}"
         var="player"
         itemLabel="#{player.name}"
         itemValue="#{player.id}"/&gt; 
  &lt;/p:selectOneMenu&gt; 
  </code></pre>
  
  <p>but what if I dont have a list of players, what if I have something like this? I'd like to get it to work like this:</p>
  
  <pre><code>//PlayerManager
  public List&lt;String&gt; getPlayerNames() {
      String[] names = new String[] {"player1", "player2"};
      return Arrays.asList(names);
  }
  
  public List&lt;String&gt; getPlayerIds() {
     String[] ids = new String[] {"1", "2"};
     return Arrays.asList(ids);
  }
  
  &lt;p:selectOneMenu id="player" value=""&gt;  
      &lt;f:selectItem itemLabel="Select" itemValue="" /&gt;  
      &lt;f:selectItems value="#{playerManager.playerNames}"
         var="player"
         itemLabel="#{playerManager.playerNames}"
         itemValue="#{playerManager.playerIds}"/&gt; 
  &lt;/p:selectOneMenu&gt; 
  </code></pre>