<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>How to get click event from web screenlet</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=109284850" />
  <subtitle>How to get click event from web screenlet</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=109284850</id>
  <updated>2026-04-05T01:58:39Z</updated>
  <dc:date>2026-04-05T01:58:39Z</dc:date>
  <entry>
    <title>RE: How to get click event from web screenlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110702459" />
    <author>
      <name>Victor Galan</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110702459</id>
    <updated>2018-08-14T14:41:21Z</updated>
    <published>2018-08-14T14:41:21Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;I've just saw the video, for keeping a script while navigation
  throught SPA, you have an utility function in the Screens global
  object, basically you have to pass the function that you need to
  preserver when SPA navigation happens.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You have to do this in your case:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
  &lt;code&gt;window.Screens.addScreensScript(modifyItem);&lt;/code&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Victor Galan</dc:creator>
    <dc:date>2018-08-14T14:41:21Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to get click event from web screenlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110699854" />
    <author>
      <name>Prakash Kumar Singh</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110699854</id>
    <updated>2018-08-14T09:30:42Z</updated>
    <published>2018-08-14T09:30:42Z</published>
    <summary type="html">&lt;blockquote&gt;
  &lt;div class="quote-title"&gt;Victor Galan:&lt;/div&gt;
  &lt;div class="quote"&gt;
    &lt;div class="quote-content"&gt;
      &lt;p&gt;Hi!&lt;/p&gt;
      &lt;p&gt;So, to be able to reproduce it, how are you reloading the page?&lt;/p&gt;
      &lt;p&gt;The video you shared is private&lt;/p&gt;
      &lt;p&gt; &lt;/p&gt;
      &lt;p&gt;Regards&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Now video is accessible for you. Please check video once more.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Prakash Kumar Singh</dc:creator>
    <dc:date>2018-08-14T09:30:42Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to get click event from web screenlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110688159" />
    <author>
      <name>Victor Galan</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110688159</id>
    <updated>2018-08-13T15:25:41Z</updated>
    <published>2018-08-13T15:25:41Z</published>
    <summary type="html">&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;So, to be able to reproduce it, how are you reloading the page?&lt;/p&gt;
&lt;p&gt;The video you shared is private&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;</summary>
    <dc:creator>Victor Galan</dc:creator>
    <dc:date>2018-08-13T15:25:41Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to get click event from web screenlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110680164" />
    <author>
      <name>Prakash Kumar Singh</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110680164</id>
    <updated>2018-08-09T10:25:36Z</updated>
    <published>2018-08-09T10:25:36Z</published>
    <summary type="html">&lt;blockquote&gt;
  &lt;div class="quote-title"&gt;Victor Galan:&lt;/div&gt;
  &lt;div class="quote"&gt;
    &lt;div class="quote-content"&gt;
      &lt;p&gt;What version of Liferay Screens are you using? This was fixed
        in the latest version (4.0.0)&lt;/p&gt;
      &lt;p&gt;Can you try that version and check if the issue still exists?&lt;/p&gt;
      &lt;p&gt; &lt;/p&gt;
      &lt;p&gt;Regards&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;issue still exist with latest version of screen 4.0.0 &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Prakash Kumar Singh</dc:creator>
    <dc:date>2018-08-09T10:25:36Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to get click event from web screenlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110674561" />
    <author>
      <name>Victor Galan</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110674561</id>
    <updated>2018-08-07T19:55:30Z</updated>
    <published>2018-08-07T19:55:30Z</published>
    <summary type="html">&lt;p&gt;What version of Liferay Screens are you using? This was fixed in the
  latest version (4.0.0)&lt;/p&gt;
