<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can I execute a javascript function when clicking an action? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/how-can-i-execute-a-javascript-function-when-clicking-an-action/m-p/314701#M1702</link>
    <description>&lt;P&gt;For the moment I've changed the action type. I've created an action of type "template", so I am in control of what I want to execute when the user clicks on the link.
Anyway, I would love to know if the onclick property works and I am doing it wrong.
Regards,&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jun 2018 11:11:47 GMT</pubDate>
    <dc:creator>ioihanguren_</dc:creator>
    <dc:date>2018-06-19T11:11:47Z</dc:date>
    <item>
      <title>How can I execute a javascript function when clicking an action?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-can-i-execute-a-javascript-function-when-clicking-an-action/m-p/314700#M1701</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have an action of type "bare_link", and I would like to execute a javascript function when the user clicks on the link, so I can register the event on the Audit Logs.&lt;/P&gt;
&lt;P&gt;I've seen that bare_link type actions are supposed to have a property called "onclick" to execute JS functions: &lt;A href="http://showcase.nuxeo.com/nuxeo/layoutDemo/bare_linkAction" target="test_blank"&gt;http://showcase.nuxeo.com/nuxeo/layoutDemo/bare_linkAction&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I've tried adding the onclick property in two ways, but none of them worked.&lt;/P&gt;
&lt;P&gt;Test 1:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;action id="actionId" link="#{actionBean.method()}" type="bare_link"
            label="label" icon="/icons/icon.png" order="150" onclick="alert('AAAA')"&amp;gt;
      &amp;lt;category&amp;gt;BLOB_ACTIONS&amp;lt;/category&amp;gt;
&amp;lt;/action&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Test 2:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;action id="actionId" link="#{actionBean.method()}" type="bare_link"
            label="label" icon="/icons/icon.png" order="150"&amp;gt;
	&amp;lt;category&amp;gt;BLOB_ACTIONS&amp;lt;/category&amp;gt;
	&amp;lt;properties&amp;gt;
		&amp;lt;property name="onclick"&amp;gt;alert('AAAA')&amp;lt;/property&amp;gt;
	&amp;lt;/properties&amp;gt;
&amp;lt;/action&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have searched in the Nuxeo code and I have seen that the property is never used.&lt;/P&gt;
&lt;P&gt;Does it work? Am I doing something wrong?
Is there any other way to achieve what I want?&lt;/P&gt;
&lt;P&gt;Thank you very much in advance,
Ibai&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 11:05:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-can-i-execute-a-javascript-function-when-clicking-an-action/m-p/314700#M1701</guid>
      <dc:creator>ioihanguren_</dc:creator>
      <dc:date>2018-06-14T11:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: How can I execute a javascript function when clicking an action?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-can-i-execute-a-javascript-function-when-clicking-an-action/m-p/314701#M1702</link>
      <description>&lt;P&gt;For the moment I've changed the action type. I've created an action of type "template", so I am in control of what I want to execute when the user clicks on the link.
Anyway, I would love to know if the onclick property works and I am doing it wrong.
Regards,&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 11:11:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-can-i-execute-a-javascript-function-when-clicking-an-action/m-p/314701#M1702</guid>
      <dc:creator>ioihanguren_</dc:creator>
      <dc:date>2018-06-19T11:11:47Z</dc:date>
    </item>
  </channel>
</rss>

