cancel
Showing results for 
Search instead for 
Did you mean: 

Uncaught TypeError: Cannot read property 'setHash' of undefined

shivamshukla12
Contributor
0 Kudos

Hi All ,

I am getting the below error when I am navigating from one view to other based on some event -

Uncaught TypeError: Cannot read property 'setHash' of undefined

Can anybody suggest what Could be the issue  ?

Thanks,

Shivam

Accepted Solutions (0)

Answers (4)

Answers (4)

PMarti
Active Participant
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Shivam,

You can check my reply in this thread.

http://scn.sap.com/thread/3898099

Note that I had XML views, but I got the same error, so the solution might be helpful for your problem as well.

Regards, Gabor

Former Member
0 Kudos

Hi Shivam, Have you found the solution for this error, i am also having the same problem. Uncaught TypeError: Cannot read property 'setHash' of undefined Thanks, Harsh

Former Member
0 Kudos

Hi Shivam,

Is it possible to give the screen shots of your code ? it helps to understand the issue.

Thanks.

Sarath.

shivamshukla12
Contributor
0 Kudos

Hi Chandra,

Below is the Screen Shot of Navigation  -

        Code in view.js

        

          Code in Controller.js  

    

      So when the Control is reaching at oRouter.navTo("detail") its throwing the above error.

Thanks,

Shivam

Former Member
0 Kudos

Hi Shiva,

Looks like your router is not able to find "detail". Please check that else give your routing configuration.

Thanks.

santhu_gowdaz
Active Contributor
0 Kudos

var detailview= sap.ui.getCore().byId("YOUR_DETAIL_VIEW_ID");

oRouter.navTo(detailview);

Former Member
0 Kudos

Please check your routing configuration. Could you share your component.js file

shivamshukla12
Contributor
0 Kudos

Hi ,

Please find below is the Routing Config  -

Thanks,

Shivam

vinay_kumar313
Explorer
0 Kudos

Hi Shivam,

You should give name inside navTo function, you are passing pattern, that's why it's throwing an error.

oRouter.navTo("ProductDetail");

Former Member
0 Kudos

Hi Shivam,

Route it to "productdetail" instead of detail.

Thanks.

Former Member
0 Kudos

Orouter.navto("productdetail"), should have the view name and not the pattern.

shivamshukla12
Contributor
0 Kudos

hi ,

So Pattern has no mean for Navigation. I also tried with the view name & still facing the same Problem

SO i thought to post the problem here .

Thanks,

Shivam

Former Member
0 Kudos

pattern is just a name that you can see in the URL when you navigate. Well it should work.

Have a look at this blog

vinay_kumar313
Explorer
0 Kudos

Hi Shivam,

Can you please maintain unique names. This resolve the issue.

{

              pattern : "",

              name : "productMaster",

              view : "ProductMaster",

            },

            {

                pattern : "detail",

               name : "productDetail",

              view : "ProductDetail",

              }