custom back button issue

custom back button issue

Hi Sir,
In my application i put the custom back button.Some pages this button is working fine.and some pages it showing an error i have attached the screen shot for this.Kindly help me on this issue. My controller code is:

The code sample you provided here is working as expected. By defining your two items in your navigation view, you're essentially pushing both views at once with the last one getting the final rendering (MyAccount).

Here is an example that will demonstrate how to solve this along with a demonstration on how your original error most likely was triggered.

My example here is a tab panel. The first tab will demonstrate the successful behavior you desire. That first panel with the button could be like your login panel. On some sort of successful action, the MyAccount view is pushed onto the navigation view. Since this MyAccount instance is now a child of the navigation view, the controller code that listens for that back button tap will work.

The second tab renders the MyAccount view on a plain panel. When an attempt is made to tap that back button, you will see the error. This makes sense because this instance of MyAccount is not a child of a navigation view.

This is an example for demonstration purposes. You should still take a step back and consider whether the navigation view or perhaps a simple container with a card layout is what you really need. Nonetheless, this example works.