<?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: WAB: How to add onclick button trigger to theme header subtitle? in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/wab-how-to-add-onclick-button-trigger-to-theme/m-p/845511#M10312</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Francesco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&amp;nbsp;I thought that subtitle in the config.json passed the actual &amp;lt;div&amp;gt; elements that go into index.html.&lt;/BLOCKQUOTE&gt;&lt;P&gt;Nope not at all. It is just a string that goes to the header controller widget and that string gets set to the HeaderController Widget.html&amp;nbsp;subtitleNode as it's innerHTML.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The proper way to do it is to add a new html element to the&amp;nbsp;&lt;SPAN&gt;HeaderController Widget.html and then add your logic (button click event) to the Widget.js.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Sep 2017 23:51:15 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2017-09-14T23:51:15Z</dc:date>
    <item>
      <title>WAB: How to add onclick button trigger to theme header subtitle?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/wab-how-to-add-onclick-button-trigger-to-theme/m-p/845506#M10307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am customizing the header of the foldableTheme in WAB Dev Edition, and would like to make either the "subtitle" element or one of the "links" elements a button attached to an "onclick" event trigger to open a different URL (as an example). It seems like to customize the subtitle to a button I need to modify the main config.json in my web app:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;config.json:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;"appId": "",&lt;BR /&gt; "authorizedCrossOriginDomains": [""],&lt;BR /&gt; "title": "&amp;lt;div class=\"attribute-custom-style\"&amp;gt;&amp;lt;/div&amp;gt;",&lt;BR /&gt; &lt;STRONG&gt;"subtitle": "&amp;lt;button class=\"jimu-button-tutorial\" onclick=\"window.open(\"&amp;lt;my_url_here&amp;gt;\")\"&amp;gt;&amp;lt;b&amp;gt;&amp;lt;font size=\"2\" style=\"\"&amp;gt;Start Tutorial&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/button&amp;gt;"&lt;/STRONG&gt;,&lt;BR /&gt; "keepAppState": true,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The subtitle parameters is passed as a text string to the index.html and jimu styler, I am guessing. Then I can style my button creating a class called "&lt;SPAN style="background-color: #f6f6f6;"&gt;jimu-button-tutorial" inside ~jimu.js/css/jimu.css. However, the button does not click nor triggers any window opening with my URL. Any idea on what am I doing wrong?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2017 20:28:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/wab-how-to-add-onclick-button-trigger-to-theme/m-p/845506#M10307</guid>
      <dc:creator>FrancescoTonini2</dc:creator>
      <dc:date>2017-09-14T20:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: WAB: How to add onclick button trigger to theme header subtitle?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/wab-how-to-add-onclick-button-trigger-to-theme/m-p/845507#M10308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you missed escaping one quote, but not sure if that's the problem:&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6; border: 0px; font-weight: bold;"&gt;&lt;STRONG&gt;\"&amp;lt;my_url_here&amp;gt;\"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2017 21:01:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/wab-how-to-add-onclick-button-trigger-to-theme/m-p/845507#M10308</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2017-09-14T21:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: WAB: How to add onclick button trigger to theme header subtitle?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/wab-how-to-add-onclick-button-trigger-to-theme/m-p/845508#M10309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Darren, no I just typed &amp;lt;my_url&amp;gt; in the message above to replace my full URL and forgot to add it there, but I have the escape \ correctly set up...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2017 21:06:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/wab-how-to-add-onclick-button-trigger-to-theme/m-p/845508#M10309</guid>
      <dc:creator>FrancescoTonini2</dc:creator>
      <dc:date>2017-09-14T21:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: WAB: How to add onclick button trigger to theme header subtitle?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/wab-how-to-add-onclick-button-trigger-to-theme/m-p/845509#M10310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Francesco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Just adding HTML elements to the config.json like that will not work. There is not code in the Header controller widget that will parse the html element. You need to make your code changes to the Actual Header Controller widget .html and .js files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2017 21:24:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/wab-how-to-add-onclick-button-trigger-to-theme/m-p/845509#M10310</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-09-14T21:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: WAB: How to add onclick button trigger to theme header subtitle?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/wab-how-to-add-onclick-button-trigger-to-theme/m-p/845510#M10311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob,&lt;/P&gt;&lt;P&gt;that makes sense...so basically to accomplish what I want (fairly easy) I will need to find the subtitle object in the header controller files and add that same logic there (button trigger)? I thought that subtitle in the config.json passed the actual &amp;lt;div&amp;gt; elements that go into index.html.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2017 22:12:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/wab-how-to-add-onclick-button-trigger-to-theme/m-p/845510#M10311</guid>
      <dc:creator>FrancescoTonini2</dc:creator>
      <dc:date>2017-09-14T22:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: WAB: How to add onclick button trigger to theme header subtitle?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/wab-how-to-add-onclick-button-trigger-to-theme/m-p/845511#M10312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Francesco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&amp;nbsp;I thought that subtitle in the config.json passed the actual &amp;lt;div&amp;gt; elements that go into index.html.&lt;/BLOCKQUOTE&gt;&lt;P&gt;Nope not at all. It is just a string that goes to the header controller widget and that string gets set to the HeaderController Widget.html&amp;nbsp;subtitleNode as it's innerHTML.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The proper way to do it is to add a new html element to the&amp;nbsp;&lt;SPAN&gt;HeaderController Widget.html and then add your logic (button click event) to the Widget.js.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2017 23:51:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/wab-how-to-add-onclick-button-trigger-to-theme/m-p/845511#M10312</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-09-14T23:51:15Z</dc:date>
    </item>
  </channel>
</rss>

