Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There are a couple of different ways to have portlets talk with each other. Most are covered under the documentation of <a href="http://www.liferay.com/community/wiki/-/wiki/Main/Inter-portlet+communication;jsessionid=916639CD65CDFFA477343D48BCCAEEC4.node-2" rel="nofollow">IPC</a>'s and the <a href="http://www.liferay.com/community/wiki/-/wiki/Main/Client-side+Inter-Portlet+Communication;jsessionid=6CACC5A9C08E957058936D3368E3C24F.node-2" rel="nofollow">descendant</a> <a href="http://www.liferay.com/community/wiki/-/wiki/Main/Eventing+and+Shared+Render+Parameters;jsessionid=6CACC5A9C08E957058936D3368E3C24F.node-2" rel="nofollow">pages</a>.</p> <p>In your case, you should really look at the <a href="http://www.liferay.com/community/wiki/-/wiki/Main/Client-side+Inter-Portlet+Communication;jsessionid=6CACC5A9C08E957058936D3368E3C24F.node-2" rel="nofollow">client-side</a> page:</p> <p>With your basic structure</p> <pre><code>&lt;a href="javascript:void(0)" class="comm-demo"&gt;demo[number]&lt;/a&gt; </code></pre> <p>You would have this JS on the "transmitter portlet":</p> <pre><code>// you may need to have jQuery instead of $. Liferay may have its own // $ function which jQuery shouldn't mess with. $( function () { $('a.comm-demo').click( function(event) { var txt = $(this).next().val(); // demo&lt;number&gt; Liferay.trigger('click', {text: txt}); return false; }); }); </code></pre> <p>Then on the "receiving portlet(s)":</p> <pre><code> Liferay.bind( 'click', function(event, data) { var txt = data.text; // this will set all class-of-fields to have the text // "demo&lt;number from above&gt;Portlet" $('.class-of-fields')[0].html(txt + "Portlet"); // I believe there is a way to minimize/maximize a portlet by // simulating a mouse click, but research would be needed to // confirm. }); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload