December 4, 2013

ShowModalDialogue method in Browser Script

Lets say you are trying to open your facebook profile in a modal window. Below is the code to achieve it. Refer bookshelf for more details on ShowModalDialog.

function Applet_PreInvokeMethod (name, inputPropSet)
{
        if(name == "OpenProfile")
        {
                    var sProfileName = this.BusComp().GetFieldValue("Name");
                        var sURL = "https://www.facebook.com/"+sProfileName;
                   
                    var sOptions = "dialogHeight:400px;dialogWidth:600px;dialogTop:100px;edge:sunken;resizable;yes";
                    //alert(sURL);
                    theApplication().ShowModalDialog(sURL, "", sOptions);
                    return ("ContinueOperation");
        }
        return ("ContinueOperation");
}

No comments:

Post a Comment