Q:

SAP Fiori get value from table

Easy question. I am a beginner to SAP Fiori an trying to retrieve a value from a table made with Web IDE SAP Fiori. But i don't succeed. Anybody hints on how to get there?
<Table id="table0" items="{/Entity1_Set}" noDataText="Drop column list items here and columns in the area above">
                    <items><ColumnListItem counter="0" id="item1" detailPress="onShowHello" press="" type="DetailAndActive">
                            <cells>
                                <Text id="text5" maxLines="0" text="{Id}"/>
                                <Text id="text6" maxLines="0" text="{field1}"/>
                                <Text id="text7" maxLines="0" text="{field2}"/>
                                <Text id="text8" maxLines="0" text="Euro"/>
                            </cells>
                        </ColumnListItem>
                    </items>
                    <columns>
                        <Column id="column0">
                            <header>
                                <Label id="label0" text="Floor"/>
                            </header>
                        </Column>

.JS controller
sap.ui.define([
    "sap/ui/core/mvc/Controller"
], function(Controller) {
    "use strict";

    return Controller.extend("QuickStartApplication.controller.View1", {
        onShowHello: function(){
            sap.m.MessageToast.show("Hello World!");
        }
    });

});

In the hello world i would like to display values of the fields in my table.

A:

You can pass parameters in the function, which is called during an event.
Please see also https://sapui5.hana.ondemand.com/#docs/api/symbols/sap.m.ListItemBase.html#event:detailPress
Using these parameters, you can access the bound data.
Please see the following code on how to read the binding context of the ColumnListItem:
detailPress : function(oEventParams){
                var oListItem = oEventParams.getSource();
                var oBindingContext = oListItem.getBindingContext(); var sSomePropertyValue = oBindingContext.getProperty("<nameOfProperty>"); }

Using .getProperty, you can access your field values.

