Tuesday, 7 July 2015

window.showModalDialog deprecated

Hi FOLKS, 

This feature is going away. Please fix your Web sites and applications.
Support has been removed in Chrome 37. But they have  added a temporary Enterprise Policy setting to re-enable showModalDialog. This showModalDialog() method was removed completely in Chrome 43.
Mozilla has announced that it will remove support for this method (bug 981796). Regarding timing, it shouldn't be before Firefox 39. This means that the function will be around until around mid-June 2015. It also means that for enterprise you can switch to using ESR 38 builds, which will have the function into mid 2016.

Salesforce Applications :

Use the following simple steps to resolve the issues ,

1.  Replace your Showmodal dialog with Window.open Tag .
2. Include following code in Popup page to send parameters to Parent window JS function from Pop up window ,

Here we are preparing JSON string to send all the required parameters to Parent window as below,

var OrderProducts = new Array();
var jsonText ;
function Addproducts() 
 {
// Prepare JSON Data with parameters , you want to send to parent JS function
              var products = new Object();
products.ProdName = 'TEST Product';
products.prodid = 'Test Id'
OrderProducts.push(products);
jsonText = JSON.stringify(OrderProducts);

       // This is the function from Parent window and add parameters to send .
window.opener.openProducts(jsonText); (openProducts() is the JS function in Parent window)
 
// Closing the console
        self.close();
}

3.  Following is the JS function from Parent window ,

function openProducts(jsonstring){
       alert(jsonstring);
}

Above sample steps will provide solution for the issues related to window.showmodaldailogs.

Thank you.


No comments:

Post a Comment