Code Monkey home page Code Monkey logo

Comments (6)

PhoneixS avatar PhoneixS commented on June 25, 2024

I also think that it is necessary to have validations before leaving a page. And the suggestion of implementation I think is a good way to do it.

from cjwizard.

PhoneixS avatar PhoneixS commented on June 25, 2024

[Copied from #9 ]

I think that this must be separated from access to buttons. What I think is we need a system to prevent the next to success more or less automatically and separated from access to buttons.

So you get:

  • An event driven that is called when next is begin to occur. A simply and integrated way to tell that the wizard don't must change the page (and a way for you to change text or show messages with the problems).
  • Access to buttons directly to modify them (for example for text, enable/disable, or whatever advance thing you need).

But is also recommended to have both, so in the event of "check before next" you can disable the buttons. For example:

  1. A page with loguing credentials. You don't know if they are correct until you try.
  2. The user fill the inputs and press Next.
  3. "Check before next" is called and you check if they are correct.
  4. They aren't so you change a label to tell the problem to the user and disable the Next button until it change the user or the password.

from cjwizard.

PhoneixS avatar PhoneixS commented on June 25, 2024

I thinking what is better, have a validation event (for next and finish) or directly have onNext() and onPrev() so you can also block the back movement (for example if the page use a connection that need to be closed if user leave the page).

from cjwizard.

PhoneixS avatar PhoneixS commented on June 25, 2024

As I have write in the pull request "Commit 4681f30 add settings argument on the onNext and onPrev but I'm not sure if is the better way as if a page need settings to take decisions the factory can pass it through the constructor."

@creswick What do you think is better?

from cjwizard.

creswick avatar creswick commented on June 25, 2024

The pull request looked good to me, but I'm not sure I understand the thing you're worried about:

but I'm not sure if is the better way as if a page need settings to take decisions the factory can pass it through the constructor.

Could you help me understand what might cause issues?

from cjwizard.

PhoneixS avatar PhoneixS commented on June 25, 2024

Because we force Pages to know about WizardSettings, making WizardSettings an all must know class and sometimes this indicate a bad design. It isn't bad by itself but can indicate a bad design.

from cjwizard.

Related Issues (20)

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.