3.2.0

Refresh causes header area (toolbar) to be refreshed as well

Hi All,

I have a grid with a header area (topline). The header area holds an IFRAME which source is an HTML file that draws the toolbar.

The problem is that when the grid is refreshed from the XML file via oTable.refresh() the IFRAME content is also reloaded.

This causes the toolbar to flicker and also the toolbar looses its state. Can the refresh of the IFRAME be prevented when doing a oTable.refresh()

Here is the code:

var obj = new AW.UI.Grid;
var oTable= new AW.XML.Table;


obj.setHeaderText("symbol");
obj.setColumnCount(1);
obj.setCellModel(oTable);

oTable.setColumns(["ticker"]);
oTable.setURL("basic1.xml");

var b1 = new AW.HTML.DIV;
b1.setContent ("<IFRAME frameborder='0' height = '28px' width='100%' src='FormToolbar.cfm' scrolling='no' name='grdToolbar' ></iframe>");

obj.defineTemplate("toolbar", b1);
obj.setLayoutTemplate(new AW.Panels.Horizontal);
obj.setPanelTemplate(function(i){
switch(i){
case 0: return this.getToolbarTemplate();
case 1: return this.getScrollTemplate();
}
});

obj.setPanelHeight(30, 0);
document.write(obj);

oTable.request();

// create button which refreshes grid
var oBtnRefresh = new AW.UI.Button;

oBtnRefresh.setControlText('Click here to refresh');

oBtnRefresh.onClick = function(){
oTable.request();
}

document.write(oBtnRefresh);
Maurice
October 19,
You can try replacing the default oTable.response method with the one which calls grid.getRowsTemplate().refresh() instead of the full refresh.
Alex (ActiveWidgets)
October 19,
Hello Alex,

I tried redefining the response function (see code below), but this doesn't seem to work:

var obj = new AW.UI.Grid;
var oTable= new AW.XML.Table;


obj.setHeaderText("symbol");
obj.setColumnCount(1);
obj.setCellModel(oTable);

oTable.setColumns(["ticker"]);
oTable.setURL("basic1.xml");

var b1 = new AW.HTML.DIV;
b1.setContent ("<IFRAME frameborder='0' height = '28px' width='100%' src='FormToolbar.cfm' scrolling='no' name='grdToolbar' ></iframe>");

obj.defineTemplate("toolbar", b1);
obj.setLayoutTemplate(new AW.Panels.Horizontal);
obj.setPanelTemplate(function(i){
switch(i){
case 0: return this.getToolbarTemplate();
case 1: return this.getScrollTemplate();
}
});

obj.setPanelHeight(30, 0);


var _response = oTable.response;
oTable.response = function(xml)
{
obj.getRowsTemplate().refresh()
//_response.call(this, xml);
}


document.write(obj);

oTable.request();

// create button which refreshes grid
var oBtnRefresh = new AW.UI.Button;

oBtnRefresh.setControlText('Click here to refresh');

oBtnRefresh.onClick = function(){
oTable.request();
}

document.write(oBtnRefresh);

-----
Any suggestion, Thanks
Maurice
October 19,
Hi Alex,

Any idea what I am missing here?

Thanks,

Maurice
Maurice
November 2,

This topic is archived.

See also:


Back to support forum