title: two rich:ajax conflict problems (in 3 rich:select controls)
body: <p>I have 3 rich:select controls which have id select1, select2, select3.I want to click on select1, control “select2” will be rendered, and when I click on control select2, select3 will be rendered, like this. I made my application by netbeans 7.0.1, and use framework jsf 2.0, and richFaces 4.2.0. </p>
  
  <p>My solution is to create two a4j:ajax which have id ajax1 and ajax2, to assign the render of select2 and select3 base on select1 and select2 selectItem event. I have arranged ajax1 and ajax2 in a queue which have id queue1.</p>
  
  <p>Here is the code of the page:</p>
  
  <pre><code>&lt;h:form&gt;
      &lt;a4j:queue name="queue1"  onerror="window.alert('alert in queue');" onrequestdequeue="window.alert('queue1 dequeue');" onrequestqueue="window.alert('queue1 enqueue');" requestDelay="1000" ignoreDupResponses="true"/&gt;
       &lt;h3 style="text-align: center"&gt;Test case 1: 3 selection controls problem&lt;/h3&gt;
  
       &lt;br/&gt;&lt;br/&gt;
      &lt;h:outputLink value="../index.xhtml"&gt;View Index &lt;/h:outputLink&gt;
      &lt;br/&gt;&lt;br/&gt;
       Problem: &lt;h:outputText escape="false" value="#{carBean.testDescription}"/&gt;
      &lt;br/&gt;&lt;br/&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;Car Firm (selection1)&lt;/td&gt;
              &lt;td&gt;Car type (selection2)&lt;/td&gt;
              &lt;td&gt;Production (selection3)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
          &lt;rich:select id="select1" value="#{carBean.companyName}" maxListHeight="100"  enableManualInput="true"  defaultLabel="Type here"&gt;      
              &lt;a4j:ajax id="ajax1" queueId="queue1" execute="@form" render="select2, errorText" event="selectitem"  listener="#{carBean.changeCompanyEvent()}"&gt;
  
              &lt;/a4j:ajax&gt;                                
              &lt;f:selectItems value="#{carBean.lstCompany}"&gt;&lt;/f:selectItems&gt;
          &lt;/rich:select&gt;
          &lt;/td&gt;
          &lt;td&gt;
          &lt;rich:select id="select2" value="#{carBean.typeName}"  maxListHeight="100"  enableManualInput="true" defaultLabel="Type here"  &gt;      
              &lt;a4j:ajax id="ajax2" queueId="queue1"  immediate="true"  execute="@form" render="select3, errorText" event="selectitem"  listener="#{carBean.changeCarTypeEvent()}"&gt;
  
              &lt;/a4j:ajax&gt;                                
              &lt;f:selectItems value="#{carBean.lstCarType}"&gt;&lt;/f:selectItems&gt;
          &lt;/rich:select&gt;
          &lt;/td&gt;
          &lt;td&gt;
          &lt;rich:select id="select3" value="#{carBean.productionName}" 
                       maxListHeight="100"  enableManualInput="true" defaultLabel="Type here"  &gt;                                              
              &lt;f:selectItems  value="#{carBean.lstCarProduction}"&gt;&lt;/f:selectItems&gt;
          &lt;/rich:select&gt;
          &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
      &lt;br/&gt;&lt;br/&gt;
      &lt;h:outputText id="errorText" escape="false" value="#{carBean.alertError}"/&gt;
  
  &lt;/h:form&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>Problems encountered: I have 2 problems that I still not found reasons yet:</p>
  
  <ul>
  <li>The select2 has to set immediate = true, otherwise the event defined in ajax2 will not done.</li>
  </ul>
  
  <p>I don’t know what cause this.</p>
  
  <ul>
  <li>When I set immediate = true for select2, the ajax2 event was called. But the typeName variable, which is assigned as value of select2 control, still not assigned a value is selected, so select3 has not been assigned a value yet.</li>
  </ul>
  
  <p>Here is the error images: <a href="http://i970.photobucket.com/albums/ae190/swenteiger7/richFaces%20error-%20110312/testcase1Error.png" rel="nofollow">http://i970.photobucket.com/albums/ae190/swenteiger7/richFaces%20error-%20110312/testcase1Error.png</a></p>
  
  <p><strong>Application</strong>: I also sent my application project (opened by net beans IDE) to get along with this question. You can concentrate in 3 items:
  -   The faces-config.xml file in Web/Web-INF folder, which defined CarBean managed Bean
  -   The testcase1 folder in web folder (which have threeSelectExample.xhtml).
  -   The beans package and utils package to save managed bean (in testcase1 we concens in CarBean managed Bean).</p>
  
  <p>You can download my archive project in my attach file. Please add JSF2.0 and richFaces framework to run application (https://community.jboss.org/wiki/HowToAddRichFaces4xToProjectsNotBasedOnMaven)</p>
  
  <p>Here is my application: <a href="http://www.mediafire.com/?fnab3824b8vwd93" rel="nofollow">http://www.mediafire.com/?fnab3824b8vwd93</a></p>
  
  <p>If you have some problem to download, please contact me. Thank you.</p>