Max_Salah
Max_Salah

Reputation: 2497

How to build CQ.Dialog from the dialog json in javascript?

In javascript, I get the dialog as follow:

var url = CQ.HTTP.externalize(pathToDialog+".infinity.json");
var dialog = CQ.HTTP.eval(url);

my Question is How to convert this dialog to CQ:Dialog Widget, sothat I can use CQ:Dialog Methods like find( String prop, String value ), which u can find in the CQ5 Widget API

Thanks for help

Upvotes: 4

Views: 1776

Answers (1)

rakhi4110
rakhi4110

Reputation: 9281

You can use the getDialog() method of CQ.WCM class to get the dialog object for the url. Additionally, you can also pass a config object to perform functions like caching the dialog, looking for the dialog in the cache alone and so on.

var dialog = CQ.WCM.getDialog(pathToDialog + ".infinity.json");

Upvotes: 3

Related Questions