cancel
Showing results for 
Search instead for 
Did you mean: 

SAP UI5 Shell - cancel Navigation between Navigation items

0 Kudos

Hi,

I am trying to cancel the navigation when toggling between two navigation items in UI5 Shell control,

like for example there are three navigation items nav_1(default item selected),nav_2,nav_3,  if I navigate to nav_2 I want some validation to happen and stop the navigation to nav_2 similar to other navigation items.

I tried using workItemSelected event to see where the navigation has taken place and I will not proceed to set the content for nav_2 this is all fine, but the problem is navigation has already taken place to nav_2 which I want to avoid.

I want some event handler which gets triggered before event "workItemSelected" so that I can stop the navigation, I could not find any...

anyone got better ideas, please suggest.

Thanks,

Kranthi.

Accepted Solutions (1)

Accepted Solutions (1)

PMarti
Active Participant
0 Kudos

Hi Kranthi,

You can use preventDefault to cancel navigation between worksetItems. Try this:


worksetItemSelected: function(oEvent) {

     if(validation....){

          // Navigate between worksetItems

     }else{

          oEvent.preventDefault();

     }

}

0 Kudos

Thanks... it did work.

Answers (0)