> Markdown version of [Form Manager](https://vaadin.com/docs/next/tools/collaboration/managers/form-manager). Section index: [llms.txt](https://vaadin.com/docs/next/tools/llms.txt)

# <a id="ce.form-manager"></a>Form Values & Field Highlighting (deprecated since V25.3)

> **Warning:** Collaboration Kit is superseded by [signals](https://vaadin.com/docs/next/flow/ui-state/shared-signals.md) and is scheduled for removal in Vaadin 26.
>
> See [Migrating from Collaboration Kit to Signals](https://vaadin.com/docs/next/tools/collaboration/migrating-to-signals.md) for how.

Collaboration Kit includes a manager to set property values and field highlighting in a form, and to react to their changes. It provides a simple way to create a custom form component with collaborative features.

The manager can also be used in conjunction with a `CollaborationBinder` (see [Collaborative Form Editing](https://vaadin.com/docs/next/tools/collaboration/components/collaboration-binder.md)) connected to the same topic. Any changes made to property values, or highlighting via the `FormManager`, are reflected in any fields bound to the same properties — and vice versa.

`FormManagerExample.java`

```java
VerticalLayout form = new VerticalLayout();

nameField = new TextField();
nameField.setLabel("Name");
form.add(nameField);

UserInfo localUser = new UserInfo("john");

FormManager manager = new FormManager(form, localUser, "my-topic"); // (1)

manager.highlight("name", true); // (2)

manager.setHighlightHandler(context -> { // (3)
    String propertyName = context.getPropertyName();
    UserInfo user = context.getUser();

    // Executed when a field is highlighted

    return () -> { // (4)
        // Executed when a field is no longer highlighted
    };
});

manager.setValue("name", "John"); // (5)

manager.setPropertyChangeHandler(event -> { // (6)
    String propertyName = event.getPropertyName();
    Object value = event.getValue();

    // Executed when a property value is changed
});
```

1. Creating a `FormManager` takes a component to bind the manager connection context to the UI, an instance of `UserInfo` that represents the current local user, and the topic identifier on which to connect.

2. The `highlight()` method is used to mark the local user as editing a property. Any field component bound to the same property via a `CollaborationBinder` connected to the same topic is highlighted and shows the name of the user.

3. The `setHighlightHandler()` method sets a callback to handle a user editing a property. The property name and the `UserInfo` of the user are provided by the context passed as the argument to the callback. This can be used, for example, to focus a field component.

4. The callback returns another callback, a `Registration`, that’s called when the same user stops editing a property.

5. The `setValue()` method is used to set the value of a property. The value is set on all field components bound to the same property via a `CollaborationBinder` instance connected to the same topic.

6. The `setPropertyChangeHandler()` method sets a callback to handle a property value change. The property name and the new value are provided by the event passed as the argument to the callback.

`8436311F-F248-4CC4-B72F-79A93C5C03FD`
