Skip to Content

Select Dialog don't work SAP FIORI on Smartphone

I created an application in SAPUI5.

I deploy and run in ABAP Server it works fine, when I deploy and run in Fiori Desktop it works fine too, but when I deploy an run in Fiori Mobile app on smartphone the Select dialog don't open.

Below is my controller.

sap.ui.define([
'jquery.sap.global',
'sap/ui/core/Fragment',
'sap/ui/core/mvc/Controller',
'sap/ui/model/Filter',  
'sap/ui/model/json/JSONModel',
'sap/ui/core/routing/History'
], function(jQuery, Fragment, Controller, Filter, JSONModel, History) {
    "use strict";

var CController = Controller.extend("sap.m.Z002.C", {
    onInit: function(){
          var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
        },

        onBack: function(){
        var oHistory = sap.ui.core.routing.History.getInstance();
        var sPreviousHash = oHistory.getPreviousHash();
        window.history.go(-1);
        },

    valueHelpRequest: function(oController) {
        var oUserData;
        var y = "http://XXX.XXXX.XXX:0000/sap/bc/ui2/start_up";
        var xmlHttp = null;
        xmlHttp = new XMLHttpRequest();
        xmlHttp.onreadystatechange = function() {
        if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
                oUserData = JSON.parse(xmlHttp.responseText);
              // alert(oUserData["fullName"]);
            }
        };
        xmlHttp.open("GET", y, false);
        xmlHttp.send(null);

        this.inputId = oController.oSource.sId;
        var sServiceUrl = "http://XXX.XXXX.XXX:0000/sap/opu/odata/sap/ZGW_TR2";
        var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl, true, "user", "password");

        var oJsonModel = new sap.ui.model.json.JSONModel();

        oModel.read("/zget_nt?", null, null, true, function(oData, response) {
            oJsonModel.setData(oData);

        });
        sap.ui.getCore().setModel(oJsonModel);

        // Handling of both confirm and cancel; clear the filter
        var that = this;
        var handleClose = function(oEvent) {

            var oSelectedItem = oEvent.getParameter("selectedItem");
            if (oSelectedItem) {
                that.byId(that.inputId).setValue(oSelectedItem.getTitle());
            }
            oEvent.getSource().getBinding("items").filter([]);
        };

        // Create a SelectDialog and display it; bind to the same
        // model as for the suggested items
        if (!this._valueHelpSelectDialog) {
            this._valueHelpSelectDialog = new sap.m.SelectDialog(this.createId("valueHelpSelectDialog"), {
                title: "Logins",
                items: {
                    path: "/results",
                    template: new sap.m.StandardListItem({
                        title: "{name} ({login})",
                        active: true
                    })
                },
                search: function(oEvent) {
                    var sValue = oEvent.getParameter("value");
                    var oFilter = new sap.ui.model.Filter(
                        "name",
                        sap.ui.model.FilterOperator.Contains, sValue
                    );
                    oEvent.getSource().getBinding("items").filter([oFilter]);
                },
                confirm: handleClose,
                cancel: handleClose
            });

            this._valueHelpSelectDialog.setModel(oJsonModel);

        } else {
            this._valueHelpSelectDialog.setModel(oJsonModel);
        }
        this._valueHelpSelectDialog.open();

    }
});

return CController;

});

I call the dialog in my view: <m:Input id="loginPara" showValueHelp="true" valueHelpRequest="valueHelpRequest" width="auto"/>

What is wrong? SAP Fiori do not know the property sap.m.SelectDialog? How can I correct it?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers