pbServerOnBlur - cWebBaseControl

Controls whether the OnBlur event is sent to the server when the control loses the focus at the client

Type: Property (Web Property)

Access: Read/Write

Data Type: Boolean

Parameters: None

 { WebProperty=Client }
 Property Boolean pbServerOnBlur

Web Property Read Access: WebGet pbServerOnBlur to BooleanVariable
Web Property Write Access: WebSet pbServerOnBlur to BooleanVariable/Value

Read Access: Get pbServerOnBlur to BooleanVariable
Write Access: Set pbServerOnBlur to BooleanVariable/Value


When the application user moves the focus from one control to another (by clicking or tabbing away from a control), then it is possible to trigger an OnBlur event at the server for the DataFlex object that represents the control that lost the focus.

Whether or not this event is sent to the server is controlled by the pbServerOnBlur property. When True, the OnBlur event will be sent to the server object when it loses the focus. By default, pbServerOnBlur is False.

You should try to avoid using server-side OnBlur and OnFocus events. They can be complicated to use and inefficient if used often.

Imagine if you had a view where every control sent OnFocus to the server when it received the focus and OnBlur when it lost the focus. This would mean that navigation from one control to another would send two calls to the server to process these events. Remember that each server call requires synchronization of the view's web properties and DataDictionary objects (DDOs). Since separate calls can be handled by different web application instances in the server's process pool, it means that it is possible for the OnFocus event of the control you are navigating to will finish before the OnBlur event of the control you navigated from. These are some of the issues you need to understand and consider when using server-side OnBlur and OnFocus events.

Often you can design your web application to avoid relying on OnBlur or OnFocus events. If there is no alternative, then you should consider using the client-side OnBlur and OnFocus events instead. Client side events are processed without the overhead of a server call and there are no latency or out-of-order issues to consider. The disadvantage of client-side events are that they need to be coded in JavaScript and you do not have access to any server-side resources or data. See psClientOnBlur and psClientOnFocus for more information.

About Web Properties
Each web property maintains two values: The regular property value is set during object creation and should not be changed during the lifetime of that object. To access that value, use the standard property Get and Set syntax.
The web property value is the local value stored at each client. This is synchronized to the client's local value whenever a server call is being processed. To access the web property value, use the WebGet and WebSet syntax above instead of the standard Get and Set syntax.
See Also