Re: NewEra 2.2 Superfield focusout() not working!!
Posted in 1997
Topics: Stored Procedures & SPL, Clustering, Grid & MACH11
Dirk Gunsthoevel wrote: > > Ian Tuck wrote: > > > > Tim Simpson wrote in article ... > > >I have a free form supertable and a button. I have discovered that the > > >focusout() event only happens when focus transfers to another > > >superfield. If the user tabs to the button instead, the focusout() event > > >doesn't happen until focus moves to another superfield!! > > >-- > > [many realworld and helpful remarks on focus in NewEra deleted] > > > >Tim Simpson > > > > > Hi there :> > > It is true that focus in NewEra sometimes produces non-intuitive > results. > > What I dont understand in your discussion is what these things > have to do with _Validation_. > > In fact I defined a framework for a giant over 100 screen > application (about 75% done) here. Focusin and FocusOut > Events are never used throughout the whole code. > > Why do you want to do validation with an event that returns > void and doesnt influence traversal between fields and > rows? You can make them influence traversal by calling an event that can return BOOLEAN, perform a focusCell and then return FALSE. > > beforeDataChanged and afterDataChanged are the right places to > do. beforedatachanged if you want the user to stay in a field > until he/she inputs something valid. afterDataChanged if > you allow traversal to another field even if non-valid > data was input (you then have to update a flag you access > in dataRowCheck to prevent the saving). > > These concepts are stable, reliable and fit into the > concept of cell-level and row-level validation. Dirk, BeforeDataChanged and AfterDataChanged are anything but stable, just ask Informix. Don't rely on them in a screen that has 2 supertables,especially if one is a gridform. > > The only situation where you could use focusOut meaningful > is the situation where the user inputs something and you > want to comment this for example by displaying a messageBox > giving more information about the thing the user input. > But then afterCell is the much better choice. This is if afterCell gets invoked. Not a reliable control either. It doesn't get invoked on the last cell of a gridForm supertable. Of course you can define a bogust last field with an infinitesimal width and focus to another control immediatly upon entry. Of course that is if focusIn works. Sometimes it does, sometimes it doesn't. > > I allways see novice users playing around with focus events > first. Probably because it seems to be an easy concept. > Usually it takes them some time until they find out that > this is not the right place to do things. Yes, but I have yet to see focusOut fail to get posted. BDCE and ADCE are flakey at best. > > I never visited a NewEra course myself but I get the > impression that they dont deal with the real-world problem > of data-validation enough there. I also never saw a > form of "how-to" on data validation. And you are right: > these thousends of manual pages are just wasted... they > are not helpful if you want to solve a problem. > No, the classes just glaze over datavalidation. Just some insite from another frustrated NEWERA developer. Bret.