sap-tutorials / Tutorials

Tutorials on sap.com
https://developers.sap.com/tutorial-navigator.html
Creative Commons Attribution 4.0 International
717 stars 772 forks source link

Change from a mock server to live OData service for TechEd #2488

Closed AldoKing2018 closed 6 years ago

AldoKing2018 commented 6 years ago

Hi, I'm doing tutorial "Introducing SAP Front-End Technologies".

Point "Change from a mock server to live OData service for TechEd" (web: https://www.sap.com/developer/tutorials/teched-2017-webide-odata.html)

"Step 9: Validate your initialization function"

System asks for: Copy the code from your onInit function in the Detail (S1) controller. Paste it in the box below.

Not possible to Valide because tutorial seems to be a little outdated. I attach at the end my www.build.me generated code (that I've imported to my web IDE)

How can I validate? I would like to keep tracking of my progress, and if I do not validate, step is not completed.

    _onInit: function() {
        this.oRouter = sap.ui.core.UIComponent.getRouterFor(this);
        this.oRouter.getTarget("1472700396090_S1").attachDisplay(jQuery.proxy(this.handleRouteMatched, this));
        var oView = this.getView();
        oView.addEventDelegate({
            onBeforeShow: function() {
                if (sap.ui.Device.system.phone) {
                    var oPage = oView.getContent()[0];
                    if (oPage.getShowNavButton && !oPage.getShowNavButton()) {
                        oPage.setShowNavButton(true);
                        oPage.attachNavButtonPress(function() {
                            this.oRouter.navTo("1472700396089_S0", {}, true);
                        }.bind(this));
                    }
                }
            }.bind(this)
        });_

Thanks and best regards Alfredo Rey

merehassett commented 6 years ago

Hi Alfredo,

You need to copy the entire onInit function. This snippet is only 1 part of it. The tutorial has been maintained to match the latest changes on the BUILD import.

Thank you! Meredith

AldoKing2018 commented 6 years ago

Hi Meredith, Thanks for your answer. Still validation is failing. I attach all onInit function.

Best regards Alfredo Rey

_onInit: function() { this.oRouter = sap.ui.core.UIComponent.getRouterFor(this); this.oRouter.getTarget("1472700396090_S1").attachDisplay(jQuery.proxy(this.handleRouteMatched, this)); var oView = this.getView(); oView.addEventDelegate({ onBeforeShow: function() { if (sap.ui.Device.system.phone) { var oPage = oView.getContent()[0]; if (oPage.getShowNavButton && !oPage.getShowNavButton()) { oPage.setShowNavButton(true); oPage.attachNavButtonPress(function() { this.oRouter.navTo("1472700396089_S0", {}, true); }.bind(this)); } } }.bind(this) });

        var oView = this.getView(),
            oData = {},
            self = this;
        var oModel = new sap.ui.model.json.JSONModel();
        oView.setModel(oModel, "staticDataModel");
        self.oBindingParameters = {};

        oData["sap_IconTabBar_Page_0-content-sap_chart_ColumnChart-1473793038493"] = {};

        oData["sap_IconTabBar_Page_0-content-sap_chart_ColumnChart-1473793038493"]["data"] = [{
            "Country": "India",
            "City": "Bangalore",
            "Revenue": "1538",
            "Profit": "296",
            "Dimension1": "2014",
            "Measure1": "659.26",
            "__id": 0
        }, {
            "Country": "Canada",
            "City": "Ottawa",
            "Revenue": "892",
            "Profit": "141",
            "Dimension1": "2008",
            "Measure1": "758.38",
            "__id": 1
        }, {
            "Country": "Canada",
            "City": "Nunavut",
            "Revenue": "789",
            "Profit": "133",
            "Dimension1": "2009",
            "Measure1": "845.42",
            "__id": 2
        }, {
            "Country": "India",
            "City": "Delhi",
            "Revenue": "2785",
            "Profit": "560",
            "Dimension1": "2014",
            "Measure1": "674.16",
            "__id": 3
        }, {
            "Country": "USA",
            "City": "Chicago",
            "Revenue": "2356",
            "Profit": "489",
            "Dimension1": "2010",
            "Measure1": "995.26",
            "__id": 4
        }, {
            "Country": "Japan",
            "City": "Kariya",
            "Revenue": "1987",
            "Profit": "270",
            "Dimension1": "2012",
            "Measure1": "748.72",
            "__id": 5
        }, {
            "Country": "India",
            "City": "Mumbai",
            "Revenue": "2538",
            "Profit": "708",
            "Dimension1": "2014",
            "Measure1": "524.51",
            "__id": 6
        }, {
            "Country": "Germany",
            "City": "Breman",
            "Revenue": "1245",
            "Profit": "350",
            "Dimension1": "2015",
            "Measure1": "598.96",
            "__id": 7
        }, {
            "Country": "Germany",
            "City": "Berlin",
            "Revenue": "1867",
            "Profit": "369",
            "Dimension1": "2015",
            "Measure1": "185.46",
            "__id": 8
        }, {
            "Country": "Canada",
            "City": "Nunavut",
            "Revenue": "1410",
            "Profit": "245",
            "Dimension1": "2008",
            "Measure1": "789.38",
            "__id": 9
        }, {
            "Country": "USA",
            "City": "Dallas",
            "Revenue": "2410",
            "Profit": "576",
            "Dimension1": "2010",
            "Measure1": "790.32",
            "__id": 10
        }, {
            "Country": "India",
            "City": "Kolkata",
            "Revenue": "2020",
            "Profit": "459",
            "Dimension1": "2010",
            "Measure1": "965.85",
            "__id": 11
        }, {
            "Country": "USA",
            "City": "Seattle",
            "Revenue": "2678",
            "Profit": "358",
            "Dimension1": "2010",
            "Measure1": "685.39",
            "__id": 12
        }, {
            "Country": "USA",
            "City": "Omaha",
            "Revenue": "3410",
            "Profit": "760",
            "Dimension1": "2010",
            "Measure1": "798.32",
            "__id": 13
        }, {
            "Country": "Japan",
            "City": "Yatomi",
            "Revenue": "1310",
            "Profit": "270",
            "Dimension1": "2012",
            "Measure1": "896.15",
            "__id": 14
        }, {
            "Country": "Japan",
            "City": "Seiyo",
            "Revenue": "1485",
            "Profit": "325",
            "Dimension1": "2012",
            "Measure1": "779.65",
            "__id": 15
        }];

        self.oBindingParameters['sap_IconTabBar_Page_0-content-sap_chart_ColumnChart-1473793038493'] = {
            "path": "Parts",
            "parameters": {
                "entitySet": "Sets"
            }
        };

        oView.getModel("staticDataModel").setData(oData, true);

        function dateDimensionFormatter(oDimensionValue, sTextValue) {
            var oValueToFormat = sTextValue !== undefined ? sTextValue : oDimensionValue;
            if (oValueToFormat instanceof Date) {
                var oFormat = sap.ui.core.format.DateFormat.getDateInstance({
                    style: "short"
                });
                return oFormat.format(oValueToFormat);
            }
            return oValueToFormat;
        }

        var aDimensions = oView.byId("sap_IconTabBar_Page_0-content-sap_chart_ColumnChart-1473793038493").getDimensions();
        aDimensions.forEach(function(oDimension) {
            oDimension.setTextFormatter(dateDimensionFormatter);
        });

    }_
merehassett commented 6 years ago

Hi Alfredo,

After looking into it, I realized I had not been maintaining the validation on the tutorials from TechEd 2017, which is why the validation is not working since there have been changes in the code. I had fixed it on my end, so you should be able to validate now!

Thank you and apologies! Meredith

StErMi commented 6 years ago

Hi @mhassett92 it still fails to validate (I've opened another ticket because I didn't see this)

Akshaykumar26 commented 6 years ago

Hi @mhassett92, Validation is failing for me as well.

amitcruz commented 6 years ago

Hello @mhassett92 , I am also not able to pass the validation of Step 9 . Have tried all permutations and combinations. Please check it.

bufiku commented 6 years ago

Same here - Several possibilities submitted, even did the exercises again, but only failing validations.

DuoBelt commented 6 years ago

Hello @mhassett92 I am also not able to pass the validation of "Step 9: Validate your initialization function". I think I need help.

Barcelona is waiting :)

1,2, 3 ex. validate 1. ->{"result":false}

`Request URL: https://www.sap.com/bin/sapdx/tutorials/forms/validate Request Method: POST Status Code: 200 OK Remote Address: 104.81.62.129:443 Referrer Policy: no-referrer-when-downgrade Access-Control-Allow-Origin: https://www.sap.com Connection: keep-alive Content-Length: 16 Content-Security-Policy: frame-ancestors 'self' http://hybris.com https://hybris.com http://*.hybris.com https://*.hybris.com http://sap.lookbookhq.com https://sap.lookbookhq.com http://cx.sap.com https://cx.sap.com;default-src 'self' blob: https: data: 'unsafe-inline' 'unsafe-eval' github.com api.github.com raw.githubusercontent.com .liveperson.net http://.sap.com https://*.sap.com .demandbase.com .adobedtm.com .company-target.com .omtrdc.net .w55c.net platform.twitter.com .siteintercept.qualtrics.com .doubleclick.net cdnjs.cloudflare.com charts3.equitystory.com http://sap-espresso.com http://.akamai.net ust-servlet.dataxu.net https://*.cdn.sap.com .2mdn.net .2o7.net .qualtrics.com https://.akamaihd.net http://*.akamaihd.net .lpsnmedia.net .truste.com .newrelic.com .nr-data.net https://*.youtube.com https://*.youtu.be https://*.ytimg.com .twitter.com http://.twimg.com https://*.twimg.com .adobe.com .demdex.net .liveperson.com .liveengage.net .liveengage.com .liveper.sn .licdn.com .hana.ondemand.com http://dc1cp8nqqrmxi.cloudfront.net http://*.edgesuite.net http://dewdfbcmcps10:1080 http://dewdfbcmcps10 https://bcmcps.enter.sap .d41.co Content-Type: application/json; charset=UTF-8 Date: Mon, 20 Aug 2018 21:01:18 GMT Expires: Mon, 20 Aug 2018 21:01:18 GMT Server: Apache Set-Cookie: ims_session=d7anZXPDhwmg98kyHNfiD3IvUoQa1X1SzaR4%2FcSjOVQ%2Fn1FHgibMTVKEuq%2BfGawzEKtcha%2FLJjuD%0AoVXqN557C%2FlXD7kzBctbfCwoBVY8LNDa507VoE1nwOyxliV7SGINSrnwUx08lvXEcYCycGjELZVh%0AVIjqxlFgEe2%2Ffp8e%2BwI%3D;Path=/bin/sapdx/;Expires=Mon, 20-Aug-2018 21:11:17 GMT;Secure;HttpOnly Set-Cookie: BIGipServer~partition-sap_it_wcms-dx_prod~lb-0c01f14f-cca1=!ggbRHs+PXuvvxKtBtVVYNg6fi88NfUHBOj7seXCuj024nmndFOy5pF6WzjsdUthuzDFHSiyk8Qr1qOujvUxIQCSzuMKWpKgfIv7/rdkeJg==; expires=Mon, 20-Aug-2018 21:31:23 GMT; path=/ Strict-Transport-Security: max-age=31536000; includeSubdomains; X-Content-Security-Policy: frame-ancestors 'self' http://hybris.com https://hybris.com http://.hybris.com https://*.hybris.com http://sap.lookbookhq.com https://sap.lookbookhq.com http://cx.sap.com https://cx.sap.com;default-src 'self' blob: https: data: 'unsafe-inline' 'unsafe-eval' github.com api.github.com raw.githubusercontent.com .liveperson.net http://.sap.com https://*.sap.com .demandbase.com .adobedtm.com .company-target.com .omtrdc.net .w55c.net platform.twitter.com .siteintercept.qualtrics.com .doubleclick.net cdnjs.cloudflare.com charts3.equitystory.com http://sap-espresso.com http://.akamai.net ust-servlet.dataxu.net https://*.cdn.sap.com .2mdn.net .2o7.net .qualtrics.com https://.akamaihd.net http://*.akamaihd.net .lpsnmedia.net .truste.com .newrelic.com .nr-data.net https://*.youtube.com https://*.youtu.be https://*.ytimg.com .twitter.com http://.twimg.com https://*.twimg.com .adobe.com .demdex.net .liveperson.com .liveengage.net .liveengage.com .liveper.sn .licdn.com .hana.ondemand.com http://dc1cp8nqqrmxi.cloudfront.net http://*.edgesuite.net http://dewdfbcmcps10:1080 http://dewdfbcmcps10 https://bcmcps.enter.sap .d41.co X-Content-Type-Options: nosniff X-Permitted-Cross-Domain-Policies: value="master-only" X-Webkit-CSP: frame-ancestors 'self' http://hybris.com https://hybris.com http://.hybris.com https://*.hybris.com http://sap.lookbookhq.com https://sap.lookbookhq.com http://cx.sap.com https://cx.sap.com;default-src 'self' blob: https: data: 'unsafe-inline' 'unsafe-eval' github.com api.github.com raw.githubusercontent.com .liveperson.net http://.sap.com https://*.sap.com .demandbase.com .adobedtm.com .company-target.com .omtrdc.net .w55c.net platform.twitter.com .siteintercept.qualtrics.com .doubleclick.net cdnjs.cloudflare.com charts3.equitystory.com http://sap-espresso.com http://.akamai.net ust-servlet.dataxu.net https://*.cdn.sap.com .2mdn.net .2o7.net .qualtrics.com https://.akamaihd.net http://*.akamaihd.net .lpsnmedia.net .truste.com .newrelic.com .nr-data.net https://*.youtube.com https://*.youtu.be https://*.ytimg.com .twitter.com http://.twimg.com https://*.twimg.com .adobe.com .demdex.net .liveperson.com .liveengage.net .liveengage.com .liveper.sn .licdn.com .hana.ondemand.com http://dc1cp8nqqrmxi.cloudfront.net http://*.edgesuite.net http://dewdfbcmcps10:1080 http://dewdfbcmcps10 https://bcmcps.enter.sap .d41.co X-XSS-Protection: 1; mode=block Accept: /* Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.9 Cache-Control: no-cache Connection: keep-alive Content-Length: 7971 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Cookie: ims_session=Nbr8ZExYthjSzir2gbNZAwoGRs0BnG9VxfGiWYu44B05AwK94ykLuba7V1hvMiOY3fiht43oOj%2Fv%0Arhxu6KiJGtWx3GuFIEF22UWscNL1065RNseQ6F9l12vWOSo8Hmh0NpYMANQ1hqLt72TDvxWK9sXC%0AwTyX1T%2FU8G5e4NlLYAs%3D; notice_preferences=2:; ecomguid=547e6feb-d619-1014-01ee-66469133daf8; _ga=GA1.2.258244229.1507832451; LPVID=E4OWNjNGQxOWVkODAwYTM2; client=cea4b9aa-60f7-11e7-ab84-c513f58256e5; notice_gdpr_prefs=0,1,2:; SelectedCountryPath=https://www.sap.com/poland/index.html; countryCode=PL; localeCode=pl_pl; SAP.TTC=1534610283; TCCheckCount=3; _pk_id.33255556-c863-4a29-9bda-1309df0cff50.bbaa=06aec7ef69498d16.1533236484.0.1534610468..; _swa_v_ref.33255556-c863-4a29-9bda-1309df0cff50.bbaa=%5B%22%22%2C%22%22%2C1534610468%2C%22https%3A%2F%2Fwww.google.pl%2F%22%5D; _swa_v_id.33255556-c863-4a29-9bda-1309df0cff50.bbaa=1bb234e1d7304f38.1533236484.2.1534610478.1533237411.; country=PL; renderid=rend1; check=true; _sdsat_demandbase=[object Object]; AMCVS_227AC2D754DCAB340A4C98C6%40AdobeOrg=1; AMCV_227AC2D754DCAB340A4C98C6%40AdobeOrg=1406116232%7CMCIDTS%7C17764%7CMCMID%7C54525928032090990211285760689864511564%7CMCAAMLH-1535395863%7C6%7CMCAAMB-1535395863%7C6G1ynYcLPuiQxYZrsz_pkqfLG9yMXBpb2zX5dvJdYQJzPXImdj0y%7CMCOPTOUT-1534798263s%7CNONE%7CMCAID%7CNONE%7CMCSYNCSOP%7C411-17769%7CvVersion%7C2.5.0; AMCV_MCMID=54525928032090990211285760689864511564; session=fd620d5c-a4a9-11e8-96fe-478aa3ba0ad2; locale=en_US; targetUrl=https%3A%2F%2Fwww.sap.com%2Fbin%2Ffiji%2Fes%2Flogin.sapdx.html; ONEDX_IDS_PROD=00FeiXhtMpc1uoZI%2BF%2BoHrSvqNsII3tVdK7s%2BROysfM8ojmR50%2Fg9qjI%2FW7wQvzMALk%2Bs2oiH3CO%0AdJvbDj21wYhIaKCUo9mGks0JVXlGkutHu9PoPkneOVCvP7LW8McY6XoXGzlWwQceYTVL1YiRAtah%0ANFhnq2ULEJb54szkZdDWYGSd%2BvUBAcQ8oO7Ox%2BBPWDJlFKqtxxtiIB0L6LVMms5z4r1XIcQf92wM%0Apl7RJhXC%2FrEFJTIte8FzAZRDoqgVdbBTHKQ4qQyxoesaZVdM9Rqr6VGlQlBjx5KlVDEzEDf1Imhn%0AiYAkBQgMkLjZnI16H%2Bm1G5KW1%2F6hx5VXls4Wn6zlq4T0WErkn5nURw2rRaCfZMesRVJGLXW9l2re%0AM%2BPNNAd22vzskkJYS8Zt34hZZBObTw4U9DBJlIU1A%2FvQ9wWyCxuWqZAFtXg9J7DaynwYa94xvIkZ%0AXc6TKaLb63%2BbmXcloXsy15NSLOTj3ooO%2BDqJaLk5OGLbNgoKA3gevAuAzQzLmUSmLG5aPj%2FlWdvf%0AoR2gZjkD8VLGp6f0%2BgwzBqZmX3gZqSMdZPxIUCjWWR0GyOs8h4y%2F%2BEMsIxV4r8hll7ZZLQgnZ%2BD8%0ASVWJGfkn%2BLOvboUt6i4OztaaBJqvUy0Jiktbkh96e332t6t%2FrI%2BIlm7iNrJxxAreKrEVhaOsY%2Bc%3D; QSI_HistorySession=https%3A%2F%2Fwww.sap.com%2Fdeveloper%2Fmissions%2Fpre-teched-2018.html~1534791089748%7Chttps%3A%2F%2Fwww.sap.com%2Fdeveloper%2Ftutorials%2Fpre-teched-2018-sapui5-code.html~1534791200345%7Chttps%3A%2F%2Fwww.sap.com%2Fdeveloper%2Fmissions%2Fpre-teched-2018.html~1534794560196%7Chttps%3A%2F%2Fwww.sap.com%2Fdeveloper%2Ftutorials%2Fpre-teched-2018-cp-destination.html~1534794583528%7Chttps%3A%2F%2Fwww.sap.com%2Fdeveloper%2Fmissions%2Fpre-teched-2018.html~1534794713967%7Chttps%3A%2F%2Fwww.sap.com%2Fdeveloper%2Ftutorials%2Fpre-teched-2018-webide-odata.html~1534794734046; notice_behavior=expressed,eu; sap_s_pers=%20s_ttc%3D-%7C1539881555103%3B%20s_fid%3D2C956349E63C417D-29D8176BC7A25624%7C1691004012632%3B%20c9%3DlogN%7C1534798893176%3B%20c13%3Dscn-arc%253A%252Fdiscussions%252Fthread%252F3795814%7C1534798893182%3B%20pe%3Dno%2520value%7C1534798893184%3B%20c3%3Dno%2520value%7C1534798893187%3B%20s_nr%3D1534797093194-Returning%7C1537389093194%3B%20s_sapvisid%3Dcea4b9aa60f711e7ab84c513f58256e5%7C1664397093198%3B%20s_visit%3D1%7C1534798893200%3B; sap_s_sess=%20s_cc%3Dtrue%3B%20tp%3D2099%3B%20s_ppv%3Dhttps%25253A%252F%252Farchive.sap.com%252Fdiscussions%252Fthread%252F3795814%252C62%252C62%252C1303%3B; IDP_SESSION_MARKER_accounts=eyJhbGciOiJFQ0RILUVTK0EyNTZLVyIsImVuYyI6IkExMjhDQkMtSFMyNTYiLCJraWQiOm51bGwsImN0eSI6IkpXVCIsImVwayI6eyJrdHkiOiJFQyIsIngiOiJyZzBmY1lyRGJfcmp0Q1hHRlBpU2hXejg1WTdOUHhuYlBMSjY1M25jWC1nIiwieSI6IlUxNUt2d2drU1QwV0RDSUxtQVl2WmJlVTFCMVREVm03OVF3RnJxWWJTT2MiLCJjcnYiOiJQLTI1NiJ9fQ.AyxpZkJauRqaiJuYajsR9upBp_pt35idDv7k2YHzxw61KAGRX5ID0Q.tsNl5rs18sexE0mgjmBo5w.xdUCKAk78cF_qJ9NIBAqnyE-HmvEpDU29lQJyixJpzAGptHgN85b8kbjiiiU8UYpkfY_xDNaqrtmX3DaUs4fMT-O-gB3pwc1OnchF1I-0uUqp-PMkD0WdS8__Wco3ImpZ3QfdPbmaDPldsiK_x09v-jJs--17OmStqbn7kboq-mkUbQTHBnD1NtplDWfBRWvjG8n32KlBvYoJIDRHqBzJMc8-P4ro27MpqJpA2AC3Sblz4jOIplAhZZrVxJOOPnhaJvAEj6CDiTbigfAVloXKqnkiRBgktD3KTxPRTbB_hRQqFXXdGaUDQgpj-uqj3lHtj3xUA_dFMsqLAuRh7QlrVdwNbuH7aCWS9Pq4Gr8cZPHTvtwaE3n4zumdnddJTjkTT_OTZPE9QzkUPe4KklIY0BE_38MPhCFEZJHGF_W1CZwSlP15qTNpdIruHPFEKX1I7vOqQjDvkU616RF4QVECBrbcpwb6kdcyI-eeTSTKl76NPCMO4R4TZmWpcuVugcp0KIbAnrD8aHg-m39D5slZZy5qChWV4MxCyr5YrHIsVEMrxvCV8aqr2OrGF72lP6N4PvtRm0eNXiQR_p0_NpGaq8IacNhU8feZZsNwvpUY737jf-FzuWYFfaPDtykfC.-P3zVHls-6piTKLQKSTYfw; DBLiveEngage=1; LPSID-81933160=joZWXGbORMmpZR-dfDn3hA; mbox=session#36f7b02c3f1148aab53b6c8af07b9f54#1534799132; BIGipServer~partition-sap_it_wcms-dx_prod~lb-0c01f14f-cca1=!X0pAH5TpWyGkpX1BtVVYNg6fi88NfUQLR4hwd3EpcXYaurDO4yDxXQvyG/9O2IzTLz8PNNPWlXmndCih2/Q7TKI7cg/mEqosa/9hgLvmRw==; s_pers=%20v36%3D%255B%255B%2527banner-pl-events-1row%2527%252C%25271520629117175%2527%255D%252C%255B%2527ctabutton-sap.com-banner-lastchance-mayr2-sanow18-banner-us-homepage-row1-may18r2%2527%252C%25271527337136569%2527%255D%252C%255B%2527ctabutton-pl-home-hero%2527%252C%25271533237666787%2527%255D%255D%7C1691004066787%3B%20v51%3D%255B%255B%2527banner-pl-events-1row%2527%252C%25271520629117182%2527%255D%252C%255B%2527ctabutton-sap.com-banner-lastchance-mayr2-sanow18-banner-us-homepage-row1-may18r2%2527%252C%25271527337136579%2527%255D%252C%255B%2527ctabutton-pl-home-hero%2527%252C%25271533237666793%2527%255D%255D%7C1691004066793%3B%20s_nr%3D1534792341447-Returning%7C1537384341447%3B%20s_ttc%3D-%7C1566329194383%3B%20gpv_p9%3DlogY%7C1534799073024%3B%20c13%3Dsap%253A%252Fdeveloper%252Ftutorials%252Fpre-teched-2018-webide-odata.html%7C1534800677155%3B%20pe%3Devent70%253D82%7C1534800677161%3B%20c3%3Dno%2520value%7C1534800677165%3B%20s_sapvisid%3Dcea4b9aa60f711e7ab84c513f58256e5%7C1664398877172%3B; s_sess=%20s_cc%3Dtrue%3B%20tp%3D1528%3B%20s_ppv%3Dhttps%25253A%252F%252Fwww.sap.com%252Fdeveloper%252Ftutorials%252Fpre-teched-2018-webide-odata.html%252C100%252C100%252C1528%3B%20s_sq%3Dsapcomglobal%25252Csapcomrollup%25252Csapglobal%253D%252526c.%252526a.%252526activitymap.%252526page%25253Dsap%2525253A%2525252Fdeveloper%2525252Ftutorials%2525252Fpre-teched-2018-webide-odata.html%252526link%25253DValidate%252526region%25253Dc1ed8408-fc33-4456-8cb9-a6ae68f08389%252526pageIDType%25253D1%252526.activitymap%252526.a%252526.c%3B CSRF-Token: undefined Host: www.sap.com Origin: https://www.sap.com Pragma: no-cache Referer: https://www.sap.com/developer/tutorials/pre-teched-2018-webide-odata.html User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36 X-Requested-With: XMLHttpRequest absolutePagePath: /content/sapdx/website/languages/en/developer/tutorials/pre-teched-2018-webide-odata id: 9 eventId: answer: onInit: function () { this.oRouter = sap.ui.core.UIComponent.getRouterFor(this); this.oRouter.getTarget("1472700396090_S1").attachDisplay(jQuery.proxy(this.handleRouteMatched, this)); var oView = this.getView(); oView.addEventDelegate({ onBeforeShow: function () { if (sap.ui.Device.system.phone) { var oPage = oView.getContent()[0]; if (oPage.getShowNavButton && !oPage.getShowNavButton()) { oPage.setShowNavButton(true); oPage.attachNavButtonPress(function () { this.oRouter.navTo("1472700396089_S0", {}, true); }.bind(this)); } } }.bind(this) });

        var oView = this.getView(),
            oData = {},
            self = this;
        var oModel = new sap.ui.model.json.JSONModel();
        oView.setModel(oModel, "staticDataModel");
        self.oBindingParameters = {};

        oData["sap_IconTabBar_Page_0-content-sap_chart_ColumnChart-1473793038493"] = {};

        oData["sap_IconTabBar_Page_0-content-sap_chart_ColumnChart-1473793038493"]["data"] = [{
            "Country": "India",
            "City": "Bangalore",
            "Revenue": "1538",
            "Profit": "296",
            "Dimension1": "2014",
            "Measure1": "659.26",
            "__id": 0
        }, {
            "Country": "Canada",
            "City": "Ottawa",
            "Revenue": "892",
            "Profit": "141",
            "Dimension1": "2008",
            "Measure1": "758.38",
            "__id": 1
        }, {
            "Country": "Canada",
            "City": "Nunavut",
            "Revenue": "789",
            "Profit": "133",
            "Dimension1": "2009",
            "Measure1": "845.42",
            "__id": 2
        }, {
            "Country": "India",
            "City": "Delhi",
            "Revenue": "2785",
            "Profit": "560",
            "Dimension1": "2014",
            "Measure1": "674.16",
            "__id": 3
        }, {
            "Country": "USA",
            "City": "Chicago",
            "Revenue": "2356",
            "Profit": "489",
            "Dimension1": "2010",
            "Measure1": "995.26",
            "__id": 4
        }, {
            "Country": "Japan",
            "City": "Kariya",
            "Revenue": "1987",
            "Profit": "270",
            "Dimension1": "2012",
            "Measure1": "748.72",
            "__id": 5
        }, {
            "Country": "India",
            "City": "Mumbai",
            "Revenue": "2538",
            "Profit": "708",
            "Dimension1": "2014",
            "Measure1": "524.51",
            "__id": 6
        }, {
            "Country": "Germany",
            "City": "Breman",
            "Revenue": "1245",
            "Profit": "350",
            "Dimension1": "2015",
            "Measure1": "598.96",
            "__id": 7
        }, {
            "Country": "Germany",
            "City": "Berlin",
            "Revenue": "1867",
            "Profit": "369",
            "Dimension1": "2015",
            "Measure1": "185.46",
            "__id": 8
        }, {
            "Country": "Canada",
            "City": "Nunavut",
            "Revenue": "1410",
            "Profit": "245",
            "Dimension1": "2008",
            "Measure1": "789.38",
            "__id": 9
        }, {
            "Country": "USA",
            "City": "Dallas",
            "Revenue": "2410",
            "Profit": "576",
            "Dimension1": "2010",
            "Measure1": "790.32",
            "__id": 10
        }, {
            "Country": "India",
            "City": "Kolkata",
            "Revenue": "2020",
            "Profit": "459",
            "Dimension1": "2010",
            "Measure1": "965.85",
            "__id": 11
        }, {
            "Country": "USA",
            "City": "Seattle",
            "Revenue": "2678",
            "Profit": "358",
            "Dimension1": "2010",
            "Measure1": "685.39",
            "__id": 12
        }, {
            "Country": "USA",
            "City": "Omaha",
            "Revenue": "3410",
            "Profit": "760",
            "Dimension1": "2010",
            "Measure1": "798.32",
            "__id": 13
        }, {
            "Country": "Japan",
            "City": "Yatomi",
            "Revenue": "1310",
            "Profit": "270",
            "Dimension1": "2012",
            "Measure1": "896.15",
            "__id": 14
        }, {
            "Country": "Japan",
            "City": "Seiyo",
            "Revenue": "1485",
            "Profit": "325",
            "Dimension1": "2012",
            "Measure1": "779.65",
            "__id": 15
        }];

        self.oBindingParameters['sap_IconTabBar_Page_0-content-sap_chart_ColumnChart-1473793038493'] = {
            "path": "Parts",
            "parameters": {
                "entitySet": "Sets"
            }
        };

        oView.getModel("staticDataModel").setData(oData, true);

        function dateDimensionFormatter(oDimensionValue, sTextValue) {
            var oValueToFormat = sTextValue !== undefined ? sTextValue : oDimensionValue;
            if (oValueToFormat instanceof Date) {
                var oFormat = sap.ui.core.format.DateFormat.getDateInstance({
                    style: "short"
                });
                return oFormat.format(oValueToFormat);
            }
            return oValueToFormat;
        }

        var aDimensions = oView.byId("sap_IconTabBar_Page_0-content-sap_chart_ColumnChart-1473793038493").getDimensions();
        aDimensions.forEach(function (oDimension) {
            oDimension.setTextFormatter(dateDimensionFormatter);
        });

    }

time: 630.41`

thecodester commented 6 years ago

Sorry for the issues. Can everybody refresh the page and try again?

AldoKing2018 commented 6 years ago

Hi, It's still failing. Even I've opened a new browser incognito Window to do the test.

Best regards Alfredo Rey

thecodester commented 6 years ago

@AldoKing2018 I will check. Can anyone else validate successfully?

bufiku commented 6 years ago

Yes, I have validated my solution correctly yesterday afternoon (CET).

AldoKing2018 commented 6 years ago

Hi @bufiku, kindly, could you copy&paste your onInit: function() on this thread? I'm going to try with you code. I've tried with @DuoBelt pasted code on this thread, but it's not working for me.

Thanks and best regards Alfredo Rey

merehassett commented 6 years ago

HI Alfredo,

Are you still working on the TechEd 2017 content? Can you share the link of the tutorial you are having an issue with?

Thank you, Meredith

AldoKing2018 commented 6 years ago

Hi @mhassett92 , Now it's correct! I've passed validation. Really, until yesterday morning I was trying everyday and validation was failing. I've tried in a private browser window. URL is https://www.sap.com/developer/tutorials/teched-2017-webide-odata.html

Thanks and best regards Alfredo