}
the above code is in the click event of my add row button for a table named SomerTable. My intention is to add a row on table SomerTable as well as BenodigSomerTable using just one add row button.my code wont execute the line between the two alerts.
Anything I can do to achieve this.
Hi Eric Norman, my problem its when add the json on the second parameter tableModel.add(0, {}); whats its the structure, my example its:
var values={
EMPLOYEE_ID: “1234”,//EMPLOYEE_ID
FIRST_NAME: “My FName”,//FIRST_NAME
DEPARTMENT_NAME: “Dep” //DEPARTMENT_NAME
};
But not working, any solution for this?
The syntax should be something like this to populate the values of controls in the new row at the same time the row is added:
var tableModel = CAF.model("#{caf:cid('defaultForm:BenodigSomerTable')}");
tableModel.add(0,
{
//for the values field, the key is the controlId, and the value is the value
values : {
htmlInput1 : 'My new row',
htmlInput2: 'value2'
}
});
Double check if your Output Text controls are configured with the “Raw” property set to false. A raw output text control does not render the tag around the text so there isn’t a client-side id to match to the equivalent key in your JSON block.
Alternatively, if you are just populating client-side labels in the columns and not binding it to any input controls, then you could instead just populate the labels of each table cell with this alternate syntax:
var tableModel = CAF.model("#{caf:cid('defaultForm:BenodigSomerTable')}");
tableModel.add(0, {
//the index of string in the array corresponds to the index of the cell in the new row
label : [
'My new row',
'My new row2'
]
});