/
Wayfast Javascript Library

Wayfast Javascript Library

Wayfast provides a JS API that allows devs to taylor screen behavior from code snippets.

In this document you can find all methods with high level descriptions, parameters, return values and considerations.

 

Method

Description

Parameters

Return value

Wayfast.Controls.Get(string objectIdentifier)

Searches provided object in pages dome and returns a reference to the node.

String value. Can be either html ID or css class.

Returns an object of type WayfastControl that references the dom node.  If the object is not found returns null.

WayfastControl.setValue(string properyName)

Sets the content to the referenced WayfastControl. This method is supported by the following controls:

 

  • Label

  • Combobox

  • RadioButton

  • Search

  • Button

  • EditBox

  • Calendar

  • CheckBox

  • Link

  • Textarea

  • Hidden

 

String value. If value parameter is null sets controls content to null.

Returns void.

WayfastControl.Render()

Draws a control in a given  placeholder. It is useful when changing a control programatically withou having to render the full page. This method only renders the associated WayfastControl.

Parameterless.

Void

WayfastControl.Show()

Set's control's visibility to true by setting css display its default.

Parameterless

Void

WayfastControl.Hide()

Set's control's visibility to true by setting css display to none.

Parameterless

Void

WayfastControl.clearValue()

Clears WayfastControl's content. This method is supported by the following controls:

 

  • Label

  • Combobox

  • RadioButton

  • Search

  • Button

  • EditBox

  • Calendar

  • CheckBox

  • Link

  • Textarea

  • Hidden

Parameterless

Void

Wayfast.FormValidation.setFormItemValid(stromg controlName, value)

Used for customizing validations in a form.

This method Indicates if a field passed a validation or not.

When validation fails changes css to highlight errors in the UI.

Requires the following Wayfast variables to be set before using it:

  • FormValidation: Comma separated list of fields that require validation. Must not contain quotes.

  • FormValidationSubmitButton: Sets the button that triggers form's validations. The execution of this button will be blocked until all validations passed. Must not contain quotes.

 

controlName: String with the name of the WayfastControl (without &).

value: boolean indicating if the validation passed or not. When false applies WayfastValidation css class to highlight the control when form validation failed.

void

Related content

Code Snippets validations
Code Snippets validations
More like this
Actions
Actions
Read with this
Standard Control Settings
Standard Control Settings
More like this
Controls
Controls
More like this
Label
Label
More like this
How to configure Skin & Layouts?
How to configure Skin & Layouts?
More like this