> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/web/migration-guides/migrating-to-v11/migrating-to-v11-form-builder.md).

# Migrating to V11 Form Builder

Discover how the elimination of placeholder annotations in Form Builder mode streamlines widget interactions and event triggers. Learn about the changes and improvements in widget annotation managemen

## Overview

We have eliminated the usage of placeholder annotations.

Previously, when you entered Form Builder mode, the WidgetAnnotations would temporarily be replaced with placeholder annotations. Users could interact with the placeholders and make edits to their properties and styles. After exiting Form Builder mode, the Placeholders would be swapped with the WidgetAnnotations, applying any changes made while in Form Builder mode.

In the current workflow, you now interact with WidgetAnnotations. While in edit mode, you can perform the same property and style adjustments as before. The changes will be immediately applied to the WidgetAnnotation and will be visually apparent. After exiting edit mode, the WidgetAnnotation will be set into an interactive state, allowing users to interact with the widget.

Before After

![](https://3532544125-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX9YnTSKIHvV7m0A36LbO%2Fuploads%2Fgit-blob-ec5e9da56dd37fedd8b5e950326a7a9b3a95f188%2Fbb09be59c3cca157036c2490d7913f8b2252d048-1558x662.png?alt=media)

![](https://3532544125-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX9YnTSKIHvV7m0A36LbO%2Fuploads%2Fgit-blob-710afcbf21c23e8ae88e1948cb7930dffa77b492%2Fd308b6d4f94e516e008778f7fba2d4ccb1280cc0-1755x719.png?alt=media)

## Interacting with WidgetAnnotations

To facilitate these changes, some methods have been removed from the [FormFieldCreationManager](https://sdk.apryse.com/api/web/Core.FormFieldCreationManager.html#toc1__anchor) and added to the [WidgetAnnotation](https://sdk.apryse.com/api/web/Core.Annotations.WidgetAnnotation.html#main) class.

This means a reduction in the amount of code needed to make changes to WidgetAnnotations. Previously, you would get the placeholder annotation and pass it into FormFieldCreationManager methods to make changes. The changes would not be final until exiting Form Builder mode.

The example below shows how you would set the field to "Required" on some placeholder annotations.

Before

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
const { annotationManager, Annotations } = instance.Core;
const { WidgetFlags } = Annotations;

const formFieldCreationManager = annotationManager.getFormFieldCreationManager();
formFieldCreationManager.startFormFieldCreationMode();

const widgetAnnotations = = annotationManager.getAnnotationsList().filter((annot) => annot instanceof Annotations.WidgetAnnotation);

widgetAnnotations.forEach((annotation) => {
  if (annotation.isFormFieldPlaceholder()) {
    formFieldCreationManager.setFieldFlag(annotation, WidgetFlags.REQUIRED, true);
  }
});
```

{% endcode %}
{% endtab %}
{% endtabs %}

After

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
const { annotationManager, Annotations } = instance.Core;
const { WidgetFlags } = Annotations;

const formFieldCreationManager = annotationManager.getFormFieldCreationManager();
formFieldCreationManager.startFormFieldCreationMode();

const widgetAnnotations = = annotationManager.getAnnotationsList().filter((annot) => annot instanceof Annotations.WidgetAnnotation);

widgetAnnotations.forEach((annotation) => {
  if (annotation instanceof Annotations.WidgetAnnotation) {
    annotation.setFieldFlag(WidgetFlags.REQUIRED, true);
  }
});
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Event changes

The other side effect of this change will be a difference in how events are triggered. Previously, when entering Form Builder mode, an `annotationChanged` event would be triggered, resulting in an `add` action for the annotation placeholders. When exiting Form Builder mode, the same event would also be triggered, but as a `delete` action.

In v11, there will be no `annotationChanged` events triggered when entering and exiting Form Builder mode. If you need to hook logic into entering and exiting Form Builder mode, you should add listeners to the [FORM\_CREATION\_STARTED](https://sdk.apryse.com/api/web/Core.FormFieldCreationManager.html#.Events__anchor) and [FORM\_CREATION\_ENDED](https://sdk.apryse.com/api/web/Core.FormFieldCreationManager.html#.Events__anchor) events.

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
const { annotationManager, FormFieldCreationManager } = instance.Core;

const formFieldCreationManager = annotationManager.getFormFieldCreationManager();

formFieldCreationManager.addEventListener(FormFieldCreationManager.Events.FORM_CREATION_STARTED, () => {
  // code to run when form field creation starts
});

formFieldCreationManager.addEventListener(FormFieldCreationManager.Events.FORM_CREATION_ENDED, () => {
  // code to run when form field creation ends
});
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.apryse.com/web/migration-guides/migrating-to-v11/migrating-to-v11-form-builder.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
