To continue with this content, please log in with your Data Access ID or create a new account.
Cancel Data Access ID
You may not be authorized to see this content. Please contact Data Access Europe for more information.
Cancel Data Access Europe
You are not authorized to see this content.
Cancel Data Access Europe
Next lesson:
Setting up the workspace
Cancel

Lesson 1: What is a Custom Control?

What is a custom control? 

Generally, a custom control is a reusable, visible DataFlex component that can be added to any view or WebApp.

There are two sides to controls:

  1. DataFlex: The server side of the control that is a DataFlex class that provides the API’s that the application will work with.
  2. Javascript: The client side of the control that implements the desired features by using the framework’s APIs that will be typically be rendered on screen (visual component). This is achieved by creating a javascript pseudo “class.”


Basic principles of custom controls…

  1. When an object is initialized it will serialize itself and be sent from the server to the client.
  2. Achieved in JSON format, which contains
    1. Object name
    2. JavaScript class name
    3. Web property values
  3. Controls at the client can initiate server calls. This means that they can call on a specific method of a specific object from the client on the server. Parameters are passed along, and the WebApp framework assembles and sends the AJAX call.
  4. Property changes executed on the server will execute setter methods on the control. When the control’s web set web property is executed it will execute a setter method on the client-side portion of that control.
  5. Client actions are action calls from the server to the client, which executes on the client-side portion of the control. Essentially it is a JavaScript function.