如何将json数据绑定到表单。下面是我要绑定的表单和数据。请帮我解决一下这个。示例我想将 111 个对象值绑定到表单
Data:
{"customerdetailsjson": {
"111": [
{
"name": "Bhuvaneswari Krishnan",
"phone-number":"8050231233"
}
],
"112": [
{
"name":"Chetan Sandeep Renu",
"phone-number":"9840321321"
}
]
}}
Form:
var oLayout1 = new sap.ui.layout.form.ResponsiveGridLayout();
customerDetailsForm = new sap.ui.layout.form.Form("F1", {
layout: oLayout1,
formContainers: [new sap.ui.layout.form.FormContainer("F1C2", {
title: new sap.ui.core.Title({
text: "Address Information",
tooltip: "Address data"
}),
formElements: [new sap.ui.layout.form.FormElement({
label: "Street / Number",
fields: [new sap.m.Input({
type: sap.m.InputType.Text,
value: "{name}",
layoutData: new sap.ui.core.VariantLayoutData({
multipleLayoutData: [new sap.ui.layout.ResponsiveFlowLayoutData({
weight: 5
}), new sap.ui.layout.form.GridElementData({
hCells: "5"
})]
})
})]
}), new sap.ui.layout.form.FormElement({
label: "Street / Number",
fields: [new sap.m.Input({
type: sap.m.InputType.Text,
value: "{phone-number}",
layoutData: new sap.ui.core.VariantLayoutData({
multipleLayoutData: [new sap.ui.layout.ResponsiveFlowLayoutData({
weight: 5
}), new sap.ui.layout.form.GridElementData({
hCells: "5"
})]
})
})]
})]
})]
})]