Geoportal Extension for OpenLayers
API Reference

Class: FormActionByDefaut

FormActionByDefaut

Form action for the Reporting control.
This class handles form submission and captures data from the form fields.

new FormActionByDefaut(form)

Controls/Reporting/Reporting.js, line 254

The constructor initializes the action with a form element.
It sets up properties for data, form, and submit button.
The form and submit button will be set by the IoC (Inversion of Control) container.
The data property is initialized to null, indicating no data has been captured yet.

Name Type Description
form HTMLFormElement

The form element to be managed by this action.

Methods

active()

Controls/Reporting/Reporting.js, line 269

This method sets up the action to listen for the form submission event.
When the form is submitted, it triggers the handler method to capture the form data.

clear()

Controls/Reporting/Reporting.js, line 333

This method resets the data property to null,
effectively clearing any previously captured form data.
It is intended to be called when the form needs to be reset or cleared.

disable()

Controls/Reporting/Reporting.js, line 280

This method does not perform any action in this implementation.
It is intended to be overridden in subclasses if needed.

getData(){Object}

Controls/Reporting/Reporting.js, line 313

This method retrieves the data captured from the form submission.
It simulates a form submission by clicking the submit button,
and returns the data as an object.

Returns:
- Data for this action.
Example
var data = formAction.getData();
console.log(data);
// Output:
// {
//   name: "Report Name",
//   desc: "Report Description",
//   theme: "Selected Theme"
// }

setForm(form)

Controls/Reporting/Reporting.js, line 288

Set the form for this action

Name Type Description
form *