<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to call JavaScript from HTML Dialog View or Logic</title><link>https://answers.axonivy.com/questions/75/how-to-call-javascript-from-html-dialog-view-or-logic</link><description>&lt;p&gt;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.&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/75/how-to-call-javascript-from-html-dialog-view-or-logic" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 14 Nov 2013 09:57:30 -0500</lastBuildDate><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/75/how-to-call-javascript-from-html-dialog-view-or-logic/76</link><description>&lt;p&gt;From the view you can call javascript by binding it to the available widget events. For example on the command button you can bind your script to "onClick":  &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;p:commandButton onclick="alert('hi javascript world' + #{data.myString})"/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Primefaces also makes it possible to execute javascript within a bean (in the process logic). A sample can be found in the &lt;a href="http://www.primefaces.org/showcase/ui/requestContext.jsf"&gt;primefaces showcase&lt;/a&gt;.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Thu, 14 Nov 2013 09:57:30 -0500</pubDate><guid>https://answers.axonivy.com/questions/75/how-to-call-javascript-from-html-dialog-view-or-logic/76</guid></item></channel></rss>