1 Reply Latest reply on Jan 23, 2014 5:38 AM by Michal Petrov

    a4j stops javascript processing

    Niels Bech Nielsen Newbie

      I had some problems in my richfaces app (v 4.3.4) running on my local tomcat (7.0.42) that javascript seemed to stop processing, and I could see nothing in the console as to why.

       

      I have managed to recreate my problem using two pieces of showcase code, the capitals sorting datatable and the row highlighter (see below). Whenever I add the jquery, I get really nice background on hover, but as soon as I click on any sort header and execute the a4j:commandLink, the jquery execution seems to stop dead.

      Problem is identical in both IE and Firefox, and FireFox console is only showing:

      The Web Console logging API (console.log, console.info, console.warn, console.error) has been disabled by a script on this page.

       

      Using a4j:log I was able to find these hints, but I have no idea how to progress from here.

      warn [09:07:27.076]: richfaces.queue: ajax submit error: During update: javax.faces.ViewState not found

      debug[09:07:27.077]: richfaces.queue: Nothing to submit

      error[09:07:27.079]: Received 'error@malformedXML' event from <a id=j_idt16:table:j_idt9 ...>

      error[09:07:27.080]: [status=200] During update: javax.faces.ViewState not found

       

      Does anybody have any insight that prevails me?

       

      Regards

      /Niels

       

      Example code:

       

      <h:head>

        <style>

      .highlight {

      background-color: fuchsia;

      }

      </style>

      </h:head>

      <h:body>

      <h:form>

              <rich:dataTable value="#{capitalsBean.capitals}" var="cap" id="table" rowClass="row-align-top trarow">

                  <!-- Rich columns as in the datatable sorting showcase -->

              <rich:column sortBy="#{cap.name}" id="name" sortOrder="#{capitalsSortingBean.capitalsOrder}">
                  <f:facet name="header">
                      <a4j:commandLink value="Sort by Capital Name" render="table" action="#{capitalsSortingBean.sortByCapitals}" />
                  </f:facet>
                  <h:outputText value="#{cap.name}" />
              </rich:column>

              </rich:dataTable>

          </h:form>

       

      <rich:jQuery selector=".trarow" event="mouseover" query="jQuery(this).addClass('highlight')" />

        <rich:jQuery selector=".trarow" event="mouseout" query="jQuery(this).removeClass('highlight')" />

      </h:body>