OI Form Defaults vs. AREV Defaults (OpenInsight 32-Bit)
At 12 NOV 2010 01:36:36PM Dietrich Neuman wrote:
OI Form Defaults vs. AREV Defaults
I'm converting a bunch of AREV collector windows to OpenInsight forms. There are a lot of fields with Defaults specified; some simple default values, others long procedures in FORMNAME.PROMPT code.
I've noticed that the UI behavior of defaults in OI is quite different from AREV. In AREV, a default value is filled in when a user hits ENTER on an empty field, whereas in OI, the default value is filled in immediately as the user sets focus to the field control. Our users don't like the OI implementation – it's disconcerting in our application to have to clear out a field immediately after positioning on it.
Is there any way in OI to define the form, or all forms an an app, to fill in a default value only when the user TAB's off the field? If not, are there any plans to implement that in an upcoming version of AREV? If not, I can program my own Default implementation. But I just wanted to check so I don't end up re-inventing the wheel.
At 12 NOV 2010 07:25PM Barry Stevens wrote:
If the value is highlited (SELECTION), the user just types over anyway, no big deal, with the added advantage can easily make null if not mandatory.
At 13 NOV 2010 02:34AM dbakke@srpcs.com's Don Bakke wrote:
Dietrich,
OI is not "AREV for Windows" so you will invariably miss certain features. OI was designed to be a true Windows application (albeit there are some throwbacks to AREV that make this partially untrue). Pre-filling a field with a default value is a Windows standard.
Fortunately OI is very flexible and you can implement your own solution rather easily using the LOSTFOCUS event. Probably the biggest challenge (or nuisance) will be the effort to implement this on a global basis. Obviously you would like to avoid having to implement a LOSTFOCUS event handler for every field that needs to support your default strategy.
This is where the concept of promoted events will become very useful. I'm assuming you are developing with a relatively current version of OI. I recommend you read the Promoted Events article within Chapter 10 of the Programmer's Reference Guide.
This article does a good job of explaining what promoted events are and how they work. It also gives you instructions on how to create promoted events. However, this documentation (at least through OI 9.2) doesn't tell you that Revelation have introduced a nice tool that creates promoted events for you. For that just open up the User Interface Workspace and then run the Event Designer from the Tools menu. There is a button called Generate Promoted Code. You can click on the Help button on this form and it will give you more information.
dbakke@srpcs.com
At 15 NOV 2010 05:15PM Dietrich Neuman wrote:
Thanks, Don! At the time of the original posting, I was just starting to design a system using LOSTFOCUS and other events, and I was prepared to accept the nuisance of implementing it globally. Thank you, thank you for pointing me to Promoted Events, and the undocumented Generate Promoted Code feature. I just implemented prototype code using that. It works, and it's just what I need.
Yeah, this is not Windows standard…. but this is one of several features of this app I'm converting where I have to weigh the benefits of up-to-date Windows standard behavior vs. UI behavior that the original app was designed around, that may be easier and/or more intuitive than the rough equivalent in standard Windows forms.