4 Replies Latest reply on Jan 21, 2008 2:44 PM by Alexander Smirnov

    A4J.AJAX.processResponse failing with

    Mike Hanafey Newbie

      I have a simple AJAX update that works okay in 3.1.3, but fails in 3.1.4 (no update occurs). An error is reported for A4J.AJAX.processResponse in the following region:

      if( options.affected ) {
      1484 req.appendNewHeadElements();
      1485 for ( var k =0; k < options.affected.length ; k++ ) {
      1486 LOG.debug("Update page part from call parameter for ID " + options.affected[k]);
      1487 req.updatePagePart(options.affected[k], k==childs.length-1);
      1488 };
      1489

      The error is reported as "childs has no properties", and Firebug shows that "childs" is undefined.

      My code is attempting to do an AJAX update on a "h:selectOneMenu" component based on the input in an "h:inputText" component. The Facelets view looks as follows:

      <ui:component id="#{id}">
       <h:inputText id="#{id}Frag" value="#{nameAjax.nameFrag}" size="8" title="#{nameAjax.nameFragTitle}">
       <a4j:support event="onkeyup" reRender="#{id}Name,#{reRender}" ajaxSingle="true" immediate="true" limitToList="true" focus="#{id}Frag"/>
       </h:inputText>
      
       <h:selectBooleanCheckbox value="#{nameAjax.nameFragRestrictive}" title="#{nameAjax.nameFragRestrictiveTitle}">
       <a4j:support event="onclick" reRender="#{id}Name,#{reRender}" ajaxSingle="true" immediate="true" limitToList="true" focus="#{id}Frag"/>
       </h:selectBooleanCheckbox>
      
       <h:selectOneMenu id="#{id}Name" value="#{nameAjax.name}" style="#{nameAjax.matchingStyle}" required="#{empty required ? true : required}"
       requiredMessage="Enter some text to populate the list -- value required.">
       <a4j:support event="onchange" reRender="#{reRender}" ajaxSingle="true" immediate="true" rendered="#{!empty reRender}"
       limitToList="true" focus="#{id}Frag"/>
       <f:selectItems value="#{nameAjax.matchingItems}"/>
       </h:selectOneMenu>
       <rich:message for="#{id}Name"/>
      </ui:component>
      


      (when this component is invoked #{reRender} is null, and so only the #{id}Name id should be re-rendered.