webMethods and Intelligent Business Operations 10.2 | Designing and Implementing Composite Applications | webMethods CAF and OpenCAF Development Help | Understanding the Client-side Model | CAF.Table.Model | CAF.Table.Row.Model
 
CAF.Table.Row.Model
The CAF.Table.Row.Model, which models a row in a table, extends the CAF.Select.Item.Model, which models a particular item in a select control. The value property of a table row is its server-side row ID, the ID specified for each row by an IAddressableTableContentProvider. The label property of a table row is a CSV string of the row's HTML column content. The description, disabled, style, and styleClass properties all apply the same to a table row as they do to a select item. The icon property does not apply to a table row.
The CAF.Table.Row.Model also has a values property, which replaces the label property as the second argument to its constructor. The values property is a map; it maps the server-side IDs of the controls contained within the row to the values of those controls. So if a table contained a dropdown with an ID of myDropdownId and a output text control with an ID of myOutputId, the following example would append a new row to the table with a row-ID of row-ten, and set the row's dropdown to the value-ten item and the row's output text to display Row Ten, assuming the table had a template row, described by the next section:
table.add(new CAF.Table.Row.Model("row-ten", {myDropdownId: "value-ten",
myOutputId: "Row Ten"}));
A CAF.Table.Row.Model also has a few extra methods designed to help manipulate the row's contents. The getControlId(localId) method gets the ID of any control contained by the row, given its server-side ID. For example, you have a table with an ID of myTableId, and one of the columns within the table has a dropdown with an ID of myDropdownId. You can get a reference to the control in a specific table row, by creating a model for the row, and calling its getControlId() method with the dropdown's server-side ID:
var table = CAF.model("#{activePageBean.clientIds['myTableId']}");
var row = table.get("row-one");
var dropdownId = row.getControlId("myDropdownId");
var dropdown = CAF.model(dropdownId);
For more information about CAF controls, see the webMethods CAF Tag Library Reference, as described in Finding Information about CAF Controls.

Copyright © 2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release