Login Register

[Q] [Solved] Error on ItemFileWriteStore in IE7 only (FF3 is Ok)

I built a nested ItemFileStore structure
(where one of the attributes of an item is a FileStore itself)

And the structure passes tests Ok on FF3, however fails in IE7 with

"Microsoft JScript runtime error: Object expected"

Using SVN trunk as of 8/20/08 (I upgraded to see this was fixed somehow in the latest)

The debugger shows a problem in line

item[this._rootItemPropName]=true;

in function

function addItemAndSubItemsToArrayOfAllItems(/* Item */ anItem){

in file ItemFileReadStore.js

I think when creating the store.

I do not know if the nesting I am doing with the Store is supported or not
(but the crux of my model now depends on it heavily :-) )

Would like to ask for some assistance to see where I might be wrong.

Here is the code in its completeness (I have sample data right there)
(split into 3 pieces) otherwise it does not show here.
as far as dojo.require -- nothing much is needed except the ItemFileWriteStore

dojo.addOnLoad(function(){
       
                var typeMapForInnerIFWS=
                                {"innerIFWS":
                                        {type: dojo.data.ItemFileWriteStore,
                                              deserialize: function (myIFWS)
                                                            {   //return
                                                                    //dojo.fromJson(myIFWS);
                                                                        return new dojo.data.ItemFileWriteStore({data:myIFWS});
                                                                },
                              serialize: function (myIFWS)
                                {
                                                                        return dojo.toJson(myIFWS);
                                                                        //myIFWS;                                                               
                                                                }
                    }
                                };

var examplePageData3Things=
        {
                identifier:"did",
                label:"did",
                items:
                        [//first element in the items array
                        {
                                did:"101",
                                sameValAsOnServer: true,
                                isEnabled:true,
                                wdc:33,
                       
                                clientValue:  //hash map to match the ItemFile store
                                        {//control 1
                                            '_type':"innerIFWS",
                                                '_value':{
                                                identifier:"input",
                                                label:"input",
                                                items:[
                                                        {
                                                                input:0,
                                   
                                                                number_of_columns: 1,   
                                                                col_1:"male"
                                                        }//end of row 1
                                                ]//end of array
                                           }//end of _value attribute   
                                        },//end of client value
                                serverValue:null
                        },//end
                       
                                //next element in the array               
                        {
                       
                                did:"102",
                                sameValAsOnServer: true,
                                isEnabled:true,
                                wdc:16,//multi select
                       
                                clientValue:  //hash map to match the ItemFile store
                                        {//control 1
                                            '_type':"innerIFWS",//this will help me to serialize/deserialize
                                                '_value':{
                                                identifier:"input",
                                                label:"input",//do not know yet what it should be
                                                items:[
                                                        {
                                                                input:0,
                                         
                                                                number_of_columns: 1,   
                                                                col_1:"FR"
                                                        },//end of row 1
                                                        {
                                                                input:1,
                                         
                                                                number_of_columns: 1,   
                                                                col_1:"COL"
                                                        },//end of row 2
                                                ]
                                           }//end of _value attribute   
                                        },//end of client value
                                serverValue:null
                        },//end of control 2
                       
                        {//control 3
                                did:"103",
                                sameValAsOnServer: true,
                                isEnabled:true,
                                wdc:35,
                       
                                clientValue:  //hash map to match the ItemFile store
                                        {
                                            '_type':"innerIFWS",
                                                '_value':{
                                                identifier:"input",
                                                label:"input",
                                                items:[
                                                        {
                                                                input:0,
                                         
                                                                number_of_columns: 4,   
                                                                col_1:"100",
                                                                col_2:"5.9",
                                                                col_3:"32",
                                                                col_4:"2/2/08"
                                                        },//end of row 1
                                                        {
                                                                input:1,
                                         
                                                                number_of_columns: 4,   
                                                                col_1:"190",
                                                                col_2:"5.9",
                                                                col_3:"40",
                                                                col_4:"2/2/98" //will fix this later to be the date object
                                                        },//end of row 2
                                                ]//end of array of values for the radio box selection control      
                                           }//end of _value attribute   
                                        },//end of client value
                                serverValue:null
                        },
                ]//end of the array
                                               
        };//end of json

exampleStore=new dojo.data.ItemFileWriteStore({ data: examplePageData3Things
                                                                                                                ,
                                                                                                        typeMap:typeMapForInnerIFWS
                                                                                                       
                                                                                                });
                                                                                                  
        var controlItem={};
       
       
        exampleStore.fetchItemByIdentity({identity:"103",
                                        onItem: function (item, request)
                                                                        { controlItem=item;}
                                    }
                                   );
                                                                  
        var controlClientStore=exampleStore.getValue(controlItem,"clientValue");
       
        var grid_2nd_row_item;
       
        controlClientStore.fetchItemByIdentity(
                                        {identity:"1",
                                 onItem: function (item, request)
                                                                                         {grid_2nd_row_item=item;},
                                 onError: function(item,request)
                                                                                         {console.debug("error");}
                        }
                  );
       
        //console.dir(grid_2nd_row_item);
       
    var col_2_val=controlClientStore.getValue(grid_2nd_row_item,"col_2");       
        //console.debug(col_2_val);
       
        console.debug("row is dirty? ",controlClientStore.isDirty (grid_2nd_row_item));
        controlClientStore.setValue(grid_2nd_row_item,"col_2","7.0");   
        console.debug("row is dirty? ",controlClientStore.isDirty (grid_2nd_row_item));

Had extra commas at the end

Had extra commas at the end of last elements of the array.

IE chocked on it, and FF3 ignored it.

I should somehow incorporate a javascript lint into my system.
http://www.javascriptlint.com/online_lint.php is what I just used

are there good offline lints recommended for DOJO build environment
(so it correctly figures out all the files that need to load and class definitions/etc) ?

thank you