Question
Ruslan K · Oct 14, 2017

ZenMethod in onunloadHandler

I want to call ZenMethod when page is closing. Is it possible?

I tried

ClientMethod onunloadHandler() [ Language = javascript ]
{
    zenPage.SomeZenMethod();
}

 


Method SomeZenMethod() [ ZenMethod ]
{
    // to do some work
}

but it is not working

00
1 0 1 190
Log in or sign up to continue

Replies

Synchronous and Asynchronous Methods

  1. ClientMethod onunloadHandler() [ Language = javascript ]
    {
      this.SomeZenMethod();
    }
    
    ClassMethod SomeZenMethod() As %Status ZenMethod ]
    {
      // to do some work
      quit $$$OK
    }
  2. ClientMethod onunloadHandler() [ Language = javascript ]
    {
      var old zenSynchronousMode;
      zenSynchronousMode true;
      this.SomeZenMethod();
      zenSynchronousMode old;
    }
    
    ClassMethod SomeZenMethod() [ ZenMethod ]
    {
      // to do some work
    }