I custom object:
I want to fill the object but not working.
My Code:
var BindingMainCat = context.binding.get("value");
BindingMainCat.set("AllPaymentsList[0].id", invoice_id);
BindingMainCat.set("AllPaymentsList[0].amount", inputs[i].value);
Please help me. Thanks
Accessors in coachview bound variables do not support complex navigation with dots and brackets. Once you obtain list itself you can use
add()
,remove()
andput()
operations on list items. You are allowed to useget()
andset()
on attributes of the list but not items themselves - see IBM documentation for "List operations" of binding. For example:Also you can replace element of list with new one:
Note that the final content of the list is the same but change notifications are different. In first example there will be two events about item properties changed, in second example there will be single event about list change - see
bind()
andbindAll()
documentation.Be also warned that on each step you can encounter empty values, if coachview does not have any binding then
this.context.binding
is undefined, if bound variable is null thenthis.context.binding.get("value")
is null, if list has no items thenlist.get(0)
is undefined etc.