Skip to Content

Handle Hashtag change

I want to handle a hashtag change in my SAPUI5 app. For examples sake, let's say I want to throw a popup with the value of the hashtag, what's the correct way to do it?

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 15, 2014 at 11:53 PM

    Hi Joao,

    I think you can use the sap.ui.core.routing.HashChanger to attach an "hashChanged" event handler.

    var oHashChanger = HashChanger.getInstance();
    
    oHashChanger.attachEvent("hashChanged", function(oEvent) {
      alert(oEvent.getParameter("newHash") + "," + oEvent.getParameter("oldHash"));
    });
    
    

    https://sapui5.netweaver.ondemand.com/sdk/#docs/api/symbols/sap.ui.core.routing.HashChanger.html

    Regards,

    Jason

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.