Home Search

DriveWorks Pro 22
How To: Make Your Website React To Specification Events With The Integration Theme (KB19042301)

Send Feedback

How To: Make Your Website React To Specification Events With The Integration Theme

The Integration Theme enables you to embed your DriveWorks Implementation in an existing web site or application.

With the Integration Theme you can also get your website to react when certain events happen during a specification.

The supported Specification Events are:

  • FormUpdated
  • ControlUpdated
  • PreviewLoaded
  • TasksUpdated
  • ActionsUpdated

The following is example code to show a DriveWorks form inside a website and includes how to react to the Form being updated.

Website Code using FormUpdated specification event

<script type="text/javascript" async>
    const SERVER_URL = config.serverUrl;
    const GROUP_ALIAS = config.groupAlias;
    const CREDENTIALS = config.credentials;
    const PROJECT_NAME = config.projectName;
    const client = new window.DriveWorksLiveClient(SERVER_URL);
    let specId;
    (async function () {
        await client.loginGroup(GROUP_ALIAS, CREDENTIALS);
        const specification = await client.createSpecification(GROUP_ALIAS, PROJECT_NAME);
        specId = specification.id;        
        await specification.render(document.getElementById('myForm'); 
        const specForm = specification.specificationFormElement;
        specForm.addEventListener("FormUpdated", function (e) {
            console.log(e.detail);
        });
    })();
</script>
        

More examples can be found with the Client SDK examples.

Please see the section Examples in the topic Integration Theme.

From the Client SDK Examples page, select Specification Forms from the links in the header.


Knowledge Base Article Ref:KB19042301

See also

Integration Theme

Integration Theme Settings

How To: Configure DriveWorks Live For IIS