0 Replies Latest reply on Jun 2, 2013 7:54 PM by Ray Yan

    ExtendedDataTable first selectionChange event has no ViewSateParam

    Ray Yan Newbie

      View has two forms:

       

      <h:form id="tableForm" >

           <rich:extendedDataTable id="transactions_table" var="transaction"

             value="#{backBean.transactions}" rowKeyVar="row"

             selection="#{backBean.selection}"

             selectionMode="multipleKeyboardFree">

             <a4j:ajax event="selectionchange"

             listener="#{backBean.selectionListener}"

             render="transactions_selection"/>

      ...

           </rich:extendedDataTable>

      <a4j:outputPanel id="transactions_selection">

      <h:outputText value="Selected Transactions:" />

           <ui:repeat var="selectedTransaction"

           value="#{backBean.selectedTransactions}">

                <h:outputText value="#{selectedTransaction}" />

          </ui:repeat>

      </a4j:outputPanel>

      </form>

       

      <h:form id="calculationForm" >

           <rich:extendedDataTable id="calculation_table" var="transaction"

             value="#{backBean.transactions}" rowKeyVar="row"

             selection="#{backBean.candidates}"

             selectionMode="multipleKeyboardFree">

             <a4j:ajax event="selectionchange"

             listener="#{backBean.calculate}"

             render="transactions_calculation"/>

      ...


           </rich:extendedDataTable>

      <a4j:outputPanel id="transactions_calculation">

           <ui:repeat var="calculated"

           value="#{backBean.calculatedTransactions}">

                <h:outputText value="#{calculated.value}" />

          </ui:repeat>

      </a4j:outputPanel>

      </form>

       

      AJAX Request snapshot while clicked on the first form:


      1. Request URL:http://localhost:8080/test/extendedTable.jsf?cid=3
      2. Request Method:POST
      3. Status Code:200 OK
      4. Request Headersview source
        1. Accept:*/*
        2. Accept-Encoding:gzip,deflate,sdch
        3. Accept-Language:en-US,en;q=0.8
        4. Connection:keep-alive
        5. Content-Length:498
        6. Content-type:application/x-www-form-urlencoded;charset=UTF-8
        7. Cookie:JSESSIONID=FrpZQZyiFGJ8o3nAHeLRvuqT.undefined
        8. Faces-Request:partial/ajax
        9. Host:localhost:8080
        10. Origin:http://localhost:8080
        11. Referer:http://localhost:8080/test/extendedTable.jsf
        12. User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36
      5. Query String Parametersview sourceview URL encoded
        1. cid:3
      6. Form Dataview sourceview URL encoded
        1. tableForm:tableForm
        2. tableForm:transactions_table:wi:
        3. tableForm:transactions_table:si:0,0|0||
        4. javax.faces.source:tableForm:transactions_table
        5. javax.faces.partial.event:click
        6. javax.faces.partial.execute:tableForm:transactions_table @component
        7. javax.faces.partial.render:@component
        8. javax.faces.behavior.event:selectionchange
        9. org.richfaces.ajax.component:tableForm:transactions_table
        10. rfExt:null
        11. AJAX:EVENTS_COUNT:1
        12. javax.faces.partial.ajax:true
      7. Response Headersview source
        1. Cache-Control:no-cache
        2. Content-Length:1542
        3. Content-Type:text/xml;charset=UTF-8
        4. Date:Sun, 02 Jun 2013 23:10:37 GMT
        5. Server:Apache-Coyote/1.1
        6. X-Powered-By:JSF/2.0

      There's no ViewStateParam in the form data, thus the JSF container skipped phases between restore view and render view.

      Inspected the source code, an hidden input:

      <input type="hidden" name="javax.faces.ViewState" value="4111543473815811212:-808789590399750244">

      injected inside the form after the first click.

       

      Don't know why the first AJAX request has no view state.  In the page, two forms are populated, doe this effect the AJAX view state?