Skip to main content

Client side development

In this section we will discuss how to write client code for DWKit forms.

Where to write client code for DWKit forms?

You can write client code for forms in the Form/Action Handlers section in the admin panel. But not all of us feel comfortable writing code in browser mode. In DWKit form code is stored in JavaScript files, and you can open these files in any IDE of your choice and edit them.

How to write client form code in DWKit? Where to begin?

We recommend the following order of actions.

  • Read the Client Architecture section. Pay most attention to the client actions and global state subsection. There are two most important aspects here:
    • There is a large object in the client side of DWKit, which defines client app state. All form components display this state.
    • DWKit form code changes this large state object. And thus you can control the whole app from this code.
  • Briefly look through the Global state of the client application section, to understand where everything is located.
  • Read manual on writing Client Actions.
  • Start writing code.

You can also:

Do I need to know React, ES6 and other new technologies to write client code in DWKit?

No, you don't. You don't even need to know that DWKit is based on React to write client code. When we were building DWKit, we did our best to isolate developers from a concrete technology. They only need to know basic JavaScript, no even relatively new ECMAScript, to write regular code. You can also use JQuery or another JavaScript third party library, if you like, by connecting it to the app by an ordinary reference.

How difficult is it to call server code from client?

It is not difficult, it is easy! You only need to write server code, using this manual and select server action you need from the dropdown list in Form Builder. DWKit will do the rest for you. You won't even have to write your own controllers.