<?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 connect JScript, Logic and/or BackingBeans?</title><link>https://answers.axonivy.com/questions/91/how-to-connect-jscript-logic-and-or-backingbeans</link><description>&lt;p&gt;I still have difficulties to bring backing beans, logic and jscript together. What I figured out is, that we have &lt;code&gt;actionListener&lt;/code&gt; or &lt;code&gt;listener&lt;/code&gt; 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 &lt;code&gt;onclick&lt;/code&gt;, &lt;code&gt;oncomplete&lt;/code&gt; or &lt;code&gt;onTabShow&lt;/code&gt;. &lt;/p&gt;
&lt;p&gt;So here is my first question: Are these assumptions correct?&lt;/p&gt;
&lt;p&gt;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?&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/91/how-to-connect-jscript-logic-and-or-backingbeans" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 19 Nov 2013 14:45:05 -0500</lastBuildDate><item><title>Answer by Raphael Bürgin</title><link>https://answers.axonivy.com/questions/91/how-to-connect-jscript-logic-and-or-backingbeans/94</link><description>&lt;p&gt;You can add a &lt;code&gt;&amp;lt;p:ajax&amp;gt;&lt;/code&gt; call on your element. With this you have a possibility to listen some events from the "parent" element. &lt;/p&gt;
&lt;p&gt;In Primfaces are no &lt;code&gt;onclick&lt;/code&gt;, &lt;code&gt;onblur&lt;/code&gt; event to fire a logic or backingbean. These are HTML attribute names to call normal javascript functions. &lt;/p&gt;
&lt;p&gt;But with primfaces they just called &lt;code&gt;blur&lt;/code&gt;, &lt;code&gt;click&lt;/code&gt;.
You find an example in the user guide from primefaces (Ajax Behavior Events). &lt;/p&gt;
&lt;p&gt;For example the selectOneMenu:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;p:selectOneMenu var="lang" value="#{data.language}"&amp;gt;
    &amp;lt;f:selectItem itemValue="de" itemLabel="de"/&amp;gt;                    
    &amp;lt;f:selectItem itemValue="fr" itemLabel="fr"/&amp;gt;
    &amp;lt;p:ajax event="change" listener="#{logic.changeLanguage}"/&amp;gt;
&amp;lt;/p:selectOneMenu&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I hope this will help you&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Raphael Bürgin</dc:creator><pubDate>Tue, 19 Nov 2013 14:45:05 -0500</pubDate><guid>https://answers.axonivy.com/questions/91/how-to-connect-jscript-logic-and-or-backingbeans/94</guid></item></channel></rss>