Class: GuideBridge

GuideBridge


new GuideBridge()

Constructs a new GuideBridge instance.

Members


ConfigKeys :Object

Predefined key values for user configurations.

Type:
  • Object

Methods


getFormDataString(options)

Returns the string representation of the form data.

Parameters:
Name Type Description
options Object

Input options for the getFormDataString API.

Properties
Name Type Argument Description
success function <optional>

Callback function that receives the result of the API in case of success.


getFormDataObject(options)

Returns a FormData object containing form data and attachments.

Parameters:
Name Type Description
options Object

Input options for the getFormDataObject API.

Properties
Name Type Argument Description
success function <optional>

Callback function that receives the result of the API in case of success.


getFormModel()

Returns the Form Instance associated with the GuideBridge. Can return null if no form instance is found.

Returns:
  • The Form Instance associated with the GuideBridge.
Type
null | Object

validate()

Validates the Adaptive Form.

Returns:
  • True if the form is valid, false otherwise.
Type
boolean

connect(handler [, context], formContainerPath)

Register a callback to be executed when the Adaptive Form gets initialized

Specify a callback function which is called/notified when Adaptive Form gets initialized. After Adaptive Form is initialized GuideBridge is ready for interaction and one can call any API.

The callback can also be registered after the Form gets initialized. In that case, the callback will be called immediately.

Parameters:
Name Type Argument Description
handler function

function that would be called when guideBridge is ready for interaction. The signature of the callback should be

function() {
    // app specific code here
}
context object <optional>

this object in the callback function will point to context

formContainerPath

optional param. It captures the form container you want the GuideBridge APIs to interact with.

Example
guideBridge.connect(function() {
   console.log("Hurrah! Guide Bridge Activated");
})

isConnected()

Whether the Adaptive Form has been initialized or not

All GuideBridge APIs (except connect) require Adaptive Form to be initialized. Checking the return value of this API is not necessary if guideBridge API is called only after the Form is initialized

Returns:

true if the Adaptive Form is ready for interaction, false otherwise

Type
boolean

disableForm()

Disables the adaptive form, i.e. it disables all the fields and buttons.


reset()

Resets the adaptive form, clearing all entered values.


hideSubmitButtons()

Hides all the submit buttons present in the Adaptive Form


hideResetButtons()

Hides all the reset buttons present in the Adaptive Form.


hideSaveButtons()

Hides all the save buttons present in the Adaptive Form.


hideSummaryPanel()

Hides the summary panel in the Adaptive Form.


trigger(eventName, eventPayload [, formContainerPath])

Triggers an event on the GuideBridge object.

Parameters:
Name Type Argument Description
eventName string

The name of the event to trigger on GuideBridge.

eventPayload any

The payload to be passed with the event.

formContainerPath string <optional>

If no argument is passed, use any form container.


on(eventName, handler)

Adds an event listener for events triggered by the GuideBridge object. The subscriber must first be connected to GuideBridge to be able to use this API.

Parameters:
Name Type Description
eventName string

The name of the event to listen for.

handler function

The event handler function.


registerConfig(key, config)

Register a configuration for a specific key.

Parameters:
Name Type Description
key string

The key for which to register the configuration.

config Object | function

The configuration object or function.

Returns:
  • An array of configurations associated with the key.
Type
Array
Example
// Register a function configuration for additional behavior
guideBridge.registerConfig(guideBridge.ConfigKeys.LOCALE_CONFIG, () => console.log('Function config'));

resolveNode(qualifiedName)

Given a qualifiedName, returns the form element model having the same qualified name.

Parameters:
Name Type Description
qualifiedName string

qualified name of the Adaptive Form component

Returns:

form element model having the same qualified name or null if not found


getConfigsForKey(key)

Get configurations associated with a specific key.

Parameters:
Name Type Description
key string

The key for which to retrieve configurations.

Returns:
  • An array of configurations associated with the key.
Type
Array

Class: GuideBridge

