1 Reply Latest reply on Jul 20, 2011 11:36 AM by bschoen

    rich:autocomplete ajax response updating extra fields

    bschoen Newbie

      I've got a rich:tabpanel with 2 tabs. The first tab has a rich:datatable and the second has a rich:autocomplete. If the datatable is empty the autocomplete works correctly. If I add a row to the datatable on the 1st tab the autocomplete on the 2nd tab no longer works because the ajax response from the server sends "update" data for the fields on the datatable on the first tab. Since they don't exist on the second tab I believe the javascript code that would update the client side DOM fails and the values returned for autocomplete are not displayed (they are in the response though). Below is the good response and the bad response. You can see that the bad response has 2 extra update records for fields that don't exist on the second tab. In both responses the field "firmNameTestItems" has the correct auto complete data (Firm #1, 2, 3).

       

      I created a simple sample app but could not reproduce the problem. So, my question is what could possibly cause these 2 extra fields to be added to the response?

       

      Thanks.

      Brian

       

      Good response

      <partial-response>

                <changes>

                          <update id="j_idt40"><![CDATA[<span class="rf-msgs " id="j_idt40"></span>]]></update>

                          <update id="firmNameTestItems"><![CDATA[<div id="firmNameTestItems"><div>Firm #1</div><div >Firm #2</div><div>Firm #3</div></div>]]></update>

                          <update id="javax.faces.ViewState"><![CDATA[-2822055726067556619:94066021895601045]]></update>

                </changes>

                <extension id="org.richfaces.extension">

                          <complete>new

                                    RichFaces.ui.Message(&quot;j_idt40&quot;,{&quot;isMessages&quot;:true}

                                    );</complete>

                          <componentData>{&quot;firmNameTest&quot;:[&quot;Firm

                                    #1&quot;,&quot;Firm #2&quot;,&quot;Firm #3&quot;] } </componentData>

                </extension>

      </partial-response>

       

      Bad Response (erroneous update lines highlighted)

       

      <partial-response>

                <changes>

                          <update id="j_idt40"><![CDATA[<span class="rf-msgs " id="j_idt40"></span>]]></update>

                          <update id="j_idt61:aliasesList:0:j_idt88"><![CDATA[<span class="rf-msg " id="j_idt61:aliasesList:0:j_idt88"></span>]]></update>

                          <update id="j_idt61:aliasesList:0:j_idt90"><![CDATA[<span class="rf-msg " id="j_idt61:aliasesList:0:j_idt90"></span>]]></update>

                          <update id="firmNameTestItems"><![CDATA[<div id="firmNameTestItems"><div>Firm #1</div><div>Firm #2</div><div>Firm #3</div></div>]]></update>

                          <update id="javax.faces.ViewState"><![CDATA[-2822055726067556619:-8533082731141467620]]></update>

                </changes>

                <extension id="org.richfaces.extension">

                          <complete>new

                                    RichFaces.ui.Message(&quot;j_idt40&quot;,{&quot;isMessages&quot;:true}

                                    );new

                                    RichFaces.ui.Message(&quot;j_idt61:aliasesList:0:j_idt88&quot;,{&quot;forComponentId&quot;:&quot;j_idt61:aliasesList:0:varAliasFirstName&quot;,&quot;showSummary&quot;:false,&quot;showDetail&quot;:true}

                                    );new

                                    RichFaces.ui.Message(&quot;j_idt61:aliasesList:0:j_idt90&quot;,{&quot;forComponentId&quot;:&quot;j_idt61:aliasesList:0:varAliasLastName&quot;,&quot;showSummary&quot;:false,&quot;showDetail&quot;:true}

                                    );</complete>

                          <componentData>{&quot;firmNameTest&quot;:[&quot;Firm

                                    #1&quot;,&quot;Firm #2&quot;,&quot;Firm #3&quot;] } </componentData>

                </extension>

      </partial-response>