Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    TileGrid invalidateCache

    Using data in example isomorphic/system/reference/SmartClient_Explorer.html#tilingFilter,

    Build v8.2p_2013-03-26/PowerEdition Development Only (built 2013-03-26)

    Run the testcase (I used Firefox 12 to test). Select "Endangered Status" as "Not Endangered" - the tile grid list will update. Click on "TEST FETCH". You'll see the list will update to the original data. Repeat the steps but instead of clicking TEST FETCH, click on TEST INVALIDATE. You'll notice the list does not update to the original - is invalidateCache supported for tilegrid? Seems to work for listgrids but I can't get my tilegrid to re-fetch unless I call fetchData.

    Code:
    isc.VStack.create({
        width:500,
        membersMargin:20,
        members:[
    
            isc.TileGrid.create({
                autoDraw:false,
                ID:"boundList",
                tileWidth:150,
                tileHeight:205,
                height:400,
                showAllRecords:true,
                dataSource:"animals",
                autoFetchData:true,
                animateTileChange:true,
                fields: [
                    {name:"picture"},
                    {name:"commonName", cellStyle: "commonName"},
                    {name:"lifeSpan", formatCellValue: "return 'Lifespan: ' + value;"},
                    {   name:"status", 
                        getCellStyle: function (value, field, record, viewer) {
                            if (value == "Endangered") return "endangered";
                            else if (value == "Threatened") return "threatened";
                            else if (value == "Not Endangered") return "notEndangered";
                            else return viewer.cellStyle;
                        }
                    }
                    
                ]            
            }),
    
            isc.DynamicForm.create({
                autoDraw:false,
                isGroup:true,
                groupTitle:"Search",
                ID:"boundForm",
                numCols:"6",
                dataSource:"animals",
                autoFocus:false,
                fields: [  
                    {name:"commonName"},
                    {name:"lifeSpan" , title: "Max Life Span", editorType: "slider",
                        minValue:1, maxValue:60, defaultValue:60, height:50,
                        operator: "lessThan"
                    },
                    {name:"status", operator: "equals", allowEmptyValue: true, emptyDisplayValue: "(Any)"}
    
                ],
                itemChanged: "boundList.fetchData(this.getValuesAsCriteria());"
                          
                
            }),
    
            isc.DynamicForm.create({
                autoDraw:false,
                ID:"sortForm",
                isGroup:true,
                groupTitle:"Sort",
                numCols:"6",
                autoFocus:false,
                itemChanged: function(item, newValue, oldValue) {
                    var sortVal = this.getValue("sortBy");
                    var sortDir = this.getValue("chkSortDir");
                    if (sortVal) boundList.data.sortByProperty(sortVal, sortDir); 
                },
                fields: [  
                    {
                        name:"sortBy", title:"Sort by", type:"select",
                        valueMap: {
                            "commonName" : "Animal",
                            "lifeSpan" : "Life Span",
                            "status" : "Endangered Status"  
                        }
                    },
                    
                    {name:"chkSortDir", title:"Ascending", type:"checkbox"}
                ]
            }),
    
            isc.HLayout.create({
                autoDraw:false,
                membersMargin:10,
                height: 22,                               
                members:[
                    isc.IButton.create(
                        {
                            title:"Filter", 
                            click:"boundList.fetchData(boundForm.getValuesAsCriteria());", 
                            autoFit:true
                        }
                    ),
                    isc.IButton.create(
                        {
                            title:"Clear", 
                            click:"boundList.fetchData();boundForm.clearValues();sortForm.clearValues();", 
                            autoFit:true
                        }
                    )
                ]
            })
            
           
        ]
    });
    
    isc.Button.create({title:"TEST FETCH", top: 200, left: 600, click: function(){boundList.fetchData();}})
    
    isc.Button.create({title:"TEST INVALIDATE", top: 500, left: 600, click: function(){boundList.invalidateCache();}})

    #2
    Hi
    There is indeed a problem here whereby invalidateCache is failing to behave properly in the TileGrid. Expected behavior would be that the cache would be dropped and a new fetch with the current criteria would occur automatically to repopulate the visible set of tiles with data from the server.

    We've made a change to address this in 4.0d.
    We were not planning to backport to 8.2p - you should be able to work around this problem at the application level (via explicitly calling "fetchData(<existing criteria>)" again after the invalidateCache call, for example).
    Let us know if you are blocked by this and can't get the behavior you're after

    Thanks
    Isomorphic Software.

    Comment

    Working...
    X