GuideBridge

The GuideBridge class represents the bridge between an adaptive form and JavaScript APIs.


new GuideBridge()

Members


ConfigKeys :Object

Predefined key values for user configurations.

Type:
  • Object

Methods


getFormDataString(options)

Returns the string representation of the form data.

Parameters:
Name Type Description
options Object

Input options for the getFormDataString API.

Properties
Name Type Argument Description
success function <optional>

Callback function that receives the result of the API in case of success.


getFormDataObject(options)

Returns a FormData object containing form data and attachments.

Parameters:
Name Type Description
options Object

Input options for the getFormDataObject API.

Properties
Name Type Argument Description
success function <optional>

Callback function that receives the result of the API in case of success.


getFormModel()

Returns the Form Instance associated with the GuideBridge. Can return null if no form instance is found.

Returns:
  • The Form Instance associated with the GuideBridge.
Type
null | Object

validate()

Validates the Adaptive Form.

Returns:
  • True if the form is valid, false otherwise.
Type
boolean

connect(handler [, context], formContainerPath)

Register a callback to be executed when the Adaptive Form gets initialized

Specify a callback function which is called/notified when Adaptive Form gets initialized. After Adaptive Form is initialized GuideBridge is ready for interaction and one can call any API.

The callback can also be registered after the Form gets initialized. In that case, the callback will be called immediately.

Parameters:
Name Type Argument Description
handler function

function that would be called when guideBridge is ready for interaction. The signature of the callback should be

function() {
    // app specific code here
}
context object <optional>

this object in the callback function will point to context

formContainerPath

optional param. It captures the form container you want the GuideBridge APIs to interact with.

Example
guideBridge.connect(function() {
   console.log("Hurrah! Guide Bridge Activated");
})

isConnected()

Whether the Adaptive Form has been initialized or not

All GuideBridge APIs (except connect) require Adaptive Form to be initialized. Checking the return value of this API is not necessary if guideBridge API is called only after the Form is initialized

Returns:

true if the Adaptive Form is ready for interaction, false otherwise

Type
boolean

disableForm()

Disables the adaptive form, i.e. it disables all the fields and buttons.


reset()

Resets the adaptive form, clearing all entered values.


hideSubmitButtons()

Hides all the submit buttons present in the Adaptive Form


hideResetButtons()

Hides all the reset buttons present in the Adaptive Form.


hideSaveButtons()

Hides all the save buttons present in the Adaptive Form.


hideSummaryPanel()

Hides the summary panel in the Adaptive Form.


trigger(eventName, eventPayload [, formContainerPath])

Triggers an event on the GuideBridge object.

Parameters:
Name Type Argument Description
eventName string

The name of the event to trigger on GuideBridge.

eventPayload any

The payload to be passed with the event.

formContainerPath string <optional>

If no argument is passed, use any form container.


on(eventName, handler)

Adds an event listener for events triggered by the GuideBridge object. The subscriber must first be connected to GuideBridge to be able to use this API.

Parameters:
Name Type Description
eventName string

The name of the event to listen for.

handler function

The event handler function.


registerConfig(key, config)

Register a configuration for a specific key.

Parameters:
Name Type Description
key string

The key for which to register the configuration.

config Object | function

The configuration object or function.

Returns:
  • An array of configurations associated with the key.
Type
Array
Example
// Register a function configuration for additional behavior
guideBridge.registerConfig(guideBridge.ConfigKeys.LOCALE_CONFIG, () => console.log('Function config'));

resolveNode(qualifiedName)

Given a qualifiedName, returns the form element model having the same qualified name.

Parameters:
Name Type Description
qualifiedName string

qualified name of the Adaptive Form component

Returns:

form element model having the same qualified name or null if not found


getConfigsForKey(key)

Get configurations associated with a specific key.

Parameters:
Name Type Description
key string

The key for which to retrieve configurations.

Returns:
  • An array of configurations associated with the key.
Type
Array