SAPUI5 - 将数据绑定到 SimpleForm

SAPUI5 - bind data into SimpleForm

我正在尝试在 Omodel.read 之后将数据绑定到简单表单中,这是我的代码:

oModel.read("/" + sObjectPath + "/to_AL", {
    success: function(oData2, oResponse2) {
        var oModelJson = new sap.ui.model.json.JSONModel(oData2.results[0]);                             
        that.getView().byId("SimpleFormAnalisi").setModel(oModelJson);
    }
}

oData2.results[0]包含我要绑定的数据,SimpleFormAnalisi是我的SimpleForm

的名字
<form:SimpleForm id="SimpleFormAnalisi" 
    editable="false" 
    layout="ResponsiveGridLayout" 
    labelSpanXL="4" 
    labelSpanL="4"
    labelSpanM="12" 
    labelSpanS="12" 
    adjustLabelSpan="false" 
    emptySpanXL="0" 
    emptySpanL="0" 
    emptySpanM="0" 
    emptySpanS="0" 
    columnsXL="2"
    columnsL="2" 
    columnsM="2" 
    singleContainerFullSize="false">
    <form:content>
        <Label text="SST"  textDirection="RTL"/>
        <Text text="{sst}" />

我预计 {sst} 的值是空的。

有什么帮助吗? 最好的问候

您在示例中所做的几乎所有事情都是正确的。问题可能出在您的 Text 元素中的数据绑定。

请查看 docs,以确保您的绑定语法正确。 JSON 模型需要 / 绑定,而您没有。