Hi
I add a javascript function in default.html , when I call Application.Call(“print”); its all ok , but when I call with parameter like thisApplication.Call(“print”,comboBox1.Text); it is failed
I want to call with parameter.
Thanks For Help
JavaScript Code
function print(PrinterName) {
if (jspmWSStatus()) {
var cpj = new JSPM.ClientPrintJob();
var myPrinter = new JSPM.InstalledPrinter(PrinterName);
cpj.clientPrinter = myPrinter;
//Set PDF file
var my_file = new JSPM.PrintFilePDF(“https://abc.com/temp/LoremIpsum.pdf”, JSPM.FileSourceType.URL, ‘MyFile.pdf’, 1);
cpj.files.push(my_file);
cpj.sendToClient();
}
}
The problem is that you are overriding the browser’s window.print() function which is called by Wisej from Wisej.Core.print() to generate a print preview of a page or a specific widget. For example, see screen shots attached. In Wisej you can use Application.Print(control) to “isolate” a specific part of a page. In the screen shot it calls Application.Print(this.barcode1) which calls the javascript Wisej.Core.print() which calls the browser’s window.print().
When you put a global javascript function without a scope it override’s the window’s function with the same name and you risk breaking the entire application if you override a system function. You can call it something else, like “jspm_print” or give it a scope and call it “MyApp.print” like this:
window.MyApp = {
print: function(name){
}
};
HTH
Please login first to submit.