Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am getting started with qlik desktop and I have connected to the desktop via Visual Studio plugin. I have added 2 sheets to visual studio, but when i debug to localhost, I get errors
var config = {
host: window.location.hostname,
prefix: '/',
port: window.location.port,
isSecure: window.location.protocol === "https:"
};
require.config( {
baseUrl: (config.isSecure ? "https://" : "http://") + config.host + (config.port ? ":" + config.port : "") + config.prefix + "resources"
});
require(["js/qlik"], function(qlik) {
// open the app
});
<asp:Content ID="Content2" ContentPlaceHolderID="cphMain" runat="server">
<div class="qlik-embed" data-qlik-appid="\\apfs01\users\rbeets\Documents\Qlik\Sense\Apps\app1.qvf" data-qlik-objid="ZCJjkN></div>
<div class="qlik-embed" data-qlik-appid="\\apfs01\users\rbeets\Documents\Qlik\Sense\Apps\app2.qvf" data-qlik-objid="JRcLVC"></div>
</asp:Content>
Websocket connection to 'ws://localhost......aspx' failed. Error during Websocket handshake. Unexpected response code: 404
Uncaught Error: Mismatched anonymous define() module ...from require.js:6
So the first thing to do is forget what qlik tells you to do to connect to it. I used the javascript built in websocket commands to connect and it works fine for connection.
Tutorials: http://blog.teamtreehouse.com/an-introduction-to-websockets, websocket.org Echo Test - Powered by Kaazing
var socket = {};
window.onload = function () {
// Get references to elements on the page. these are div fields and buttons in the html.
var form = document.getElementById('message-form');
var messageField = document.getElementById('message');
var messagesList = document.getElementById('messages');
var socketStatus = document.getElementById('status');
var closeBtn = document.getElementById('close');
// The rest of the code in this tutorial will go here...
var websocketURL = 'see_attached_pic_to_find_out_what_this_is';
var socketOnClose = function (msg) {
console.log('websocket disconnected - waiting for connection');
websocketWait();
};
var socketOnMessage = function (msg) {
console.log("RECEIVED ");
//console.log(msg.data);
};
var socketOnOpen = function (msg) {
console.log("websocket opened");
qlikJSONtoServer();
};
function websocketWait() {
setTimeout(function () {
socket = new WebSocket(websocketURL);
socket.onopen = socketOnOpen;
socket.onclose = socketOnClose;
socket.onmessage = socketOnMessage;
}, 1000);
};
websocketWait();
function qlikJSONtoServer() {
// DocLIST/AppList
console.log("GET DOC/App LIST");
//from connect to engine command in qs engine-api-explorer
socket.send(JSON.stringify(
{ "handle": -1, "method": "GetDocList", "params": [], "outKey": -1, "id": 1 }
));
//continues with more commands from the engine api explorer...
}
}
were u able to solve this ? I am facing the same issue.
So the first thing to do is forget what qlik tells you to do to connect to it. I used the javascript built in websocket commands to connect and it works fine for connection.
Tutorials: http://blog.teamtreehouse.com/an-introduction-to-websockets, websocket.org Echo Test - Powered by Kaazing
var socket = {};
window.onload = function () {
// Get references to elements on the page. these are div fields and buttons in the html.
var form = document.getElementById('message-form');
var messageField = document.getElementById('message');
var messagesList = document.getElementById('messages');
var socketStatus = document.getElementById('status');
var closeBtn = document.getElementById('close');
// The rest of the code in this tutorial will go here...
var websocketURL = 'see_attached_pic_to_find_out_what_this_is';
var socketOnClose = function (msg) {
console.log('websocket disconnected - waiting for connection');
websocketWait();
};
var socketOnMessage = function (msg) {
console.log("RECEIVED ");
//console.log(msg.data);
};
var socketOnOpen = function (msg) {
console.log("websocket opened");
qlikJSONtoServer();
};
function websocketWait() {
setTimeout(function () {
socket = new WebSocket(websocketURL);
socket.onopen = socketOnOpen;
socket.onclose = socketOnClose;
socket.onmessage = socketOnMessage;
}, 1000);
};
websocketWait();
function qlikJSONtoServer() {
// DocLIST/AppList
console.log("GET DOC/App LIST");
//from connect to engine command in qs engine-api-explorer
socket.send(JSON.stringify(
{ "handle": -1, "method": "GetDocList", "params": [], "outKey": -1, "id": 1 }
));
//continues with more commands from the engine api explorer...
}
}
I really did not get this
var websocketURL = 'see_attached_pic_to_find_out_what_this_is';
Will the target id not change dynamically, on each request?? should I hardcode that url here??
How do I get the ticket Id from?
theres a pic attached to the comment.
I haven't got that far to get it from code, but when you execute a macro, the ticket id will be at the end of the url
Thanks for this, I was able to connect and retrieve the list of apps. I found that I didn't need to supply the TicketID. I assume this was done by behind the scenes.