Page 1 of 1
Stop Step Changing

Posted:
16 Nov 2016 11:34
by MikeC
I'm sure this is really simple, but the answer is eluding me. I'm using OnBeforeStepChanging in the CGJQWizard to validate a user's entries and if they're not OK, I want to stop them moving to the next step. How do I do that?
Re: Stop Step Changing

Posted:
16 Nov 2016 12:47
by Alexander Bulei
Hello,
Please use the OnStepChanging event...and there, you can decide if going to next/prev:
- Code: Select all
IWCGJQWizard1.Next;
- Code: Select all
IWCGJQWizard1.Previous;
To get the direction:
- Code: Select all
Dir:= AParams.Values['dir'];
To get the new index:
- Code: Select all
nextIndex:= StrToInt(AParams.Values['newIndex']);
Best Regards.
Re: Stop Step Changing

Posted:
16 Nov 2016 16:24
by MikeC
Thanks. The "newIndex" (or "currentIndex") paramas don't appear to be included in AParams - although "dir" is. Perhaps I'm doing something wrong. I can get the info from ActiveStep Index of course.
Re: Stop Step Changing

Posted:
16 Nov 2016 17:18
by Alexander Bulei
Hi MikeC,
The "newIndex" (or "currentIndex") paramas don't appear to be included in AParams - although "dir" is.
Sorry, my fault...I forgot to mention, you need have SendAllArguments = True:
- Code: Select all
IWCGJQWizard1.JQWizardOptions.OnStepChanging.SendAllArguments := True;
Best Regards.
Re: Stop Step Changing

Posted:
18 Nov 2016 15:56
by MikeC
Great, thanks! I do have the same issue as Montse Carver with this Wizard - the event is firing more than once. I understand this is fixed in the next build. Any idea if the date?

Re: Stop Step Changing

Posted:
18 Nov 2016 17:13
by Alexander Bulei
Hello,
Already uploaded.
Best Regards.
Re: Stop Step Changing

Posted:
06 Dec 2016 15:42
by MCarver
Does this correspondence suggest that the "OnBeforeStepChanging" is deprecated? How is the event to be used, as I notice it is no longer firing with the recent updates?
Please advise...
Regards,
Monte Carver
Re: Stop Step Changing

Posted:
06 Dec 2016 15:44
by Alexander Bulei
Hello,
Nothing was deprecated...but YES, improved:
viewtopic.php?f=147&t=3105#p15492Use this way...
Best Regards.
Re: Stop Step Changing

Posted:
06 Dec 2016 16:26
by MCarver
Alexander,
I am still not clear. Prior to a recent updated the OnBeforeStepChanging would fire. Now it does not. And I understand the suggestion to use "OnStepChanging". The REAL question is what is difference between OnBefore and Changing. When does one employ the OnBefore? Does one disregard this event moving forward?
Thanks for the clarification.
Monte
Re: Stop Step Changing

Posted:
07 Dec 2016 11:22
by Alexander Bulei
Hi MCarver,
I found the problem in jquery plugin..it was design bug...anyway fixed in published beta (3.0.0.101).
Thanks.
Best Regards.