Showing posts with label The Application. Show all posts
Showing posts with label The Application. Show all posts

Tuesday, August 3, 2010

Correction to Code - from Getting Started with SIFs

In the last post I had a couple of lines of code added to the browser script and server script of the application that you use... Neel posted a comment to say he was having some trouble using 8.1 - I'm not sure that this error is to blame, but it can't be helping!

Hopefully this correction will help get the code at least running.

So, the correct code for the server script declarations section of the application you are using should be:

var oBS:Service = this.GetService("MFramework");
oBS.InvokeMethod ("BuildFramework", this.NewPropertySet(), this.NewPropertySet());

while the following is the correct code for the new method in the browser script of the application you are using:

function BuildFramework()
{
    var bsUi = theApplication().GetService("MFramework");
    bsUi.InvokeMethod("BuildBsFramework",theApplication().NewPropertySet());
};

I've added this. and theApplication(). in front of the calls to the NewPropertySet() method, which hopefully will help things run.

Thursday, June 17, 2010

The Application Brower Script

This is the code in The Application browser script - used to call the browser side version of the framework (which gets attached to the top object, so available everywhere)

// build framework object - will be accessible to all objects via top.oFramework
setTimeout("BuildFramework()", 1000);

function BuildFramework()
{
var bsUi = theApplication().GetService("My Framework");
bsUi.InvokeMethod("BuildBsFramework",NewPropertySet());

top.oFramework.resizeAppWindow();
}

The Application Server Script

This is the script in the Application object. It's used to call the business service (empty method) which will create an instance of the framework (Class_Main) in its declaration section. The Business Service is cached, so we only get one instance of the Framework in memory (per session).`


var oBS:Service = this.GetService("My Framework");
oBS.InvokeMethod ("BuildFramework", NewPropertySet(), NewPropertySet());

function FrameworkHandle()
{
/*------------------------------------------------------------------------------------------
Created: 04/01/2010
Description: Return a reference to the Framework object built by BS
------------------------------------------------------------------------------------------*/
return this.GetService("My Framework").frameworkHandle();
}