Hi,
I need help.
I have an async table with the ID:asyncTable. I registered an event listener for the table so that when the row changes, I would like to prompt for the selected row’s first column’s value.
Here is how I am registering my event listener:
var tableModel = CAF.model(‘#{caf:cid(“defaultForm:asyncTable”)}’);
tableModel.addRowChangeListener(function(tableId, rowId, eventType) {
if (tableModel.getRowSelectedCount() > 0)
{
alert(“There is a selected row!”);
}
});
So far, the above code works. Before proceeding, I note the first column’s text control’s ID, which is “listRowColumn”. Hence, I update the above script to the following
var tableModel = CAF.model(‘#{caf:cid(“defaultForm:asyncTable”)}’);
tableModel.addRowChangeListener(function(tableId, rowId, eventType) {
if (tableModel.getRowSelectedCount() > 0)
{
var row = CAF.model(rowId);
var nameId = row.getControlId(“listRowColumn”);
alert(nameId);
alert(CAF.model(nameId).getValue());
}
});
What happens now is I get the first alert, which gives me the value for “nameId”. However, the second alert never shows up. Looking at the error console on my browser, it says “CAF.model(nameId) is null”, which is weird. Does this mean I cannot get values from the column?
Thanks in advance!