title: Load primefaces tow dynamic selectOneMenu with @OneToMany relation
body: <p>I want to load tow primefaces selectOneMenu but with only one select from dataBase.</p>
  
  <p><strong>Class Country:</strong></p>
  
  <pre><code>@Entity
  @Table(name = "COUNTRY")
  public class Country implements Serializable{
  
  
  private static final long serialVersionUID = -2160543740997716714L;
  
  
  @Id
  @Column(name = "ID_COUNTRY")
  private Long idTCountry;
  
  @Column(name = "LIBELLE_COUNTRY")
  private String libelleCountry;
  
  
  @OneToMany(mappedBy="country")
    private List&lt;City&gt; Cities;
  </code></pre>
  
  <p><strong>Class City</strong></p>
  
  <pre><code>@Entity
  @Table(name = "CITY")
  public class City implements Serializable{
  
  private static final long serialVersionUID = -1617401771255693322L;
  
  @Id
  @Column(name = "ID_CITY")
  private Long idCity;
  
  @ManyToOne
  @JoinColumn(name="COUNTRY")
  private Country country;
  
  @Column(name = "LIBELLE")
  private String libelle;
  </code></pre>
  
  <p>What do I do in XHTML to load those tow selectOneMenu dynamically ?</p>
  
  <p>I did this but it didin't work:</p>
  
  <pre><code>        &lt;p:outputLabel for="country" value="Country: " /&gt;
          &lt;p:selectOneMenu id="country" value="#{countryView.selectedCountry}"  style="width:150px"&gt;
              &lt;p:ajax listener="#{countryView.onTypeChange}" update="city" /&gt;
              &lt;f:selectItems value="#{countryView.countries}" itemLabel="#{selectedType.libelleCountry}" var="selectedCountry" /&gt;
          &lt;/p:selectOneMenu&gt;
  
          &lt;p:outputLabel for="city" value="City: " /&gt;
          &lt;p:selectOneMenu id="city" value="#{countryView.selectedCity}" style="width:150px"&gt;
              &lt;f:selectItems value="#{countryView.selectedCountry.cities}" itemLabel="#{selectedCity.libelle}" var="selectedCity" itemValue="#{selectedCity}"/&gt;
          &lt;/p:selectOneMenu&gt; 
  </code></pre>
  
  <p>Can any one help me to do this Please ?</p>