8 risposte
Thanks Gaurav,I had to implement it by creating event handler, registering and then firing the event. @VandanaRattan4Hi Vandana,Could you please send me the flow of the execution that what you did for force:navigateToURL.I have stucked in the same place...Please guide me... Yes, Same problem. see this link https://developer.salesforce.com/forums/ForumsMain?id=906F0000000BKZbIAO. Hi Anshuman,Apologies for a delayed response. You would have to make your attributes Application level instead of component level. I used this strategy to pass attributes from 1 component to other. But now strangely e.force:navigateToComponent is no longer working.Regards,Vandana Hi, I am able to navigate to the new component by using "e.force:navigateToComponent" but attributes are not getting passed. Please suggest.Regards I stand corrected - you would do this using the e.force:navigateToComponent method. Try thisIn your markup <ui:button label="ATTENDANCE" press="{!c.navigateToRollCall}"/>
In your controller, do something like
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others and improve the overall quality of Discussion Forums.navigateToRollCall : function(component, event, helper) {
var evt = $A.get("e.force:navigateToComponent");
evt.setParams({
componentDef: "c:AttendanceRollCall",
componentAttributes: {
programId: component.get("v.program.Id")
}
});
evt.fire();
}
Gaurav Kheterpal
Certified Force.com Developer| Salesforce Mobile Evangelist| Developer Forums Moderator| Dreamforce Speaker
Thanks for your reply Gaurav. Can you please help me understand how to form the lightning component URl?I know the URL of a lightning app is :-cs8.lightning.force.com/[ns]/[AppName].appHow can I form the compnent URL to be passed to navigateToURL function? You don't need to create separate Lightning apps for this. Just use
to redirect to the approprirate place.If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others and improve the overall quality of Discussion Forums.sforce.one.navigateToURL('Your component URL here');
Gaurav Kheterpal
Certified Force.com Developer| Salesforce Mobile Evangelist| Developer Forums Moderator| Dreamforce Speaker