Close method

The Smartframe.Close method works in conjunction with the Smartframe.OnClosing event handler to provide more flexibility over the closing process.

Smartframe.Close()

Applies To

Smartframe

Version Support

Introduced in version 11.0.6.

Use

The Smartframe.Close method provides you with an immediate mechanism for responding to the OnClosing event. It can be called within the OnClosing event handler code, in your Smartframe template, to complete the close process when required. This method is useful if you are wanting to provide your users with the option of canceling or continuing the Smartframe close action.

BE AWARE:

This method cannot be called within a Newlook script or macro.

EXAMPLE:

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// Called when SmartFrame is about to close

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

SmartFrame.OnClosing = OnApplicationClosing;

 

function OnApplicationClosing()

{

   // if the 'newlook' control is hidden then close Smartframe immediately

   if ($("#obj1").is(":hidden") === true) {

      return true;

   }

 

   // hide the 'newlook' control. When operation complete show a 'confirm' dialog.

   $("#obj1").hide({

      "complete": function () {

         var result = confirm("Do you want to exit SmartFrame?");

 

         if (result === true) {

            SmartFrame.Close();

         } else {

            // If cancelled re-show the 'newlook' control.

            $("#obj1").show();

         }

      }

   });

 

   return false;

}

See Also

Customizing Smartframe templates | OnClosing Event | Smartframe Newlook Control API | OnFunctionKeyChanged property | OnReceived property | OnSent property | OnStatusChanged property | OnTitleChanged property

Applies To

Smartframe


© 2004-2021 looksoftware. All rights reserved.