CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Stop Step Changing

by MikeC » 16 Nov 2016 11:34

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?
MikeC
 
Posts: 35
Joined: 26 Sep 2015 09:24

by Alexander Bulei » 16 Nov 2016 12:47

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.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by MikeC » 16 Nov 2016 16:24

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.
MikeC
 
Posts: 35
Joined: 26 Sep 2015 09:24

by Alexander Bulei » 16 Nov 2016 17:18

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.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by MikeC » 18 Nov 2016 15:56

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? :-)
MikeC
 
Posts: 35
Joined: 26 Sep 2015 09:24

by Alexander Bulei » 18 Nov 2016 17:13

Hello,

Already uploaded.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by MCarver » 06 Dec 2016 15:42

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
MCarver
 
Posts: 48
Joined: 27 Sep 2013 19:15

by Alexander Bulei » 06 Dec 2016 15:44

Hello,

Nothing was deprecated...but YES, improved:

viewtopic.php?f=147&t=3105#p15492

Use this way...

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by MCarver » 06 Dec 2016 16:26

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
MCarver
 
Posts: 48
Joined: 27 Sep 2013 19:15

by Alexander Bulei » 07 Dec 2016 11:22

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.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQWizard

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.