Details
Description
I'm building unit tests for my Tapestry application using HtmlUnit (and Rhino to handle the JavaScript). When submitting a form with "required" validation set up for a Select component I get the following exception:
org.mozilla.javascript.EcmaError: TypeError: Cannot read property "length" from null
...stack trace goes here...
I tracked it down to line number 109 in form.js:
line 105:Tapestry.require_field = function(event, fieldId, message)
line 106:
I changed the function to the following:
Tapestry.require_field = function(event, fieldId, message)
{
var field = this.find(fieldId);
if (field.type == "select-one" || field.type== "select-multiple")
else
{ if (field.value.length == 0) event.invalid_field(field, message); }}
This resolves the issue for my scenario.