リスト処理におけるSAP UI5アプリケーション

XMLビューで、リスト]タブを使用して、リストの導入:

<mvc:View controllerName="sapcp.cf.tutorial.app.controller.View1" xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m">
    <Shell id="shell">
        <App id="app">
            <pages>
                <Page id="page" title="{i18n>title}">
                    <content>
                        <List items="{/Products}">
                            <StandardListItem type="Active" press="handleListItemPress" title="{ProductName}"/>
                        </List>
                    </content>
                </Page>
            </pages>
        </App>
    </Shell>
</mvc:View>

要素のリストに登録された上記のコードは、コントローラファイルに実装ハンドラhandleListItemPressを、クリックします。

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

    return Controller.extend("sapcp.cf.tutorial.app.controller.View1", {
        onInit: function () {

        },

        // show in a pop-up which list element was pressed
        handleListItemPress: function (oEvent) {
            MessageBox.show(
                "You pressed item: " + oEvent.getSource().getBindingContext(), {
                    icon: sap.m.MessageBox.Icon.INFORMATION,
                    title: "It works!",
                    actions: [sap.m.MessageBox.Action.OK]
                }
            );
        }
    });
});

業績:リスト要素をクリックします。

ポップアップダイアログボックス:

もっとジェリーの元の記事については、してください公共の番号「王Zixi」に注意を払います:

おすすめ

転載: www.cnblogs.com/sap-jerry/p/12321696.html