title: Dependent p:selectOneMenu Population of values
body: <p>I am using JSF 2.0 with Primefaces 3.4.2</p>
  
  <p>I have two <code>p:selectOneMenu</code>, first one parent and second child, based on parent value, child component gets populated.</p>
  
  <p>Parent <code>p:selectOneMenu</code></p>
  
  <pre><code>&lt;p:selectOneMenu id="empl" value="#{empMB.employee}"&gt;
  &lt;f:selectItems value="#{empMB.employeeList}" var="emp"
  itemLabel="#{emp.employeeName}" itemValue="#{emp.employeeNumber}"/&gt;     
                          &lt;p:ajax update="department"  /&gt;                      
                      &lt;/p:selectOneMenu&gt;
  </code></pre>
  
  <p>Child <code>p:selectOneMenu</code></p>
  
  <pre><code>&lt;p:selectOneMenu id="department" value="#{deptMB.department}"&gt;
  &lt;f:selectItems value="#{deptMB.loadDepartments(&lt;??&gt;)}" var="dept"
  itemLabel="#{dept.departmentName}" itemValue="#{dept.departmentCode}"/&gt;
                  &lt;/p:selectOneMenu&gt;
  </code></pre>
  
  <p>I have a method in department ManagedBean called loadDepartments with one argument</p>
  
  <pre><code>public void loadDepartments(String employeeNumber)
  </code></pre>
  
  <p>How can I pass value to loadDepartments in child component so that it will load all the departments based on the code selected in parent component?</p>
  
  <p>If I am substituting  <code>#{deptMB.loadDepartments(empMB.employee.employeeCode)}</code> I am getting</p>
  
  <pre><code>Error Parsing: #{deptMB.loadDepartments({empMB.employee.employeeCode})} 
  </code></pre>
  
  <p>Any help is highly appreciable?</p>