logo       

[HtmlUnit] [ htmlunit-Bugs-1437899 ] HtmlUnit doesn't seem to support table: msg#00046

java.htmlunit.devel

Subject: [HtmlUnit] [ htmlunit-Bugs-1437899 ] HtmlUnit doesn't seem to support table.rows.length

Bugs item #1437899, was opened at 2006-02-24 08:13
Message generated for change (Settings changed) made by mguillem
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1437899&group_id=47038

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Matt Raible (mraible)
>Assigned to: Marc Guillemot (mguillem)
Summary: HtmlUnit doesn't seem to support table.rows.length

Initial Comment:
WebWork 2.2.1 has a validation.js script with the
following code:

function clearErrorMessages(form) {

var table = form.childNodes[1];
if( typeof table == "undefined" ) {
table = form.childNodes[0];
}

// clear out any rows with an "errorFor" attribute
var rows = table.rows;
var rowsToDelete = new Array();
if (rows == null){
return;
}

for(var i = 0; i < rows.length; i++) {
var r = rows[i];
if (r.getAttribute("errorFor")) {
rowsToDelete.push(r);
}
}

// now delete the rows
for (var i = 0; i < rowsToDelete.length; i++) {
var r = rowsToDelete[i];
table.deleteRow(r.rowIndex);
}
}

HtmlUnit bombs out on the following line:

for(var i = 0; i < rows.length; i++) {

The error is:

[invoke] 2006-02-24 00:08:18,265 WARN
com.gargoylesoftware.htmlunit.html.HtmlPage - Expected cont
ent type of text/javascript or application/x-javascript
for remotely loaded javascript element http:
//localhost:8080/appfuse-webwork/webwork/xhtml/validation.js
but got []
[clickbutton] 2006-02-24 00:08:18,750 ERROR
com.canoo.webtest.steps.request.TargetHelper - ScriptExc
eption: enclosed exception was "TypeError: Cannot read
property "length" from undefined (http://loca
lhost:8080/appfuse-webwork/webwork/xhtml/validation.js#32)"
[clickbutton] ======= EXCEPTION START ========
[clickbutton] EcmaError: lineNumber=[32] column=[0]
lineSource=[null] name=[TypeError] sourceName=[h
ttp://localhost:8080/appfuse-webwork/webwork/xhtml/validation.js]
message=[TypeError: Cannot read pr
operty "length" from undefined
(http://localhost:8080/appfuse-webwork/webwork/xhtml/validation.js#32
)]
[clickbutton]
com.gargoylesoftware.htmlunit.ScriptException:
TypeError: Cannot read property "length
" from undefined
(http://localhost:8080/appfuse-webwork/webwork/xhtml/validation.js#32)
[clickbutton] at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScript
Engine.java:307)
[clickbutton] at
com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(H
tmlPage.java:733)
[clickbutton] at
com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:164)
[clickbutton] at
com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.doClickAction(HtmlSubmitInput.
java:78)
[clickbutton] at
com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:1
20)


----------------------------------------------------------------------

>Comment By: Marc Guillemot (mguillem)
Date: 2006-03-23 08:48

Message:
Logged In: YES
user_id=402164

I close this item due to the missing feedback. Please reopen
if you have additional information.

----------------------------------------------------------------------

Comment By: Marc Guillemot (mguillem)
Date: 2006-03-15 09:04

Message:
Logged In: YES
user_id=402164

Matt, if you're interested in the resolution of the problem,
you should provide information to allow us to reproduce it.
Otherwise I will close this bug as invalid.

----------------------------------------------------------------------

Comment By: Marc Guillemot (mguillem)
Date: 2006-02-24 15:17

Message:
Logged In: YES
user_id=402164

Htmlunit correctly understands expressions like
table.rows.length.
The problem comes probably from the initialisation of the
table variable:

var table = form.childNodes[1];
if( typeof table == "undefined" ) {
table = form.childNodes[0];
}

but without the corresponding html code I can't even try to
reproduce it.
Can you provide more information?

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1437899&group_id=47038


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise