• Alishba Asif 1
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi All.

I am trying to navigate from Component to Community buidler page and tried below code it did not work though I am not getting any error.

The button is not in Lighting app it is in commuity within the lightning component.

 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes">
 <lightning:navigation aura:id="navService"/>
 <lightning:button label="Navigate" onclick="{!c.handleClick}"/>
</aura:component>
({
    handleClick: function(cmp, event, helper) {
     var navService = cmp.find("navService");
     var pageReference = {
                         "type": "standard__component",
                         "attributes": {
                                         "componentName": "c__WebinarOverride"
                                       }, 
                         "state": {
                             'message':'This is the target page'
                         }
                        };
     navService.navigate(pageReference);
    }
})
 
({
	doInIt : function(component, event, helper) {
		 var id = component.get("v.pageReference").state.message; 
                 var toastEvent=$A.get('e.force:showToast');
                    toastEvent.setParams({
                      title:'Rendering page',
                      message:id,
                      key:'info_alt',
                      type:'info',
                      mode:'pester'
               });
        toastEvent.fire();
	}
})