I'm running into an issue with JSNI that I was hoping someone could help me with. - gwt

I am using an external JS file to generate QR codes
The JS file is loading correctly, it just can't refer to that function. The specific error I am getting is:
Uncaught ReferenceError: qrcode is not defined
enter image description here

The error suggest the tag qrcode could not be found. Is it in your HTML page as id? Also as suggested in the comment you need to do new $wnd.QRCode(... in createQRCode. Also you could pass the element found as argument to the latter method and do the search getElementById in GWT code as Java and use: Document.getElementById

Related

Imprecise descriptions of bugs/exceptions when debugging EJS templates

EJS documentation at ejs.co says "It's easy to debug EJS errors: your errors are plain JavaScript exceptions, with template line-numbers included.".
However, when debugging the code with an bug in the template, I only get references to the functions inside my cza.js module that calls the ejs.renderFile and references to the "internal" errors within the EJS (ejs.js) itself. Reference to the bug within the .ejs template (ideally the line-number) is missing, in fact the template goes unmentioned.
So, the screenshot is of an the error within ejs.js, where EJS itself got stuck processing the bugged template, NOT the template itself, and so worthless:
So, how do I get the debugger to point out the bug in my template?
So, I have just found out that EJS does print out the code to terminal, unless a debugger does not step in to handle the exception before EJS can point out the bug.
In my scenario, I debug the app using node --inspect app.js, with debug auto-attach in VS Code enabled. The debugger then describes the exception as shown in the question screenshot.
How I found out the debugger was blocking EJS's output to terminal? I had a browser already requesting the app, when I launched it and the exception occured within the second before the debugger was attached.

TYPO3: File Upload Error in front using upload_example extension

I have installed upload_example extension in TYPO3 7.6.11. It works very well from admin. However, when i try to submit form with images it throws the error: 1298012500: Required argument "newExample" is not set for Helhum\UploadExample\Controller\ExampleController->create.
I checked every configuration, everything is set. I stuck. I am new in typo3.
Can you help please?
Thank You
You can debug using debugutility inside initializeMethodAction(). I must be called in such case when model argument is not found.
Or as a reference for file uploading you can refer this link. hopefully, it will help you
http://blog.typo3servers.info/show/typo3-extbase-fal-image-upload/

vscode warning for included js obj

I have 2 question about the edit visual studio code.
1. when I include a js file in my html as <script src="hey.js"></script> and use it in my js code after like hey.speak() the editor says 'cannot find name 'hey'.
when I create new function and calling this function afterward when it shows me the function's argument why it says "any" on every argument it takes ? when In real the current function expects to get a function (in a callback case)
I'm trying to arrange my project code, and I'm trying to follow the wornings. thanks (:
VSCode doesn't load <script> tags referenced in HTML automatically. If you open the referenced file by yourself (e.g. in an editor to the side), global symbols should get picked up.
This is definitely a nice feature request, you can ask for it at the VSCode User Voice Website.
In the meantime, you can configure the linting settings of JavaScript, to ignore undeclaredVariables, for example.
You should be able to include
/* global hey */
to the top of your script, then VS Code (and other linters) will know that you have an undeclared global the you will be importing.

Cannot Run HighChart GWT Demo Example - Area Range

I am trying to get an area chart in my application however, I cannot get even the most basic one displayed (I literally checked to see if their implementation would work but it doesnt and throws this error)
Example I tried to run http://www.moxiegroup.com/moxieapps/gwt-highcharts/showcase/#area-range
com.google.gwt.core.client.JavaScriptException: (TypeError)
#org.moxieapps.gwt.highcharts.client.BaseChart::nativeRenderChart(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;ZZLcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;)([string:
'Chart', JavaScript object(10), bool: false, bool: false, JavaScript
object(36), JavaScript object(37), JavaScript object(38), JavaScript
object(26), JavaScript object(32), JavaScript object(25), JavaScript
object(30), JavaScript object(31), JavaScript object(34), JavaScript
object(35)]): $wnd.Highcharts is undefined
Is it possible im using the incorrect JQuery? Any and all help is greatly appreciated since this feature is important to our application
The reason for this error was that while I was including highcharts.js, i was not including highcharts-more.js. Including this solved my problem!!

JStreeGrid Microsoft JScript runtime error: Object doesn't support this property or method

I'm using the JSTreeGrid in an ASP.NET application. The implementation of the JSTreeGrid works fine in the application in which it was designed in tested. However when I moved it over to another application I recieved the following error message below:
Microsoft JScript runtime error: Object doesn't support this property or method
When I initially moved the implementation over I discovered and corrected issues related to the new application forms utilizing Masterpages. The container names were concatenated to the div tags and the scripts were not finding the declared div tag IDs specified in the script. The application that I moved it from did not use Masterpages. I feel resonably certain that the error is related.
The error occurs in the _prepare_grid: function in the jstreegrid script when obj.each(function () section of script is run.
Any insight would be appreciated. Thanks
When you use master pages the Client ID of your DOM elements ia manupulated by the server.
This is due to the chace that you will use the same id both in the master page and in your derived page... when calling Jquery function i would guess that you use id selector i.e. $('#someID').doSomething() ...
When using master one of the solutions is to use the following selector as an exmaple:
$('[id$=myButton]').click(function(){ alert('button clicked'); });
This means that Jquery will select the element with an ID attribute that end with 'myButton'.
for more information follow this post.
How to use JQuery with Master Pages?