title: How to load second selectOneMenu on change of first selectOneMenu?
body: <p>I have 2 <code>&lt;h:selectOneMenu&gt;</code> components and one of them depends of the selection of the other. When you select one value of the first menu component, then the second changes with the event of <code>onchange="submit()"</code> and <code>valueChangeListener="#{Usuario.cmbDatos_action}"</code> of the first menu:</p>
  
  <pre><code>&lt;h:selectOneMenu id="cmbCombo" binding="#{Usuario.cmbDatos}" value="#{Usuario.id}" 
      onchange="submit()" valueChangeListener="#{Usuario.cmbDatos_action}"&gt;
      &lt;f:selectItems value="#{beanCombos.datos}"&gt;&lt;/f:selectItems&gt;
  &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p>It is like Countries and Cities of the selected Country. The first menu is loaded as follows:</p>
  
  <pre><code>@ManagedBean
  @RequestScoped
  public class BeanCombos {
  
      private List&lt;SelectItem&gt; Datos;
  
      public BeanCombos() {
          try {
              clsConexion objConexion = new clsConexion();
              String strSQL = "SELECT * FROM Usuarios";            
              objConexion.ResultSetSQL = objConexion.EjecutarConsulta(strSQL);
              Datos = new ArrayList&lt;SelectItem&gt;();
  
              while (objConexion.ResultSetSQL.next()) {
                  Usuario objUsuario = new Usuario();                
                  objUsuario.setId(String.valueOf(objConexion.ResultSetSQL.getInt("Codigo")));
                  objUsuario.setNombre(objConexion.ResultSetSQL.getString("Nombres").toUpperCase());
                  Datos.add(new SelectItem(objUsuario.getId(), objUsuario.getNombre()));
              }
          } catch(Exception ex) {
              String strError = ex.getMessage().toString();            
          }
      }
  
      public List&lt;SelectItem&gt; getDatos() {
          return Datos;
      }
  }
  </code></pre>
  
  <p>But when I select one value of the first menu I don't know how load the next menu. I've tried it as follows:</p>
  
  <pre><code>public String cmbDatos_action() {
      try {
          int intValor = Integer.parseInt(cmbDatos.getValue().toString());
      } catch(Exception ex) {
  
      }
  
      return null;
  }
  </code></pre>
  
  <p>In what part of method <code>cmbDatos_action()</code> can I put the code to load the second menu?</p>