DDFieldExitMessage - cWebBaseDEO
Executes the DDO field exit message for the data column bound to this DEO
Type: Procedure
Syntax
Procedure DDFieldExitMessage
Call Example
Send DDFieldExitMessage
Description
DataDictionary objects (DDOs) have field entry and exit messages associated with each DD column. In Windows applications, these messages are sent during focus entry and exit. With web applications, these messages are not automatically sent. This process is not automatic because 1) this would increase the number of round trips between a client and server, 2) the asynchronous nature of the browser-server communication makes focus entering and exiting problematic (the focus change has already occurred) and 3) these DD field messages were often defined to work with Windows data entry objects (DEOs) and do not work properly with web controls.
The normal web focus entry event is OnFocus and the web focus exit event is OnBlur. By default, these events are not sent to the server and if they were, they would do nothing. If you wish to use these events on the server, you must enable them by setting pbServerOnFocus or pbServerOnBlur to True and then create whatever code you wish in the OnFocus and OnBlur events. If you wish to bind these events to your DD field entering and exiting messages, you must do so manually inside of these events. You can do this using DDFieldEntryMessage and DDFieldExitMessage messages.
Object oCustomerCustomer_Number is a cWebForm
Entry_Item Customer.Customer_Number
Set pbServerOnBlur to True
Procedure OnFocus
Send DDFieldExitMessage
End_Procedure
End_Object
Note that these events cannot be used to stop the focus change. They can be used to move the focus elsewhere, but this should be used with care as the asynchronous nature of the browser-server focus change may not feel smooth. If possible, avoid using server side focus and blur events.
A common use of the OnBlur/Exiting message is to update other controls based on what you just entered. This is particularly true when the entry may result in a find or autofind. In such a case, the DDO's OnPostFind might be a better place to perform this "exiting" action.
Object oInvt_DD is a Invt_DataDictionary
Set DDO_Server To oVendor_DD
Procedure OnPostFind Integer eMessage Boolean bFound
Boolean bSynching
// Each time an inventory item is selected we use the unit price as the
// suggested price for the line item.
Get AppSynching to bSynching
// Do not perform this action while synchronizing DDO's to the WebApp Client
If (not(bSynching)) Begin
Send SetPriceDefault of oOrderDtl_DD Invt.Unit_Price
End
End_Procedure
End_Object