0 Replies Latest reply on Jun 29, 2009 8:38 PM by Josh Long

    three instances of a4j seem to be causing a javascript error

    Josh Long Newbie

      three instances of a4j seem to be causing a javascript error in IE6 / 7 / 8

      I'm running a Seam application using RichFaces. The page itself is pretty tame, and its producing an error in IE6/7/8. the error is very strange:

      Message: Expected ')'
      Line: 1
      Char: 189
      Code: 0
      URI: http://blach/blah//blah.html?cid=1023


      the javascript it's pointing to is generated by a4j:jsFunction. there are only 3 instances, which i reproduce here
      
      <a4j:jsFunction name="reRenderFiles"
       reRender="filesList,newFilesList,#{reRenderOnSelect}"
       ajaxSingle="true" eventsQueue="queue" />
      
       <a4j:jsFunction name="handleUploadCompletion" rendered="#{selectable}"
       reRender="filesList,newFilesList,#{reRenderOnSelect}"
       ajaxSingle="true" eventsQueue="queue"
       oncomplete="handleUploadComplete()" />
      
       <a4j:jsFunction name="handleUploadCompletion" rendered="#{not selectable}"
       reRender="filesList,newFilesList"
       ajaxSingle="true" eventsQueue="queue"
       oncomplete="unlockScreen()" />


      the only way to get the error to go away (and in so doing break the functionality) is to remove one of the a4j:jsFunction components.

      for example, if I remove:
      <a4j:jsFunction name="reRenderFiles"
      reRender="filesList,newFilesList,#{reRenderOnSelect}"
      ajaxSingle="true" eventsQueue="queue" />
      

      it works, though it doesnt seem to matter which I remove, so long as I do. I wondered if this strangeness might be due to cached versions of my class files in Eclipse or tomcat, but nothing seem to fix it except removing a a4j:jsFunction component.

      Any ideas? Any way of controlling the output of the JS so that it produces super clean, non IE-offensive code? Naturally, it works perfectly in Safari/Chrome/Firefox.

      Im a little stuck and any input on what stone to turn would be appreciated.

      Thanks,
      Josh