My most basic problem is to load a select field in touch UI dialog with dynamic options. These options are coming from a external URL via webservices so please don't mention datasources here.
In classic UI is easy with optionsProvider.
In touch UI I am trying to write a script that fetches the data from the external webservice via AJAX ON DIALOG load and set these options in the select field.
My dialog.ready event is just not getting called.
There is another annoying issue I see with touch UI is that I can't see the edit option when I hover over a component. It shows just "delete" and "group" option. And this happens for some components only. I have to double tap to to open the dialog. Please see image
Also see my code below to for dialog ready.
(function ($, $document, $window) {
"use strict";
console.log('Namaste'); // works
$document.on("dialog-ready", function() {
console.log('Hello'); // Does not work/fire when dialog opens
$window.adaptTo("foundation-ui").alert("Open", "Dialog now open, event [dialog-ready]");
if(comm) {
var serviceUrl = xyz.config.baseUrl + '/public/movies';
$.ajax({
url: serviceUrl,
cache:false,
success: function(result){
console.log('Result'+JSON.stringify(result));
}
});
}
});
$document.on("dialog-closed", function() {
$(window).adaptTo("foundation-ui").alert("Close", "Dialog closed, event [dialog-closed]");
});
})($, $(document), $(window));
To invoke your method on dialog open , you should set categories of your client lib as "cq.authoring.dialog"
It's a global category that's applies on all touch UI dialog.