In case of bookmarks.Hash routing not working with SAPUI5

Hi All,
I have the below code with in SAPUI5
The issue is that the url is correctly set when navigation from entry screen to detailed screen and also proper navigation happens, but when detailed screen is bookmarked the navigation always takes back to entry screen.
For example:
In my entry screen below I enter 'hi' then press enter to navigate to deatiled screen and you can see that both URL and navigation are fine
But now if I bookmark or enter the URL 'http://localhost:8001/#/detailedScreen/1234' directly then instead of navigating to detailed screen, I am taken to entry screen.
Below is the code.
    App.js
    (function () {
        'use strict';   
        //registering the module path
        jQuery.sap.registerModulePath('appointy', 'javascript/appointy');   
        $.sap.require('sap.ui.core.routing.HashChanger');
        $.sap.require('sap.ui.core.routing.Route');
        $.sap.require('sap.ui.core.routing.Router');
        //Somewhere at the start of your application
        var oRoutes = {
            // name used for listening or navigating to this route
            "searchScreen": {
                "pattern": "detailedScreen/{id}" // will be the url and from has to be provided in the data
            "catchAll": {
                "pattern": ":all*:"
        var oRouter = new sap.ui.core.routing.Router(oRoutes);
    //this is used to retrieve the instance again
        oRouter.register("appRouter");
    //starts reacting on the hashchange + parses the current hash and notifies callbacks
        oRouter.initialize();
        //var iRouter = sap.ui.core.routing.Router.getRouter("appRouter");
        oRouter.attachRouteMatched(function (oEvent) {
            if (oEvent.getParameter("name") == "searchScreen") {
                _selectItemWithId(oEvent.getParameter("arguments").id);
            if (oEvent.getParameter("name") == "catchAll") {
                _setContent(mContent.home);
            //bind the this pointer to the callback
        }, this);
        var _selectItemWithId = function (id) {
            //implementation eg: select an item in a list
            var homeNext = sap.ui.view({
                type: sap.ui.core.mvc.ViewType.JS,
                id: 'homeNext',
                viewName: 'appointy.HomeNext'
            homeNext.getController().parameterId = id;
            sap.ui.getCore().byId("oShell").setContent(homeNext);   
        // build the application root view and place on page
        var oRootView = sap.ui.view({
            type: sap.ui.core.mvc.ViewType.JS,
            id: 'mainView',
            viewName: 'appointy.Main'
        var _setContent = function (oContent) {
            iShell.setContent(oContent, true);
        var mContent = {};
        var iShell = sap.ui.getCore().byId("oShell");
        mContent.home = sap.ui.view({
            type: sap.ui.core.mvc.ViewType.JS,
            id: 'homeView',
            viewName: 'appointy.Home'
        //setting initial content for oSHELL
        _setContent(mContent.home);
        //switching contents of oSHELL
        iShell.attachWorksetItemSelected(function (evt) {
            var key = evt.getParameter("key");
            iShell.setContent(mContent[key]); // switch content
        oRootView.placeAt('content');  
Main.view.js
    (function () {
        'use strict';
        sap.ui.jsview('appointy.Main', {
            getControllerName: function () {
                return 'appointy.Main';
            createContent: function (oController) {
                var oShell = new sap.ui.ux3.Shell('oShell');
                oShell.addWorksetItem(new sap.ui.ux3.NavigationItem({
                    key: "home",
                    text: "Home"
                return oShell;
            //local handling of events of this View
        sap.ui.controller('appointy.Main', {
            onInit: function () {
            onBeforeRendering: function () {
            onAfterRendering: function () {
            onExit: function () {
            model: null   
Home.view.js
(function () {
    'use strict';
    sap.ui.jsview('appointy.Home', {
        getControllerName: function () {
            return 'appointy.Home';
        createContent: function (oController) {
            var oSearchField = new sap.ui.commons.SearchField('js-business-search', {
                search: [ oController.onSearch, oController ]
            //oSearchField.attachSearch(oController.onSearch);  --> Alternative way to attach event trigger to the searchField
            var oLayout = new sap.ui.commons.layout.VerticalLayout({
                width : "100%"
            oLayout.addContent(oSearchField);
            return oLayout;
    sap.ui.controller('appointy.Home', {
        onSearch: function(oEvent) {   
            //using Routing example
            var changeURL = new sap.ui.core.routing.HashChanger ();
            var hash = 'detailedScreen' + '/' + oEvent.getParameter("query")
            changeURL.setHash(hash);
        onInit: function () {
        onBeforeRendering: function () {
        onAfterRendering: function () {
        onExit: function () {
        model: null
HomeNext.view.js
(function () {
    'use strict';
    sap.ui.jsview('appointy.HomeNext', {
        getControllerName: function () {
            return 'appointy.HomeNext';
        createContent: function (oController) {
            var oLabel = new sap.ui.commons.Label("l2");
            //oLabel.setText(sap.ui.getCore().byId('js-business-search').getValue());
            oLabel.setDesign(sap.ui.commons.LabelDesign.Bold);
            var oLayout = new sap.ui.commons.layout.VerticalLayout({
                width : "100%"
            oLayout.addContent(oLabel);
            return oLayout;
      sap.ui.controller('appointy.HomeNext', {
        onInit: function () {
        onBeforeRendering: function () {
            var that = this,
                oLabel = sap.ui.getCore().byId('l2');
            oLabel.setText(that.parameterId);
        onAfterRendering: function () {
        onExit: function () {
        showAlert: function(sChannelId, sEventId, oParam) {
            alert(oParam.searchQuery);
        parameterId: null,
        model: null
Regards,
Chidan

You can open the JSBin in "Output Only (with live reload)" mode in a separate window, and in that window (tab) the URL can change.
Here is a incomplete routing sandbox on JSBin (open each in a separate window, note that JSBin may want to update the revision from 3 to 4):
Edit URL: http://jsbin.com/bamuh/3/edit?js
Output URL: http://jsbin.com/bamuh/3#square
(change the hash manually to #circle to see the routing trigger)
Enjoy,
Shawn

Similar Messages

  • Bookmark Deduplicator is not working with Firefox 35. What should I do?

    It was working before I installed the newest version of Firefox. Now, every time I press start to delete duplicates, nothing happens. Please help me figure out what to do. I'm using Mac 10.9.5. Thanks!

    You will have to wait for an update.
    *https://addons.mozilla.org/en-US/firefox/addon/bookmark-deduplicator/reviews/664304/

  • Comcast Cable Internet not working with router (WRT54G), but network is fine?

    My Comcast Cable Internet is not working with my router (WRT54G), but my home network is fine. The internet works without router.
    I have a WRT54G Wireless-G Broadband Router from Linksys.
    I was using Bellsouth DSL Internet up until two weeks ago.
    I had my DSL modem connected to my router, and the router let me use the internet and share some files and printers with my laptop upstairs.
    A few weeks ago we changed to Comcast cable. The technician came in and connected it himself, but only for the desktop. The internet worked perfectly, and still works perfectly on my desktop (the one downstairs). He didn't really give me any instruction or CD-roms for it.
    When I tried connecting my router, the internet stopped working. It was weird because the router worked for the file sharing and printer sharing between both my computers, but the internet didn't work. Although, the light for the internet is lit on the router itself.
    I even have this program called "AOL Network Magic" which shows a map of what is connected to the router, and it shows that the router and my laptop and desktop are connected, but then it has an "X" for the internet connection.
    I have tried everything. I lost all of my CDs and things that came with Linksys, but I downloaded some guides from the Linksys website and it doesn't really help. I tried something called "NetSet", but after I set everything up it says my router is not compatible or something with NetSet. I read a bunch of FAQs, I tried going to comcast and seeing if they had any FAQS about it, but I can't find anything.
    Maybe one of you can help me?
    Also, I don't know my modem's IP address. I had it for Bellsouth, and sometimes when I would lose my connection I would go there and click on "reconnect" or something like that.
    So the only way I can use the internet is to disconnect everything from my router and connect the ethernet cable directly to the modem.

    You may open the web setup utility page of the router by typing its IP address on your browser's address bar. By default, it is 192.168.1.1.  When you're asked for username, you may leave it blank.  For password, its "admin". If in case that does not work, reset your router at the back for 30 secs and do a power cycle again, see if it becomes accessible after that...
    "The war between heaven and hell depends on the choices we make, and those choices require sacrifice. That's the test"

  • My itunes 11 Home sharing is not working with my windows 7 PC and iPad it shows up on iPad and when I go to share the music app does loading for 3 mins and crashes I am using a virgin super hub router please please please help

    My itunes 11 Home sharing is not working with my windows 7 PC and iPad it shows up on iPad and when I go to share the music app does loading for 3 mins and crashes I am using a virgin super hub router please please please help

    My itunes 11 Home sharing is not working with my windows 7 PC and iPad it shows up on iPad and when I go to share the music app does loading for 3 mins and crashes I am using a virgin super hub router please please please help

  • Bookmark bar does not work on one of my computers - w XP

    Firefox 4.0 - the bookmark bar does not work. It appears but will not accept drags.
    PC w Windows XP - 3.
    Another thing too - The open new tab does not show up at all, in order to open a new tab I had to put the "open new tab" tab into the navigation toolbar.
    (Works fine on my other computer, & it drives me nuts to have to use Firefox w 2 different setups...)

    What's the URL of your site so we can examine it first hand?  Have you tried republishing your site with the File ➙ Publish Entire Site menu option?
    OT

  • Back To My Mac to a Time Capsule through a 3Com Router not working

    I have a Mac Book Pro (10.5.7), Time Capsule (7.4.1), 3Com Office Connect Wireless Router (3CRWDR101A-75), a trial subscription to Mobile Me and a 2.5G iPhone (2.2.1).
    I have been unable to get BTTM from my Mac on a remote wireless connection to my Time Capsule working - hence this post.
    The set up of the Time Capsule was quite straightforward (as I would have expected from Apple) and I quickly established local and remote iCal / Address Book sync between my Mac, www.me.com and my iPhone. I have enabled and am the 2.4 and 5GHz bands on the Time Capsule and the wireless air interface on the 3Com router has been turned off. All of internet and email services on my Mac work well locally and Time Machine work. So far so good.
    However, I am unable to 'see' my Time Capsule in Finder from any WiFi network that is not my home network. When at home I have full access to Time Capsule's disk.
    My 3Com Office Router 3CRWDR101A-75 is not on the list of supported routers (nor is any other 3Com Router) but it does provide UPnP and NAT as required according to Mobile Sync notes including http://support.apple.com/kb/HT1552 and http://support.apple.com/kb/HT1552. Despite my best efforts, I have been unable to find out from Apple's MobileMe support if there are any minimum requirements for any router to work with Back To My Mac so can't check to see if my 3Com router will ever work with BTTM or not.
    Does anyone have any similar experience with setting up a 3Com Office Connect router to work with Back to My Mac?
    Do I need to check / Can I check if my Time Capsule has been registered with the Mobile Me servers?
    Do I need to enable any specific ports on my 3Com Office Connect router?
    Basic settings:
    Time Capsule: green light - all OK
    AirPort Utility>Internet: Connection Sharing: Off (Bridge Mode)
    AirPort Utility>Advanced>Mobile me: account set up
    AirPort Utility>Advanced>IPv6: IPv6 mode = Node, at the request of Apple Mobile Me support
    System Preferences>Mobile Me>BackToMy Mac: On (green light).
    3Com Office Connect Router: DCHP server: On
    3Com Office Connect Router: Firewall level: High (default)
    3Com Office Connect Router: Disable NAT: Off (default)
    3Com Office Connect Router: Enable Universal Plug & Play: On
    3Com Office Connect Router: Enable IPSEC-NAT pass through: ON, at the request of Apple Mobile me support
    Com Office Connect Router: DMZ: enable 1-to-1 NAT: Off (default)
    Any ideas?
    Thanks.

    Quick update on troubleshooting BTTM (or rather Back To My Time Capsule)...
    Surprising;y, no 3Com products listed in http://support.apple.com/kb/TS1304. 3Com tech support stated that no OfficeConnect products have been qualified against BTTM and my specific router does not support IPv6 over IPv4 encapsulation.
    MobileMe support were not able to help, citing the fact that I had an unsupported router.
    I have made no change to my modem/router config since first posted but since an upgrade of my TC to 7.4.2 I have been able to use BTTM with my TC (bridge mode) and my OfficeConnect modem/router (802.11b WiFi disabled).
    I have made limited testing from other remote locations from my MBP and also proved that it worked over a 3G/UMTS connection on the UK's 02 network also
    MobileMe still reporting uPnP / NAT problem on my MBP when working remotely though.
    http://discussions.apple.com/message.jspa?messageID=9733258 confirms that this has been solved and, apart from the anomalous Mobileme status message, I can agree.
    Good news so now do not need to swap out my 3Com router. Also shows that this 3Com product does meet BTTM connectivity requirements.
    Message was edited by: Elise49
    Message was edited by: Elise49

  • Bookmarks and Hyperlinks not Working in PDF's

    Hi,
    I have 2 pdf files, one has extensive bookmarks which do not work. The other pdf has anchor links to refer you to certain areas in the document some work and some do not. How can i fix this in Acrobat Pro 11

    Hi,
    Thanks, I have found the actions details and can set the pages I want. The
    other file has hyperlinks to anchor text I think, not bookmarks, but when
    you right click there is no info given only document properties. Any idea
    how I can fix those links in the pdf. And again thanks for your help.
    Mary
    On Thu, Feb 27, 2014 at 8:55 AM, Gilad D (try67)

  • Fast dial (visual bookmarks) does not work with the new 5.0 upgrade. How do I correct this issue

    fast dial (visual bookmarks) does not work with the new 5.0 upgrade. How do I correct this issue Asked this question yesterday. I desperately need info, will I ever be able to use fast dial again?

    I tried it and it WORKED....I even tried the other version BEFORE this one and it didn't work so I tried yours and it worked like a charm so THANKS brother....

  • Router Problem - Works with Windoze, Linux, but not with Mac

    I can't seem to get any router to work with my Mac.
    I've tried a Linksys 'b' router, a Netgear 'g' router and a Belkin 'g' router.
    No joy.
    When I connect my Mac directly to my cable modem (Motorola Surfboard), there are no issues. When I connect the router in between, the Mac pulls the proper ip address and I can ping the router, but I can't get any further. If I try to ping an outside ip address (such as the 4.2.2.2 dns) I get the error message "ping: sendto: Cannot allocate memory". [Does anyone know what this message means?]
    A second computer (IBM NetVista) connects reliably using Windoze XP. The same machine, booted in CentOS also connects reliably (after disabling the firewall).
    Note, these are all wired connections. I'm not even trying to use wireless yet. The cables all check out, since they all work in other configurations (the Mac->router cable is the same one I use for Mac->Surfboard, and the router->surfboard cable works when connecting from the NewVista machine.
    I thought the Mac problems might be firewall related. I had "Brickhouse" installed,but it has since been removed. My network settings no long advise that there is any firewall software in place (previously Sharing > Firewall was greyed out with message that other firewall software was installed). Sharing > Firewall now reports "Firewall Off".
    I know the routers work, since I can connect from the NetVista machine. I know the cables are good, because they all work in other configurations. I know the Mac is seeing the router, and the router is seeing the Mac because a correct ip address is pulled. I can even communicate between the machines (ftp,ssh) but I can't get internet access using the Mac through the router.
    Oh yeah... one other oddity. When I have personal web sharing enabled, an attempt to access the router setup page at 192.168.1.1 fetches the local server index.html page instead of accessing the router. When web sharing is off, I get a "you are not connected to the internet" message.
    Any insight?

    Very strange indeed!
    Only 2 suggestions at this point...
    Get Applejack...
    http://www.versiontracker.com/dyn/moreinfo/macosx/19596
    After installing, reboot holding down CMD+s, then when the prompt shows, type in...
    applejack AUTO
    Then let it do all 5 of it's things.
    At least it'll eliminate some questions if it doesn't fix it.
    The 5 things it does are...
    Correct any Disk problems.
    Repair Permissions.
    Clear out Cache Files.
    Repair/check several plist files.
    Dump the VM files for a fresh start.
    Try dragging these files to the Desktop & Reboot...
    /Users/nnnn/Library/Preferences/com.apple.internetconnect.plist
    /Library/Preferences/SystemConfiguration/preferences.plist
    /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist
    /Library/Preferences/com.apple.sharing.firewall.plist

  • You must have connected the Time Capsule with a router that does not work with my direct cable from my ISP

    you must have connected the Time Capsule with a router that does not work with my direct cable from my ISP

    I tried to answer in your other post.. please stick to one thread ..
    What method of internet do you have.. is this fibre install.. if so the TC should just plug in and use dhcp in router mode.. press and hold the reset and it will go back to router mode by default.

  • Printer not working with new router

    I have a new router and my laptop with Windows XP is working Ok
    My printer Deskjet 3520 network test result shows successful setup But it does not print when laptop requests
    What can I do

    Hi @Jobrig,
    Welcome to the HP Forums!
    I see that your HP Deskjet 3520 is not working with your new router, and I am happy to help with this connection issue!
    For further assistance, I will need to know: if you are using a Windows or Mac Operating System, and the version number. To find the exact version, visit this link. Whatsmyos, and if the printer is able to make copies.
    In the meantime, please see the following:
    This printing guide, Print Jobs are Stuck in the Print Queue.
    This website, HP Wireless Printing Center, may also help.
    Hope these guides will help you, and thank you for posting!
    RnRMusicMan
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to say “Thanks” for helping!

  • My Siri and microphone in other apps hasn't been working lately. I've cleaned the mics, took off te case, and it's still not working. My camera only picks up audio when it's off of vibrate. And now I can't answer texts with the new pull down thing.

    My Siri and microphone in other apps hasn't been working lately. I've cleaned the mics, took off te case, and it's still not working. My camera only picks up audio when it's off of vibrate. And now I can't answer texts with the new pull down thing. please help

    Hello Sarahd200037,
    Thanks for using Apple Support Communities.
    To troubleshoot the microphone on your iPhone please follow the steps in the article linked to below.
    iPhone: Microphone issues
    Take care,
    Alex H.

  • HT201412 Safari could not open the page because the server stopped responding- new ipad mini's (2 from separate places) are not working with At & T router but computers work. Can you please help me. I've tried everything. Thanks ya'll!

    Safari could not open the page on my new ipad mini's because the server stopped responding- new ipad mini's (2 from separate places) are not working with At & T router but computers work fine. Yesterday I got it to work. Weird. Can you please help me. I've tried everything. Thanks ya'll!

    Hello SavannahSweetie,
    I was looking into the issue you are desribing, and found a great article for troubleshooting wifi connections with iOS devices. It's called iOS: Troubleshooting Wi-Fi networks and connections and can be found here: http://support.apple.com/kb/ts1398.
    Start with this section, and work your way down if needed.
    Basic troubleshooting
    Tap Settings > Wi-Fi and turn Wi-Fi off and then on again.
    Verify that you are in range of your Wi-Fi router or base station.
    Confirm that your Wi-Fi router and Cable/DSL modem are connected to power and turned on.
    Check whether other devices (portable computers, for example) are able to connect to the Wi-Fi network and access the Internet.
    Update your Wi-Fi router to the latest firmware.For AirPort Base Stations, refer to this article for information about firmware updates. For third-party Wi-Fi routers, check the manufacturer's website for details on updating your firmware.
    Restart your iOS deviceHold the On/Off button until "slide to power off" appears. Slide to power off your device. When it is off, press the On/Off button to turn it back on.
    All the best,
    Sterling

  • The sleep/wake function would not show in general to turn it on. I have a Targus case but the function will not work. What's going on?

    The sleep/wake function would not show in general to turn it on. I have a Targus case but the function will not work? The place it should be their is. Auto lock,  Password lock,  and Restrictions

    Keirosform wrote:
    The sleep/wake function would not show in general to turn it on.
    Ther is no "sleep/wake" setting in Settings > General.
    Auto lock,  Password lock,  and Restrictions
    Yes, these are the only three settings..
    I have a Targus case but the function will not work?
    What function? It won't go to sleep?
    Press the Power button on top. Does it sleep?

  • Hp Photosmart not working with new router

    My Hp Photosmart D110a will not work wirelessly with my new Netgear N600 router. This is the second new router I have tried. With the first one Belkin I could at least get it to print from my PCs. But never with my IPad. Now the printer will not print from anything. I have reset it, entered new passwords etc. spent hours on the phone with tech support. What to do now?

    @Ann99, welcome to the forums
    I understand your Photosmart D110a model is not working with your new router. I will gladly do my best to help you.
    I have some questions and some things for you to try.
    1. Is the printer connecting to the wireless network successfully when you run the wireless setup wizard from the printers front panel or is the printer not found when you are running the installation from your PC?
    2. What did tech support determine the issue was when you called them?
    3. Here are some guides for you to try, these 2 guides relate to the questions I had asked in the first question:
    Unable to Connect to a Wireless Network When Using WEP Encryption and Shared Key Authentication
    The Printer Is Not Found During a Wireless Network Installation
    4. What Operating System are you running on your computer?
    5. Where are you running the installation from (disk, download or HP Printer Install Wizard for Windows for Windows)?
    Please let me know all of the information and results from your troubleshooting above!
    Have a terrific day
    R a i n b o w 7000I work on behalf of HP
    Click the “Kudos Thumbs Up" at the bottom of this post to say
    “Thanks” for helping!
    Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution!

Maybe you are looking for

  • BI Content Upgrade Question

    Hi SDNers I am sure that I will get answer to my question. We are currently on Add on Package BI Content 3.5.2 on SAP Netweaver04. As per SAP Recommendation if we are going for BW 3.5 SP19 then we should have BI Content 3.5.3. We need to know that wh

  • Faulting application iexplore.exe, faulting module jvm.dll

    I see there are a few posts on this sort of problem, but please bear with me as this is somewhat different. I develop a browser Add-on and one of my customers is experiencing an IE7 crash using Oracle/Jinitiator, with an event log message: Faulting a

  • Cisco ACS 4.2 TACACS+ Administration report - Help!

    we had some switches mysteriously reloaded.  Upon investigation, TACACS+ Administration report show no user login to the device, no command was issued, and the reason = reload. how could this happen?

  • Cost of creating org.w3c.dom.Node

    I am trying to create an xml of cached data at run time. I need to know if this would increase the response time considerably ..? Is there any documents which talk about the cost of creating nodes(e.g.within loops) ..? public Node createnode(Document

  • Optical audio out turns off during silence

    My optical audio out port turns off when no sound is being played. When a sound is played my speakers pop as the receiver switches into optical mode. This takes a second so I miss system sounds. I would like to set the optical out to always stay on,