Interaction between the no webmap added Form and the WebMap components

To make easier the interactions between the migrated app and the no webmap components, a service has been added to the FrontEnd, it’s called ClientCustomUpdateService. This can be used to tell a migrated form to make some refresh or change properties of other components inside the form.

For this is necessary to also add a specific event on the C# code called RefreshCustomClientChanges

Binding the event to the exisiting form on C#
Method called by the event

And in the FrontEnd added component, call the service like the next example:

Calling the service to refresh a existing window

Is very important to add the next input to the window we want to refresh:

Adding the input to a wmwindow we want to refresh or change from the added component

This should be a unique identifier.

Known limitations

  • Accessing the WebMap state from the Custom controllers isn’t possible. The custom API requests can't access information for the migrated windoww or components to change models or properties. For this is used the RefreshCustomClientChanges method.

  • A custom unique identifier is needed for all the migrated Forms that need interaction to refresh or change something from the C# code

Communication with custom properties betwen WebMap and NoWebMap forms

Send properties from WebMAP to NoWebMAP

For this cases, the communication can be made in any way using Angular, for example, services, route params or the router state. The following example shows how to do it using the state:

The SelectedCustomersIds is property is set from the WebMAP form.

After that we receive it anywhere

We save the state and call the getStateParams.
We access the property.

Note: It is important to know that the state needs to be set in the component's constructor.

Send properties from NoWebMAP to WebMAP

If we want to send properties to the WebMAP app, we use the existing refreshComponentService, but we modify the event to have the customArgs property.

We add properties to the customArgs object.

After that, you only have to access the property in the Backend handler associated with the RefreshClientCustomChanges event.

Access the property in the CustomArgs object.

The CustomArgs has a helper that returns the property we need with the correct type: String, Integer, Float or Boolean, you just need to call the method with the property path, like the one GetJsonBooleanValue in the previous image.

CustomArgs with internal objects structure:

CustomArgs: {
    Name: "Josh",
    Id: "123-abc",
    Product: {
        Name: "Apple"
    }
}

If we have something like this you just need to send the correct path. For example, if you want to get the product name:

eventArgs.CustomArgs.GetJsonStringValue("Product/Name");

Last updated

Was this helpful?