&lt;p&gt;Can you try that version and check if the issue still exists?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;</summary>
    <dc:creator>Victor Galan</dc:creator>
    <dc:date>2018-08-07T19:55:30Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to get click event from web screenlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110670881" />
    <author>
      <name>Prakash Kumar Singh</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110670881</id>
    <updated>2018-08-06T06:07:54Z</updated>
    <published>2018-08-06T06:07:54Z</published>
    <summary type="html">&lt;blockquote&gt;
  &lt;div class="quote-title"&gt;Victor Galan:&lt;/div&gt;
  &lt;div class="quote"&gt;
    &lt;div class="quote-content"&gt;Hey! You can inject a script in the
      WebScreenlet to detect the click event and then communicate with
      the native part to perform some action. You have to create a
      script in js that handles the click event and call the method
      [code]window.Screens.postMessage('clicked', )[/code] After doing
      this, you will have to implement the WebScreenlet listener in your
      activity. You will receive the message from js in the method
      onScriptMessageHandler. In that method you can perform the action
      you need with the data received You have documentation about the
      webScreenlet
      [url=https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/rendering-web-pages-in-your-android-app]here[/url]
      and
      [url=https://dev.liferay.com/develop/reference/-/knowledge_base/7-0/web-screenlet-for-android]here[/url]
      I hope it helps :) Regards,&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Injecting a script in both iOS and Android works only first time when
  page loaded. If the page refreshed than it doesn't work. Here I have
  shown an example in this video link.  &lt;a href="https://drive.google.com/open?id=1Q0fCWZ3U2naRHEGhXbrapmLcNyqA7TXN"&gt;https://drive.google.com/open?id=1Q0fCWZ3U2naRHEGhXbrapmLcNyqA7TXN&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Prakash Kumar Singh</dc:creator>
    <dc:date>2018-08-06T06:07:54Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to get click event from web screenlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109288009" />
    <author>
      <name>Victor Galan</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109288009</id>
    <updated>2018-06-01T13:27:31Z</updated>
    <published>2018-06-01T13:27:31Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hey!&lt;br&gt;&lt;br&gt;You can inject a script in the WebScreenlet to detect the click event and then communicate with the native part to perform some action.&lt;br&gt;&lt;br&gt;You have to create a script in js that handles the click event and call the method &lt;pre&gt;&lt;code&gt;window.Screens.postMessage('clicked', &amp;lt;data-that-will-be-received-in-native&amp;gt;)&amp;lt;/data-that-will-be-received-in-native&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;After doing this, you will have to implement the WebScreenlet listener in your activity. You will receive the message from js in the method onScriptMessageHandler. In that method you can perform the action you need with the data received &lt;br&gt;&lt;br&gt;You have documentation about the webScreenlet &lt;a href="https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/rendering-web-pages-in-your-android-app"&gt;here&lt;/a&gt; and &lt;a href="https://dev.liferay.com/develop/reference/-/knowledge_base/7-0/web-screenlet-for-android"&gt;here&lt;/a&gt;&lt;br&gt;&lt;br&gt;I hope it helps &lt;img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif"&gt;&lt;br&gt;&lt;br&gt;Regards,&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Victor Galan</dc:creator>
    <dc:date>2018-06-01T13:27:31Z</dc:date>
  </entry>
  <entry>
    <title>How to get click event from web screenlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109284849" />
    <author>
      <name>Prakash Kumar Singh</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109284849</id>
    <updated>2018-06-01T11:45:49Z</updated>
    <published>2018-06-01T11:45:49Z</published>
    <summary type="html">Hi &lt;br /&gt;   i am using web screenlet version 3.1.0 in android. it rendering my current url and showing web content display portlet .Web content display has liferay document url. When i am clicking this url , nothing is happening . If i render same url in android webview and click same document url, it redirects to browser ,means i am able to get this url in click event but not in  web screenlet . &lt;br /&gt;&lt;br /&gt;Then my question is .How to get value of internal click event in web screenlet ?&lt;br /&gt;&lt;br /&gt;Regards &lt;br /&gt;&lt;br /&gt;Prakash</summary>
    <dc:creator>Prakash Kumar Singh</dc:creator>
    <dc:date>2018-06-01T11:45:49Z</dc:date>
  </entry>
</feed>
