SAP UI5 (MOBILE) dynamic pop-up / selection box (single / multi-column mode)

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/bj_chengrong/article/details/83345022

$_qy_w : function (evt) {
    var jsonParam = {
            'SITE' : SITE_V,
            'SHOPORDER_V' : SHOPORDER_V,
            'method' : 'V_04',
            'EXT_CODE':'TURN_SFC_LOGIC_9'
    };
    var oUrl = '/sapmes/LoadPodServlet';
     var oModel = new sap.ui.model.json.JSONModel();
     oModel.forceNoCache(true);
     oModel.setSizeLimit(999999);
     oModel.setDefaultBindingMode(sap.ui.model.BindingMode.OneWay);
     oModel.loadData(oUrl, jsonParam, false, "POST");
     if (oModel) {
         var _vo = typeof(oModel.getProperty("/RESULT"));
        if(_vo == 'undefined'){
            var _msg = oModel.getProperty("/MSG");
            sap.m.MessageToast.show (the _msg, {DURATION: 5000, animationDuration: 500});
        } the else
        {
            var LIST_MAP = oModel.getProperty ( "/ LIST_MAP");
            / ** start making pop-up check box to select multiple columns popup * block the BEGIN /
            IF (! this._oDialog) {
                this._oDialog new new sap.m.TableSelectDialog = ({
                    Search: function (oEvent) {
                        var sValue = oEvent.getParameter ( "value");
                        var = new new sap.ui Ofilter .model.Filter ( "SHOP_ORDER", sap.ui.model.FilterOperator.Contains, sValue);
                        var = oBinding oEvent.getSource () getBinding ( "items");.
                        oBinding.filter ([Ofilter]);
                    },
                    confirm : function(oEvent) {
                        var aContexts = oEvent.getParameter("selectedContexts");
                        if (aContexts.length) {
                            oView.byId("shoporderInput").setValue(aContexts[0].getObject().SHOP_ORDER);
                        }
                    },
                    columns: [new sap.m.Column({
                        header: new sap.m.Label({
                            text: "工单"
                        })
                    }), new sap.m.Column({
                        header: new sap.m.Label({
                            text: "物料"
                        })
                    }), new sap.m.Column({
                        header: new sap.m.Label({
                            text: "物料描述"
                        })
                    })]
                });
                var itemTemplate = new sap.m.ColumnListItem({
                    cells: [new sap.m.Text({
                    text: "{SHOP_ORDER}"
                }), new sap.m.Text({
                    text: "{ITEM}"
                }), new sap.m.Text({
                    text: "{DESCRIPTION}"
                })]
                });
                if (this._oDialog.getBinding("items")) {
                    this._oDialog.getBinding ( "items") filter ([]);.
                }
                this._oDialog.setModel (oModel);
                this._oDialog.bindAggregation ( "items", "/ LIST_MAP", itemTemplate);
                this._oDialog.open ();
                this._oDialog = null;
            }
            / ** start making pop-up check box to select multiple columns popup * the END /
            / ** start building a separate pop-up check box to select the pop-up selection box * the bEGIN /
            / **
            IF (! this._oDialog) {
                this._oDialog new new sap.m.SelectDialog = ({
                    Search: function (oEvent) {
                        var sValue = oEvent.getParameter ( "value");
                        var oFilter = new sap.ui.model.Filter("SFC", sap.ui.model.FilterOperator.Contains, sValue);
                        var oBinding = oEvent.getSource().getBinding("items");
                        oBinding.filter([ oFilter ]);
                    },
                    confirm : function(oEvent) {
                        var aContexts = oEvent.getParameter("selectedContexts");
                        if (aContexts.length) {
                            oView.byId("shopEntityInput").setValue(aContexts[0].getObject().SFC);
                        }
                    }
                });
                var itemTemplate = new sap.m.StandardListItem({
                    title: "the SFC {}",
                    // Description: "status_desc {}",
                    Active: to true
                });
                IF (this._oDialog.getBinding ( "items")) {
                    . this._oDialog.getBinding ( "items") filter ([]);
                }
                this._oDialog.setModel (oModel);
                this._oDialog.bindAggregation ( "items", "/ LIST_MAP", itemTemplate);
                this._oDialog.open ();
                this._oDialog = null;
            } * /
            / ** start making pop-up check box to select a separate pop-up selection box * the END /
        }
     }
}

Guess you like

Origin blog.csdn.net/bj_chengrong/article/details/83345022