Hi all,

I have a "Dataset" class which generates a table of hidden HTMLInput Nodes. I am getting a weird problem where if one of my other classes tries to add a row as follows:

myDataSet.addRow(["firstValue", "secondValue"]);
Then the first value isn't set and so the HTMLInput which is generated has a null value. If I, instead, try to add a row using the same code in the console, it works perfectly.
I then looked at my source for the Dataset class and set a breakpoint just as it creates the input node (context to follow).

addRow: function(data) {
        if($type(data) != "array") {
            return false;

        var index = this.counter;
        var set = new Element("fieldset");
        this.sets[index] = set;
        this.nodes[index] = [];
        this.fields.each(function(field, order) {
            if(field.ignore) { return; }
            var node = new Element("input", {
                "type":     "hidden",
                "name":     field.name.replace("__index__", index),
                "value":    ( (field.sync) ? ( (field.isIndex) ? index : data[order] ) : null )
            this.nodes[index][order] = node;
        }, this);
        return index;
I set my breakpoint where it says "set.adopt(node)". I tried (in the console):
... returned "firstValue" as I expected it would. I then stored the node in "window['testNode']" and tried
at which point I got a null value. This is really weird, no?

Anyone with any good ideas? I suppose I should add that I'm using Mootools.