Gigya Job Openings

accounts.switchScreen JS

Skip to end of metadata
Go to start of metadata

Description

Programmatic method for switching the currently displayed screen in a screen-set. The method replaces the current screen with the specified one. This method can only be called when the screen-set is currently displayed. Please note that Gigya switches between screens in a screen-set automatically (without the need to call this method) based on the logic defined within the screen-set.

Note: If you plan on integrating Gigya's Accounts API, we highly recommend reading the Registration-as-a-Service Guide. Registration-as-a-Service (RaaS) is a premium platform that requires separate activation. If RaaS is not part of your site package, please contact Gigya by filling in a support form through the Console. You can access the support page by clicking Support on the upper menu after logging into the Gigya Console.

 

Syntax

 

 

Parameters

The following table lists the available parameters:

RequiredNameTypeDescription
screenSetstringA reference to the screen-set in which screens should be switched. The value of this parameter is the ID of a screen-set. Read more under gigya-screen-set. The screen-set is either defined on the same page from which this method is called, or it is stored on Gigya servers.
screenstringThe ID of the screen to load.
containerIDstringThe ID of a <div> element on the page in which the screen-set is dispayed. This parameter is Required if a containerID has been specified in the accounts.showScreenSet method call. 
cidstring
A string of maximum 100 characters length. The CID sets categories for transactions that can be used later for filtering reports generated by Gigya in the "Context ID" combo box. The CID allows you to associate the report information with your own internal data. For example, to identify a specific widget or page on your site/application. You should not define more than 100 different context IDs.

Code Sample

<!-- the screen-set definition -->
<div  class="gigya-screen-set"  id="my-screen-set"  data-start-screen="screen1" style="display:none">
    <div class="gigya-screen"  id="screen1">   ...  </div>
    <div class="gigya-screen"  id="screen2" >   ...  </div>
    ...
</div>
...
<script>
var params={
    screenSet: "my-screen-set", 
    screen: "screen2"
}
gigya.accounts.switchScreen(params);
</script>

Notes:

  • This sample is not meant to be fully functional code. For brevity's sake, only the code required for demonstrating the API call itself is presented.
  • To run the code on your own domain, add your Gigya API key to the gigya.js URL. A Gigya API key can be obtained on the Site Dashboard page on Gigya's website. Please make sure that the domain from which you are loading the page is the same domain name that you used for generating the API key.