0

I have a custom component button called Hello.cmp which opens a popup modal. The modal has multiple buttons called navA and navB which navigates to different page. The navA and navB are other custom aura components. The navigation happens in the same tab.

When i click on navA or navB button the navigation works fine but when i click on browser back button, the modal stays open and if i click on navA or navB button again, navigation does not work.

When i tried to see the error, i found an AuraError message: "Assertion Failed!: Event.fire(): Unable to fire event. Event has already been fired. : false"

I tried to disable cache, unchecked cache persistence related checkbox in session settings but nothing worked.

Navigation code

navigate: function(url){
        var navigate= $A.get("e.force:navigateToURL");
        navigate.setParams({
            "url": url
        });
        navigate.fire();
    }

So, any help or idea on how i can fire the event and may be auto close the modal as well when clicked on navA and navB button

0

This might not to be an answer but putting here for other people.

Instead of navigating using above approach, I tried using navService and navigation worked fine.

navService.generateUrl(reference)
        .then($A.getCallback(function(url) {
            var urlEvent = $A.get("e.force:navigateToURL");
            urlEvent.setParams({
                "url": url
            });
            urlEvent.fire();
        }), $A.getCallback(function(error) {

        }));
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.