3.2.0

Set Checkbox's initial state from XML

I want to set the initial state of a checkbox based on the XML response from the server. If an element's value is "ON" - i want the checkbox to be in the checked state. How do I do this - do i need to do a if-else type of thing or is there some property on the checkbox object that I can use to set that "ON" means "true" for this particular instance?

This checkbox i am using is not part of any grid.

I am using AW.UI.Checkbox.
Michelle
June 7,
Any help on this one?
June 8,
// add a checkbox to col 4
obj1.setCellTemplate(new AW.Templates.Checkbox, 4);
obj1.setCellValue(function(col, row){return data.getData(col,row)=="Yes" ? true : false}, 4);
// to get "checked" state put a function in cell text, which follows the checks and writes it back into the CELL!
obj1.setCellText(function(col, row){return this.getCellValue(col, row) ? "Yes" : "No"}, 4);

I hope this helps...the important part I had problems with was the setting inital state when the xml data was recieved. Use data.getData(col,row). data is my AW.XML.Table;

Regards
Steve
June 29,

This topic is archived.

See also:


Back to support forum