guys!
So, I havehad a problem with navigation. I'm trainingnavigating from Parent component to implement isUrlAccessibleChild component, but it's not working for meit was solved. But now I have a form with one input field and button, which, on click, should redirect me to another form. But I'm getting error: "Page doesn't exist"even more strange problem.
AlsoSo, how do you pull valueI did navigation from parent component input and put it into childParent component input? Here isto the Child one, but I also need to make navigation from Child component to Baby component. I used exact same code: for .js methods and same edits for components, but still, it doesn't work.
({
onPageReferenceChange: function(cmp, evt, helper) {
var myPageRef = cmp.get("v.pageReference");
var requiredFor = myPageRef.state.c__requiredFor;
cmp.set("v.requiredFor", requiredFor);
},
doInit: function(component, event, helper){
}})
Baby component:
<aura:component implements="force:appHostable, lightning:isUrlAddressable" access="global">
<aura:attribute name="parentRecord" type="string" required="true" default="test type" />
<aura:attribute name="pageReference" type="object" />
<aura:handler name="init" value="{!this}" action="{!c.onPageReferenceChange}" />
<aura:handler name="change" value="{!v.pageReference}" action="{!c.onPageReferenceChange}"/>
<lightning:navigation aura:id="navService"/>
<div style="align-content: center">
<div class="c-container slds-theme_default custom-container">
<lightning:layout multipleRows="true">
<lightning:layoutItem padding="around-small" size="12">
<div class="page-section page-header slds-align_absolute-center">
<h1>
New Product Required
</h1>
</div>
</lightning:layoutItem>
<div style="align-content: center;">
<lightning:layoutItem padding="around-small" size="12">
<lightning:layout>
<lightning:layoutItem padding="around-small" size="4">
<div class="page-section page-main custom-form">
<div class="custom-input">
<lightning:input aura:id="parentRecord" value="{!v.parentRecord}" label="Parent Record" required="true" />
<lightning:button variant="brand" class="slds-float_right" label="Next" />
</div>
</div>
</lightning:layoutItem>
</lightning:layout>
</lightning:layoutItem>
</div>
</lightning:layout>
</div>
</div>
</aura:component>
Baby component controller:
({
doInit : function(component, event, helper) {
},
onPageReferenceChange: function (cmp, evt, helper) {
var myPageRef = cmp.get("v.pageReference");
var parentRecord = myPageRef.state.c__parentRecord;
cmp.set("v.parentRecord", parentRecord);
}})