Giter Site home page Giter Site logo

Comments (4)

jmpisson avatar jmpisson commented on June 18, 2024 1

Hi @carmineromano995! By design, I decided to make the validation aware only on the step, so currently it's not possible in a standardized way to set a variable on top of c-wizard-step - I have planned to include the parent directly on the validation, but I haven't work on this feature still.

Maybe the easiest way to share a context between your steps is to use a shared module between components - this way you could store the form state between all steps.

from lightning-wizard.

carmineromano995 avatar carmineromano995 commented on June 18, 2024 1

Hi @jmpisson,
I'll share a use case: I need to take some information from the User input in each Step and only in the last step use the user input/selection to do some operation (Eg: Insert a record). Each step can contain LWC child where the user makes some input info, chooses a row from a data table, or search record from a search bar. In the before-change event of each step, I would like to save the user input/selection in the parent LWC for using them in the last Step.

I hope I was clear.

Thanks

from lightning-wizard.

jmpisson avatar jmpisson commented on June 18, 2024

Hi @carmineromano99! Sorry for the delayed response; I will test the behaviour, but at first I think you should use this.querySelector('c-asset-move-search-account');. Your component c-asset-move-search-account is child from the template of c-wizard.

When you are triggering logic from c-wizard-step, c-asset-move-search-account lives on the slot, and it is not part from the parent template, so in this case you should use directly this.querySelector.

Hope it helps!

from lightning-wizard.

carmineromano995 avatar carmineromano995 commented on June 18, 2024

Hi @jmpisson It works, thanks a lot.

Do you know if It's possible to set variables in a parent lwc of c-wizard-step?
When the method set in the before-change attribute fires, "this" variable is set on c-wizard-step.
For example in the LWC createAccountWizard I created a variable that I would set in the before-change method of step 1.
When I'm in the Step 2 the variable of createAccountWizard is Undefined

from lightning-wizard.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.