• Maulik Patel 38
  • NEWBIE
  • 19 Points
  • Member since 2020

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

I have a requirement where I am using conditonal rendering in the LWC. 
I have 3 child components and I am using record-edit form for inserting the data in the child components whose visiblity is maintained in parent component.
The way it works is l have next button and previous button so when I fill the details in the initial component which is having account input fields and click on next  the conditional rendering shows the second component which is contact input field and hides the first one and it has two buttons next and previous.
Now when I click on previous the data that i entered earlier is not showing and it is just showing the blank input fields in the Account input fields so the data that i entered earlier is reset.
Is there a way where when i click on previous it cache or stores the data that i entered earlier in the input fields?  

I was not able to copy the whole code here but I used the code form the GitHub repo link.
https://github.com/ShreyasD/lwc-customaccountwizard

The only change I made was in the contactDetails.js for handlePrevious(event) as below 
handlePrevious(event) {
        event.preventDefault(); //stop default action
        //Send event to parent to go to next page
        this.dispatchEvent(new CustomEvent('previous'));
    }


Parent Component -: customAccountWizard
Child Component =: accountDetails,contactDetails and customAccountWizardReview.


Thank you !

 
Hello Everyone,
I have two lightning web components and I have to navigate from one LWC to another LWC on button click. 
I tried navigation service to apply the NavigationMixin function in component’s base class to extends NavigationMixin(LightningElement).but it dint work.

can please anyone help me?
Thank you.
 
  • September 18, 2019
  • Like
  • 0