Gigya Job Openings

JavaScript Parameters

Skip to end of metadata
Go to start of metadata

Overview

Gigya's Screen-Sets include a set of events that give you a great level of flexibility in customizing user-facing flows to your business needs, and allow you to fine-tune the user interaction with your Gigya screens. For example, using JavaScript Parameters, you can: 

  • Display a UI element (such as a checkbox) only for a specific IP range
  • Validate the user's ZIP code according to your own custom logic
  • Inject AJAX when a certain condition is met
  • Respond in real time to the user's input

Using JavaScript Parameters

Select JavaScript Parameters in the Screens section of the UI Builder to open a JavaScript editor and define event handlers for this screen-set. Here you can define anonymous custom JavaScript functions within any of the events you need to perform actions for. Anything added to this JSON obj will be appended to the params obj of the accounts.showScreenSet method (so must be a valid parameter for accounts.showScreenSet).
Common Use Cases: 
  • Event handlers for the screen-set.
  • Adding custom validations to the screen-set.

Example of incrementing a counter inside the onFieldChanged event:

{ // JavaScript Parameters JSON Obj
	// Called when a field is changed in a managed form.
	onFieldChanged: function(event) {
    	window.eye = (typeof(window.eye) == 'undefined') ? 0 :  window.eye +1;
    	console.log("field changed: " + window.eye);
	}
}

 

The following events are triggered by RaaS Screen-Sets

  • onError: called when an error occurs within the screen-set.
  • onBeforeSubmit: called before a form is submitted. This event gives you an opportunity to perform certain actions before the form is submitted, or cancel the submission by returning "false". 
  • onSubmit: called when a form is submitted, can return a value or a promise. This event gives you the option of modifying the form data when it is submitted. 
  • onAfterSubmit: called after a form is submitted.
  • onBeforeScreenLoad: called before a screen is rendered. This event gives you an oppotunity to cancel the navifation by returning "false". 
  • onAfterScreenLoad: called after a new screen is rendered.
  • onFieldChanged: called when a field is changed in a managed form.
  • onHide: called when a user clicks the "X" (close) button, or when the screen is hidden at the end of the flow. 
  • onBeforeValidation: called after a user submits a form, and before Gigya's built-in field and form validations. Can be used to add custom validations to the form (e.g., ZIP code validation). 

For full details on these events, see accounts.showScreenSet.


 

 

 

  • No labels