0 Replies Latest reply on Mar 11, 2008 9:36 AM by marco.angheben

    Richfaces: javascript error using Richfaces on Jboss Portal

    marco.angheben

      While running on Jboss Portal 2.6.4 a portlet that uses some components from Richfaces 3.1.4 (e.g. the third example of tabPanel from the following link http://livedemo.exadel.com/richfaces-demo/richfaces/tabPanel.jsf;jsessionid=51F7BD8948E0D7702FDDBFA4F9215239?c=tabPanel or a simple a4j:commandButton), I get the following javascript error: "anchor has no properties".
      This error causes the javascript event "oncomplete" defined on the commandButton to not be runned.
      As workaround I changed the file org.ajax4jsf.javascript.scripts.AJAX.js under richfaces-impl-3.1.4.GA.jar, placing a try-catch block that incapsulate the code throwing the Javascript exception as following:

      try{
       var inputs = anchor.getElementsByTagName("input");
       var newinputs = req.getElementsByTagName("input",idsSpan);
       A4J.AJAX.replaceViewState(inputs,newinputs);
       // For any cases, new state can be in uppercase element
       newinputs = req.getElementsByTagName("INPUT",idsSpan);
       A4J.AJAX.replaceViewState(inputs,newinputs);
      }
      catch(e) {
       /* inputs undefined, no action */
      }


      Maybe it could be useful to open a new bug on it and to plan the fixing in the future releases.