Other than the sparse documentation example code I couldn't find any that shows regarding lightning:navigation
and lightning:isUrlAddressable
.
I couldn't get this simple example to run.
navigateTo.component (API 43)
<aura:component .. implements="force:hasRecordId,lightning:isUrlAddressable">
</aura:component>
navigateFrom.component (API 43)
<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId">
<lightning:navigation aura:id="nav" />
</aura:component>
navigateFromController.js (API 43)
({
foo: function(cmp, evt, helper) {
cmp.find("nav").navigate({
type: "standard__component",
attributes: {
componentName: "MYNAMESPACE__navigateTo"
},
state: {
recordId: cmp.get("v.recordId")
}
});
},
});
I also tried c__navigateTo
instead of MYNAMESPACE__naviagteTo
and moving recordId: cmp.get("v.recordId")
from state to attributes but in both no navigation takes place.
I am looking for an elegant solution where I DON'T have to touch the way how components get and set the v.recordId as describe in the solution by Mark Masterson.