on 11-26-2021 1:28 PM
Hello,
I have a List object which I want to bind to a table. However I don't get it. I followed the example but something is not working. There is no error message so that also does not help.
My list looks something like this:
result= {
statementList = [
{
importance = "ASD",
...
},
{
importance = "BDS",
...
}
]
}
My binding is initiated with this:
var result = JSON.parse(aData.responseData);
that.getView().byId("statementsTable").setModel(new JSONModel(), "statementTableModel");<br>that.getView().byId("statementsTable").getModel("statementTableModel").setData(result.statementList);
And the table is copy/pasted and adjusted from the example:
<Table id="statementsTable"
inset="false"
items="{ path: 'statementsTableModel/' }">
<infoToolbar>
<OverflowToolbar>
<Label text="Statements and Recommendations"/>
</OverflowToolbar>
</infoToolbar>
<columns>
<Column
width="12em">
<Text text="Severity" />
</Column>
<Column
minScreenWidth="Tablet"
demandPopin="true">
<Text text="Text" />
</Column>
</columns>
<items>
<ColumnListItem vAlign="Middle">
<cells>
<Text
text="{statementsTableModel>severity}"/>
<Text
text="{statementsTableModel>text}" />
</cells>
</ColumnListItem>
</items>
</Table>
Last time I was missing something really small so I guess that is again the problem.
Thanks for any input!
After the name of your model you forgot to put a ">".
// Wrong
<Table id="statementsTable"
inset="false"
items="{ path: 'statementsTableModel/' }">
// Right
<Table id="statementsTable"
inset="false"
items="{ path: 'statementsTableModel>/' }">
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can check it using the Diagnostic Tool (just hold Control + Shift + Alt + S in your application). In the Control Tree section you will find some information about the Bindings. There you can check whether the binding is valid or not 🙂
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.