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:
Web Properties
Cancel

Custom Controls

Lesson 2: Setting up the workspace

  1. Run the DataFlex Studio as an administrator
  2. From the top toolbar select FILE > NEW WORKSPACE
  3. Select ‘Next,’ and enter “WebMessageBuilder” as the ‘Name of the New Workspace’ on the following screen. Select ‘Next’ two more times, and then ‘Finish.’
  4. From the top toolbar select FILE > NEW > PROJECT
  5. Select ‘Mobile Web Project,’ and press OK twice.
  6. To create a DataFlex class select FILE > NEW > PROJECT
  7. Select ‘New Class,’ and press OK.
  8. Open the ‘Superclass Name’ dropdown, and select ‘cWebBaseControl.’
  9. Enter “cWebMsgBuilder” in the ‘Class Name’ field and press OK.
  10. An empty class template has been created (cWebMsgBuilder.pkg).
  11. Set the psJSClass:
    Set psJSClass to "dfcc.WebMsgBuilder"

  12. Open the computer’s file explorer, and navigate to This PC > Local Disk (C:) > Data > DataFlex Workspaces > 19_0 > WebMessageBuilder > AppHtml
  13. In the ‘AppHtml’ folder create a new folder named “WebMsgBuilder.”
  14. In the new ‘WebMsgBuilder’ folder create a new JavaScript file (select ‘New Text Document,’ and rename it with a .js file extension) called “WebMsgBuilder.js”
  15. Open the new file in a text editor that supports proper code highlighting.
  16. Within WebMsgBuilder.js…
  17. Create the name space object (optional)…
    // Namespace Object
    if (!dfcc) {
         var dfcc = {};
    }
  18. Create the constructor function…
    // Constructor
    dfcc.WebMsgBuilder = function WebMsgBuilder(sName, oPrnt) {
          //Configure superclasses
          dfcc.WebMsgBuilder.base.constructor.apply(this, arguments);
    };