I try to create simple SAP FIORI application, but I have a problem with retrieving data from table displayed in Detail view.
I created Master-Master-Detail app using SAP best practice template (including routing etc.) + XML views.
Table definition in Detail.view.xml
:
<Table id="Chars" inset="false" items="{CharSet}">
<columns> ... </columns>
<items>
<ColumnListItem>
<cells>
<ObjectIdentifier text="{CharNo}"/>
<SegmentedButton selectedButton="none" visible="{isBool}">
<Button icon="sap-icon://accept" id="sbOK" text="OK"/>
<Button icon="sap-icon://sys-cancel" id="sbNOK" text="Not OK"/>
</SegmentedButton>
</cells>
</ColumnListItem>
</items>
</table>
I'm trying to get displayed data and selected buttons in onSubmit
function in Detail.controller.js
, but each code syntax, that I tried results with an error like:
Uncaught TypeError: oTable.getContextByIndex is not a function
The only one, that works is function, that returns row count of table:
var rowCount = this.getView().byId("Chars").getBinding("items").getLength();
How to get selected buttons from all rows of table?