3.2.0

custom templates

We were using AW 2.0.1 on IE 6. Recently, we upgraded to AW 2.5.3 to move to IE 7 and upwards. After the upgrade, custom templates in one of our JSP page is broken.

Functionality expected: Depending on value in a column, the cell template of another column is either a 'Link' or 'Text', which can be edited. Interestingly enough this is the only other page with Checkboxes in the header and rows.

Sympton: The table with the checkboxes appeared distored, with additional "<" variables appearing.

Any help is sincerely appreciated.

Code Exceprts:
grid.setCellTemplate(AW.Templates.Checkbox, 0);
grid.setColumnResizable(false, 0);        
grid.setHeaderTemplate(new AW.Templates.Checkbox, 0);
grid.setHeaderValue(true, 0);


//configure the cell template
grid.onCellNormalTemplateChanged = configureCellTemplate;
grid.onCellCheckboxTemplateChanged = configureCellTemplate;
grid.onCellLinkTemplateChanged = configureCellTemplate;
grid.onCellTemplateChanged = function(){return true};
            
//define the different cell templates
grid.defineTemplate("cellNormal", new AW.Templates.Text);
grid.defineTemplate("cellImage", new AW.Templates.Image);
grid.defineTemplate("cellCheckbox", new AW.Templates.Checkbox);
grid.defineTemplate("cellLink", new AW.Templates.Link);


configureCellTemplate
function configureCellTemplate (cell) {
    cell.setAttribute("aw", "cell");
    cell.setAttribute("title", "");
    cell.setClass("grid", "cell");
    cell.setClass("column", function(){return this.$0});
    cell.setClass("cells", function(){return this.getControlProperty("state") || "normal"});
    cell.mapModel("control", "cell");

    cell.getStateProperty = function(p){return this.$owner.getRowProperty(p, this.$1)};
    cell.setStateProperty = function(p, v){this.$owner.setRowProperty(p, v, this.$1)};
    
}


NB
April 21,
That example is not editable by design.
The line:
grid.onCellTemplateChanged = function(){return true};
completelly disables edition (and could be not easy to do it the way it's configured).
HTH
Carlos
April 27,

This topic is archived.

See also:


Back to support forum