Hi,
In the end I had to do it all in javaScript.
I could not do the job only with CAF API.
Code to parse all the needed fields in the table and set their tabIndex property:
var tableMyDataTable = CAF.model('#{activePageBean.clientIds['myDataTable']}');
if (tableMyDataTable != null){
var rowTemplate = '#{activePageBean.clientIds['myFirstInputField']}';
var endIndex = rowTemplate.indexOf("__row");
var prefix = rowTemplate.substring(0, endIndex);
var rowTemplateMyFirstInput =prefix + '__row__template:myFirstInputField'
var rowTemplateMySecondInput = prefix + '__row__template:mySecondInput';
var rowTemplateMyThirdInput = prefix + '__row__template:myThirdInput';
var rowTemplateMyForthInput = prefix + '__row__template:myForthInput';
var rowCount = tableMyDataTable.getRowCount();
var numberOfControls = 4;
for (i = 0; i < rowCount; i++) {
var row = tableMyDataTable.get(i);
setTabIndex(rowTemplateMyFirstInput, row, 100 + i*numberOfControls);
setTabIndex(rowTemplateMySecondInput, row, 101 + i*numberOfControls);
setTabIndex(rowTemplateMyThirdInput, row, 102 + i*numberOfControls);
setTabIndex(rowTemplateMyForthInput, row, 103 + i*numberOfControls);
}
}
Function to set the tabIndex:
function setTabIndex(rowTemplateHtmlId, rowId, tabIndex){
var controlHtmlId = rowTemplateHtmlId.replace("__template",rowId);
var controlInputObject = document.getElementById(controlHtmlId);
controlInputObject.tabIndex = "" +tabIndex;
}
You have to make sure that your rowIdBinding does not contain characters that must be escaped. If the rowID contains special characters then you will manually have to modify the “row” variable:
var row = tableMyDataTable.get(i);
br,
Vlad
#webMethods-BPMS#MWS-CAF-Task-Engine#webMethods