Hi Guyz,
I am having some difficulties with a CAF javascript implementation (on MWS 7.1.3).
I need to change the default “onclick” behavior for a “Select Row Checkbox” inside an “Async Table”.
I am using this javacript:
//get the select checkbox Model
var checkbox = CAF.model('#{activePageBean.clientIds["taskViewForm:claimDocumentsDetailsTable:claimDocumentSelectCheckbox"]}');
//store the current onclick
var _onclick = checkbox .element.onclick;
//custom onClick
//based on the selected document check do the action
checkbox .element.onclick = function() {
var table = CAF.model('#{activePageBean.clientIds['claimDocumentsDetailsTable']}');
if (table == selectedDoc) {
return(false);
} else {
selectedDoc = table;
_onclick();
}
};
My function is called and the if-else logic works OK. However, when the _onclick() is called, I get this error and the respective row is not selected in the table:
Message: ‘id’ is null or not an object
Line: 7530
Char: 1
Code: 0
URI: http://localhost:8585/wm_cafshared/dyn/base.js?l=de_AT&v=080911065434
Am I mixing some syntax somewhere? Did someone user something like this in the past?
I have a similar implementation running on MWS 8.2 for “Select Row Link” and it works correctly:
//get the select Button Model
var button = CAF.model("#{caf:cid('taskViewForm:documentsAsyncTable:selectRowLink')}");
//store the current onclick
var _onclick = button.element.onclick;
//custom onClick
//based on the selected document check do the action
button.element.onclick = function() {
var table = CAF.model('#{activePageBean.clientIds['documentsAsyncTable']}');
if (table == selectedDoc) {
return(false);
} else {
selectedDoc = table;
_onclick();
}
};
Any help is appreciated,
Teo