Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The following article outlines how to add Pop-up windows in the EngageIP AdminPortal using Page Extensions.

Example

  1. Click on the on Setup tab

  2. Click on Page Extensions

  3. Click the Add button

  4. Enter the following information:
    Name - Pop-up Page Extension
    Page - userpackage/ajaxpackageselectlist
    Script - (see below)

    Code Block
    languagejs
    alert('hello page extension');
  5. Click Save

...

In our example we're going to setup a page extension on the “Add Packages dialog.  Navigate  Navigate to a user in your test environment and go to the packages tabpage.  After the user package list loads, use your developer tools to turn on network profiling. This will start monitoring network requests.  Click the “Add button (bottom right of the grid).  Your browser will pick up the AJAX request to the page we're looking for.

...

So, to specify this in our page extension definition, we are interested in what we call the “Controller Controller and “Action Action portion of the URL, which is:

...

We need to go to the settings page on the branded owner for which you wish to add the page extension.  For the most part, you can just to this user by typing “ =admin in the search box on any page, then click on the Settings tab on the top rightlink.

Create a new page extension. For our example, we need simply to put the following in place:

...

The following example outlines how to use a Page Extension to display a pop-up on add account if a package has not been selected.

  1. Click on the on Setup tab

  2. Click Page Extensions

  3. Click the Add button

  4. Enter the following information:
    Name - RequirePackageOnAddAccount
    Page - User/add(to apply the same option to the ticket edit screen this value should be ticket/edit)
    Script - see below, same for both the add and edit screens

    Code Block
    languagejs
    var onClick = jQuery("#SaveButton")[0].onclick = null;
    jQuery("#SaveButton, #SaveNewButton").click(function(){
      if(jQuery("#PackageCount").val()=="0"){
        alert('Please add at least one package');
        return false;
      }
      if (checkvalidation(document.getElementById('EditForm'), 0)) {
        DisableSubmitButtons();
        new Ajax.Updater('overDiv', 'AJAXPrevalidate.rails', {asynchronous:true, evalScripts:true, parameters:Form.serialize(document.getElementById('EditForm'))}); 
        return false;
      } 
      else {
        return false;
      });
  5. Click Save