Topic: 0.5 Final getFormValues Performance Bug - Fix Included

I don't know if xajax has a bug tracker I should be using for this kind of thing - anyway I can't find one!

I discovered a problem with xajax.getFormValues if it encouters a select control with lots of options (thousands). On my 3Ghz workstation when you try and use xajax.getFormValues on a form including a select control with 7000 options it takes about 45 seconds in Internet Explorer for the javascript to collect the form values before sending them to the server.

Looking at the JavaScript code I discovered that getFormValues is recursively going through all form elements - including going through all 7000 childNodes on the select control - which seems to be unnecessary as I only need the selected value to the passed back to the server.

To fix the problem I modified the _getFormValues function as follows, so that the javascript does not loop through the childNodes on select controls: = function(aFormValues, children, submitDisabledElements, prefix)
    var iLen = children.length;
    for (var i = 0; i < iLen; ++i) {
        var child = children[i];
        if (('undefined' != typeof child.childNodes) && (child.type != 'select-one') && (child.type != 'select-multiple'))
  , child.childNodes, submitDisabledElements, prefix);, child, submitDisabledElements, prefix);

I would love to see this fixed in the next version of xajax!

Oh and thanks very much to the author(s) of xajax - it has made my first adventure into the world of AJAX much easier than I thought it would be!

Re: 0.5 Final getFormValues Performance Bug - Fix Included


thanks for reporting this issue... we'll probably add this in 0.6.

btw: moved to the release testing section