Questions Tagged With javascripthttps://answers.axonivy.com/tags/javascript/?type=rssquestions tagged <span class="tag">javascript</span>enFri, 28 Feb 2020 07:44:51 -0500Loading ES6 imports and Moduleshttps://answers.axonivy.com/questions/4431/loading-es6-imports-and-modules<p>Hello, So i was follwoing the xample in the HTMLDialogDemos, and I tried to create an es6 module and import it. This worked, however, the imports that my module require are not being imported correctly. This is due to the fact that ES6 imports dont automatically ad the "ln=xpertivy-3-webContent" query param that its calling module got. </p> <p>To be clear, i imported page.js via </p> <pre><code>&lt;h:outputScript a:type="module" library="js/PureHtmlDialog" name="page.js"&gt; &lt;/h:outputScript&gt; </code></pre> <p>which gets the file at</p> <pre><code><a href="http://localhost:8081/ivy/faces/javax.faces.resource/resources/js/PureHtmlDialog/page.js?ln=xpertivy-3-webContent&amp;xv=124700577218">http://localhost:8081/ivy/faces/javax.faces.resource/resources/js/PureHtmlDialog/page.js?ln=xpertivy-3-webContent&amp;xv=124700577218</a> </code></pre> <p>which attempts to import </p> <pre><code>import {Button,Column,Header} from "../component.js"; </code></pre> <p>which in turn gets the URL</p> <pre><code><a href="http://localhost:8081/ivy/faces/javax.faces.resource/resources/js/component.js">http://localhost:8081/ivy/faces/javax.faces.resource/resources/js/component.js</a> </code></pre> <p>if I try to visit the URL</p> <pre><code><a href="http://localhost:8081/ivy/faces/javax.faces.resource/resources/js/component.js?ln=xpertivy-3-webContent">http://localhost:8081/ivy/faces/javax.faces.resource/resources/js/component.js?ln=xpertivy-3-webContent</a> </code></pre> <p>then i can see the file correctly. </p> <p>I also tried to, inside the folder of the HTML dialog itself, to put a javascript file and import it with a plain script tag. This didnt work, and actually crashed the page. </p> <p>Is there a better way to do javascript file imports and es6 imports?</p>TareqKFri, 28 Feb 2020 07:44:51 -0500https://answers.axonivy.com/questions/4431/loading-es6-imports-and-moduleshtmluserdialoghtmldialogjavascriptAccess CMS in Javascript filehttps://answers.axonivy.com/questions/1873/access-cms-in-javascript-file<p>Hello All,</p> <p>Is it possible to reference CMS resources in a Javascript file ? (Like in the way we access them in CSS file)</p> <p>Also is it possible to get resources from the CMS via Ajax from Html DIalog ?</p> <p>Best Regards, Yordan Yunchov</p>Stelt0Fri, 08 Jul 2016 10:34:59 -0400https://answers.axonivy.com/questions/1873/access-cms-in-javascript-filehtmldialogjavascriptcmsUsing Modern JavaScript Frameworkshttps://answers.axonivy.com/questions/1828/using-modern-javascript-frameworks<p>Hello Guys,</p> <p>I`m new to the BMP tool.</p> <p>Is there a way to work with modern JS frameworks (jQuery, KnockoutJS, AngularJS, ReactJS..etc.) in the HTML Dialog ? My goal is to "escape from the chains" of PrimeFaces and JSF. I want to be able to keep the client-side logic in JavaScript and the back-end logic in the BPM tool.</p> <p>Best Regards, Yordan</p>Stelt0Tue, 21 Jun 2016 15:47:02 -0400https://answers.axonivy.com/questions/1828/using-modern-javascript-frameworkshtmluserdialogjsfjavascriptHow to get param ln when loading a HtmlUserDialog pagehttps://answers.axonivy.com/questions/1106/how-to-get-param-ln-when-loading-a-htmluserdialog-page<p>Hi all,</p> <p>I have a HtmlUserDialog project and have a page which included some js/css file. Normally we just use the tag like this:</p> <pre><code>&lt;script src="#{resource['ivy-webcontent:js/xportal-common.js']}" /&gt; </code></pre> <p>And i can see after the page was loaded, the code will be:</p> <pre><code>&lt;script src="/ivy/faces/javax.faces.resource/js/xportal-common.js?ln=xpertivy-5-webContent"&gt; </code></pre> <p>You can see this &lt;script&gt;, it is always end with param <strong>ln=xpertivy-&lt;number&gt;-webContent</strong> The &lt;number&gt; here is different. So, for example, when i use some third party js libraries, it have some code to load some others js files by javascript after page loaded, but it can't because i don't have the right &lt;number&gt; of param <strong>ln</strong>. If anyone here used to use RequireJS, you can understand the situation.</p> <p>My question is: There is any way to know exactly the parameter <strong>ln</strong> that ivy will put to the end of &lt;script&gt; ?</p> <p>Note: Actually i can get this value by using javascript to read other existing &lt;script&gt; and copy from there but i really don't like that way.</p> <p>Anyone can have me?</p>trungdvTue, 06 Jan 2015 13:05:58 -0500https://answers.axonivy.com/questions/1106/how-to-get-param-ln-when-loading-a-htmluserdialog-pagehtmluserdialogjavascriptHow to connect JScript, Logic and/or BackingBeans?https://answers.axonivy.com/questions/91/how-to-connect-jscript-logic-and-or-backingbeans<p>I still have difficulties to bring backing beans, logic and jscript together. What I figured out is, that we have <code>actionListener</code> or <code>listener</code> on the one hand (this enables us to start a method or an event in the dialog's logic or a backing bean), and on the other hand we have jscript events like <code>onclick</code>, <code>oncomplete</code> or <code>onTabShow</code>. </p> <p>So here is my first question: Are these assumptions correct?</p> <p>And here is my second question: When I want an event, method or a backing bean in the logic to be executed when a javascript-event is fired how can I do that?</p>Nikel WeisTue, 19 Nov 2013 11:31:44 -0500https://answers.axonivy.com/questions/91/how-to-connect-jscript-logic-and-or-backingbeanshtmluserdialogjavascriptHow to call JavaScript from HTML Dialog View or Logichttps://answers.axonivy.com/questions/75/how-to-call-javascript-from-html-dialog-view-or-logic<p>We need to integrate some JavaScript code in the HTML Dialog and we need the good way to call JavaScript from HTML Dialog View or Logic and pass some data. How to do that? Thanks.</p>Rifat BinjosThu, 14 Nov 2013 09:16:50 -0500https://answers.axonivy.com/questions/75/how-to-call-javascript-from-html-dialog-view-or-logichtmluserdialogjavascript