我试图在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}中的值为空。
有什么帮助吗?最好的考虑
发布于 2020-05-06 14:02:11
您在示例中所做的几乎所有事情都是正确的。可能的问题是文本元素中的数据绑定。
请查看docs,以确保您的绑定语法正确。JSON模型需要/
绑定,而您没有这种绑定。
https://stackoverflow.com/questions/61637072
复制相似问题