10 Replies Latest reply on Feb 10, 2010 8:07 AM by ssilvert

    JavaScript Error when clicking on element in <rich:extendedDataTable>

       

      Hi I am hoping someone has run into this or can offer some helpful suggestion,

       

      In My JSFUnit test clicking on a row element of an extended data table is causing the following error to occur.

       

       

      EcmaError: lineNumber=[10181] column=[0] lineSource=[null] name=[TypeError] sourceName=[http://localhost:9088/pmmt/xhtml/a4j/g/3_3_2.SR1/org/richfaces/ui.pack.js] message=[TypeError: Cannot call method "equals" of undefined (http://localhost:9088/pmmt/xhtml/a4j/g/3_3_2.SR1/org/richfaces/ui.pack.js#10181)]

      com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method "equals" of undefined (http://localhost:9088/pmmt/xhtml/a4j/g/3_3_2.SR1/org/richfaces/ui.pack.js#10181)

      at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:534)

       

      Here is the Scenario:

       

      I have 2 <rich:extendedDataTables> on my JSF page. When I click on a row in Table A, The data is refreshed in Table B to show detail line items for the row which was just selected in Table A.  I am accomplishing this using a4j support tag on table A and setting the rerender attribute to the ID of Table B. Clicking a row on table B then causes a seperate area of the page to display some summary data.

       

      This all works fine in an actual browser IE 7 or Fire 3.  but not in JSFUnit. When I try to do this in my JSFUnit test I get the javaScript error.

       

      So I noticed that I can click on a row in Table A in my test with no problem. Interesting to note that table A is not rerendered by any other component the way Table B is. I also confirmed that if I remove the remove the ID for Table B from the rerender attribute of the A4J support tag on Table A and just render the table data independantly (Just dummied up some data to try this out) Then I can click on Table B row with no problem.

       

      The issue appears to be that if a given rich:extendedDataTables Id is on a list of Id's to be rerendered, then Rich faces sets up the component as a target area to be rerendered by an ajax call and for whatever reason  HTMLUnit cannot handle the clicked event properly.

       

      I have attached the stack trace for additional information and I am currently  using release 3.3.2 SR1  of Rich Faces and HTMLUnit 2.5