title: How to get multiple selectonemenu value in p:ajax function and display data
body: <p>I am using primefaces and i need to show total count of applicant depending on the select box that has been choose by the candidate. As i am new to primefaces a dont now how to pass the parameter .  i am giving my code bellow. </p>
  
  <pre><code>&lt;h:panelGrid columns="2" cellspacing="4" columnClasses="control-label"&gt;
  
      &lt;h:outputText
          value="#{msg['elicense.examinationform.personal.proposeofexam']}" /&gt;
      &lt;p:selectOneMenu id="propExam" value="#{issueAdmitCardBean.examination}" 
                       converter="omnifaces.SelectItemsConverter" editable="false"
                       required="true" label="Examination Applied For" styleClass="dropdownWidth"&gt;
          &lt;f:selectItem itemLabel="---Select One---" itemValue="0" /&gt;
          &lt;f:selectItems value="#{issueAdmitCardBean.testExamNames}" var="test" itemLabel="#{test.name}" itemValue="#{test}" /&gt;
  
      &lt;/p:selectOneMenu&gt;
  
      &lt;h:outputText value="Select Degree Category :" /&gt;
      &lt;p:selectOneMenu id="degreeList"
                       value="#{issueAdmitCardBean.degree}" editable="false"
                       converter="omnifaces.SelectItemsConverter" required="true"
                       label="Please Select degree" styleClass="dropdownWidth"&gt;
          &lt;f:selectItem itemValue="" itemLabel="---Select One---" /&gt;
          &lt;f:selectItems value="#{issueAdmitCardBean.degreeNames}"
                         var="degree" itemLabel="#{degree.name}" itemValue="#{degree}" /&gt;
      &lt;/p:selectOneMenu&gt;
  
  
      &lt;h:outputText value="Center of Examination :"/&gt;
      &lt;p:selectOneMenu id="centerId" value="#{issueAdmitCardBean.center}" editable="false" 
                       converter="omnifaces.SelectItemsConverter" required="true" label="Please select Center"
                       styleClass="dropdownWidth"&gt;
          &lt;f:selectItem itemValue="" itemLabel="---Select One---"/&gt;
          &lt;f:selectItems value="#{issueAdmitCardBean.centerNames}" var="center" 
                         itemLabel="#{center.name}" itemValue="#{center}"/&gt;
          &lt;p:ajax   listener="#{issueAdmitCardBean.readVenuefromCenter(issueAdmitCardBean.center.id)}" update="venueNames"  /&gt;
          &lt;p:ajax   listener="#{issueAdmitCardBean.selectContByid(issueAdmitCardBean.center.id,issueAdmitCardBean.examname.id,issueAdmitCardBean.degree.id)}" update="venueNames"  /&gt;
      &lt;/p:selectOneMenu&gt;
  
  
      &lt;h:outputText value="Total No. of Candidates Under this Category :"/&gt;
      &lt;h:outputText value="#{issueAdmitCardBean.getTotalNoofCandidates}"/&gt;
  </code></pre>
  
  <p>plz help me to solve it. Thanks in advance.</p>
  
  <p>There is a problem for me. i have using my ajax button at the last selectone menu button. but i have to change it as if a change a value in my first selectone menu my ajax should work. my problem is if am using same method here i will get null pointer exception. please help me how can i change it.</p>