A coach table needs a list of business objects (one object per row) - a list of String or a single complex object is exactly what raises the browser error you see. Steps for BPM 8.5.6 with the UI Toolkit (Spark) or the Coaches toolkit table:
- Create a business object for the row, e.g. OrderLine { item: String, qty: Integer, price: Decimal }.
- Declare the variable as tw.local.lines = list of OrderLine (tick "Is list") and initialise it (default, or a script before the coach).
- Drag the variable onto the coach - BPM creates a Table bound to tw.local.lines with one column per field; or drag a Table control and set its binding to the list, then add columns bound to currentItem.item etc.
// script before the coach (server or client side): initialise the list with data
tw.local.lines = new tw.object.listOf.OrderLine();
var l = new tw.object.OrderLine(); l.item = "Widget"; l.qty = 3; l.price = 9.5;
tw.local.lines.insertIntoList(tw.local.lines.listLength, l);
// a list of strings can be shown too - wrap each string in an object
tw.local.rows = new tw.object.listOf.NameValuePair(); // System Data has NameValuePair {name, value}
for (var i = 0; i < tw.local.names.listLength; i++) { var nv = new tw.object.NameValuePair(); nv.name = tw.local.names[i]; tw.local.rows.insertIntoList(i, nv); }Common causes of the browser error on 8.5.6: binding the table to a non-list, binding a column to the list instead of currentItem.field, a column control whose type does not match the field (Integer control on a String), and nested lists in cells (not supported by the OOB table - use a custom view). The Coaches toolkit "Table" (Dojo) and the Spark "Table" differ in look, but both need the list-of-BO binding. On 8.5.7+ use the UI Toolkit table; it also gives sorting, paging and inline editing.
References