StrataFrame Forum

Navigating event not impacting result value of Navigate() call

http://forum.strataframe.net/Topic16534.aspx

By maturmel - 5/22/2008

Hello,

I am trying to use the Navigating event on my business object to perform row validation through the CheckRules method. I have set CheckRulesBeforeNavigate to false because I have conditions under which I do not wish to perform the check. Hence the use of the Navigating event to control whether or not I check rules.

Even though I assign e.Cancel to 'true' in the Navigating event, the Navigate() method call on the BO will still return true. I would have expected a false in such a situation, to indicate me I have broken rules. I have stepped through my code and confirm that my Navigating handler gets called and that I indeed assign e.Cancel to true.

Since I had downloaded the SF source codeBigGrin, I have taken a quick look at the Navigate() method call and think I may have put a finger on the problem: the local variable "llIndexMoved" gets initialized to True. But it's not getting reassigned to false anywhere, and the code in the branch

If Not loNavigating.Cancel Then

...

does not get called either, since I have assigned True to the Cancel property in my event handler. So at the end of your method you're entering the

If llIndexMoved Then

...

conditional even though no real index move has occuredHehe...

Any way of working around this ? Can I expect a fix ?

Thanks for your help.Smile

Marc-Andre

By Trent L. Taylor - 5/22/2008

This has already been fixed.  It will be in the next update...and before you ask when the next update is Smile we will be posting another 1.6.6 beta in the next week or so.  So you can get it then.  We are in the middle of making a number of changes so just plopping out a fix on the forum isn't an option.  But in any case, we had already found this and it has already been addressed.
By maturmel - 5/22/2008

Great! Thanks a lot. I will be waiting for the 1.6.6 release before pushing my code to production.

Do you have an agenda so I can plan when it's going to happen? Like, do you think it's going to be in June, July or later ?

By Trent L. Taylor - 5/22/2008

I have already given you all of the information that I can give you at the moment.  We are using 1.6.6 in our production as we speak (for our medical application), so there is no reason that you cannot run on the beta posts...they are supported.

Past that, I cannot give you an exact date.