Using the ClientApp CustomComboBox control
| Exoware ..... | Tech Note |
| Using the ClientApp CustomComboBox Control | Eric Hartwell - January 2000 |
The ClientApp CustomComboBox control is used to specify the value
Intimate ties to the data dictionary:
- auto-complete variable names
- specified data type
- numeric, date, and character constants
- lookup tables
- add variables to the dictionary
Used as a control in HTML screens and/or the ClientApp grid control.
In the DOS version, each field had direct access to the data dictionary and current rule's variables through global pointers. While ClientApp normally runs in a single process space, so global pointers are theoretically available, it's not difficult to use a more generic approach where the plan pointer is explicitly passed to the control, and the control manages its data as a simple text string.
ClientAppField ActiveX Control
At this point, let's review an earlier, simpler control, the ClientAppField control. Originally called HTMLHelper, ClientAppField is a hidden ActiveX control that is embedded in each ClientApp HTML screen. While it does not directly display any data, ClientAppField is responsible for formatting the value of each field, interpreting the results, and collecting any changes and/or errors on the screen.
DHTML scripting code within the page triggers ClientAppField methods when the screen is first loaded, and whenever the value of an input field is changed. External code in the screen's container (i.e. ClientAppHtmlView) explicitly calls the CClientAppField::GetChanges method before navigating away from the screen (see Issuing commands to the HTML view).
ClientAppField is packaged as an ActiveX control so it can be used by remote clients in an Internet/Intranet application.
CustomComboBox Control
The CustomComboBox is used only by ClientApp, which is a stand-alone application. Since the document/view architecture has direct access to the HTML Document Object Model (DOM) (see Using the ClientApp HTML View automation classes), there's no need to jump through the same hoops as with ClientAppField.
At the same time, since ClientApp fields are intimately tied to the data dictionary and rule specifications, it makes sense to use the control as a visual control on the screen.
ActiveX control for HTML screens
subclassed field in ClientApp Grid control ActiveX control for Grid in HTML screens The CustomComboBox control is derived from the Enhanced Flat ComboBox control.
Dynamic Dropdown List
Sometimes the contents of the dropdown list aren't known until runtime, or the list is simply too big to be preloaded. In either case, the solution is to subclass the dropdown list and replace it with your own window.
- Q174667 - HOWTO: Subclass CListBox and CEdit Inside of CComboBox
- See: Drop down a popdown window instead of a dropdown list from a combobox
The dropdown list box can be easily subclassed.
Revisions
- January, 2000 - Initial version