<?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: Print predefined layers via widget in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/print-predefined-layers-via-widget/m-p/799374#M5010</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked first time. Seriously amazing. Thank you.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Feb 2018 02:28:28 GMT</pubDate>
    <dc:creator>SimonWebster</dc:creator>
    <dc:date>2018-02-19T02:28:28Z</dc:date>
    <item>
      <title>Print predefined layers via widget</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/print-predefined-layers-via-widget/m-p/799368#M5004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I remember running across a widget that I cannot seem to re-find. Hoping someone might know of which I speak and be able to point me in the right direction.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a scenario where users need to print off a series of ~10 maps depending on what stage their projects are at. The main map contains all the layers that are to appear in these maps, however some layers will be shown for some print results, other times other layers are shown. The widget of which I speak allowed the preset of certain "templates", where it was possible to specify which layers were visible, and which were not.&lt;BR /&gt;&lt;BR /&gt;Ie, user sets the widget to template "3. Do a thing", and only those layers specified in that template were made visible.&lt;BR /&gt;&lt;BR /&gt;From memory this was also a custom printing widget, so of course the result could then invoke an ArcGIS server hosted printing script to apply the page template, etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any pointers in the right direction are very much appreciated.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2018 08:57:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/print-predefined-layers-via-widget/m-p/799368#M5004</guid>
      <dc:creator>SimonWebster</dc:creator>
      <dc:date>2018-02-14T08:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Print predefined layers via widget</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/print-predefined-layers-via-widget/m-p/799369#M5005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I have to say I have not run across that widget. But choosing a template is an OTB ability in the print widget. Now changing the visibility of layer based on the template would not be to hard to add to the OTB print widget for a developer. There are a couple of thread on programatically changing layer visibility in code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/161914"&gt;Make layer visible after LayerList widget has opened&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/164027"&gt;https://community.esri.com/thread/164027&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2018 14:21:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/print-predefined-layers-via-widget/m-p/799369#M5005</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-02-14T14:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Print predefined layers via widget</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/print-predefined-layers-via-widget/m-p/799370#M5006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Essentially I'd be looking to use the template change as a trigger to make visible / hide various layers in the OTB print widget. Makes sense. I'm assuming that this:&amp;nbsp;&lt;A href="https://community.esri.com/thread/164027"&gt;https://community.esri.com/thread/164027&lt;/A&gt;&amp;nbsp;will be a good lead.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2018 21:58:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/print-predefined-layers-via-widget/m-p/799370#M5006</guid>
      <dc:creator>SimonWebster</dc:creator>
      <dc:date>2018-02-14T21:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Print predefined layers via widget</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/print-predefined-layers-via-widget/m-p/799371#M5007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Yes that is correct. And yes the&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;setTopLayerVisible part of that thread is what you would use in the Print Widgets Print.js file.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2018 22:06:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/print-predefined-layers-via-widget/m-p/799371#M5007</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-02-14T22:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Print predefined layers via widget</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/print-predefined-layers-via-widget/m-p/799372#M5008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I may ask for a little more direction, for lack of progress otherwise:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm assuming at the moment that in Print.js the area I wish to focus on is 'onLayoutchange: function(newvalue) {'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the moment I'm stuck simply turning a layer on an off. I'm happy to hard code the layers to turn on and off in to the function for now. &amp;nbsp;&lt;BR /&gt;Using the following as an example, I've been unable to decipher the correct way to address the getLayerInfoByID function to turn on and off the layer.&lt;/P&gt;&lt;P&gt;For the purpose of the exercise my test layer is&amp;nbsp;AdminBoundaryReduced_255_0 (this is a sub layer of a parent layer, or rather Layer ID 0 in the appropriate service).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this.operLayerInfos.getLayerInfoById('AdminBoundaryReduced_255_0').setTopLayerVisible(false);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function seems specific to addressing that layer from within the layers panel, as per the examples earlier. Would you happen to know how I should be addressing it from the print widget, or just generally?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My console error using the above looks like:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN class="" style="color: #222222; background-color: #fff0f0; margin-left: 4px;"&gt;&lt;SPAN class="" style="color: #545454; text-decoration: underline;"&gt;Print.js?wab_dv=2.7:367&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: red !important; background-color: #fff0f0;"&gt;Uncaught &lt;SPAN class="" style="font-size: 12px !important;"&gt;&lt;SPAN&gt;TypeError: Cannot read property 'getLayerInfoById' of undefined&lt;BR /&gt; at Object.onLayoutChange (&lt;SPAN class="" style="color: #545454; text-decoration: underline;"&gt;Print.js?wab_dv=2.7:367&lt;/SPAN&gt;) &lt;BR /&gt;at Object.&amp;lt;anonymous&amp;gt; (&lt;SPAN class="" style="color: #545454; text-decoration: underline;"&gt;init.js:63&lt;/SPAN&gt;) &lt;BR /&gt;at Object.c [as onChange] (&lt;SPAN class="" style="color: #545454; text-decoration: underline;"&gt;init.js:119&lt;/SPAN&gt;) &lt;BR /&gt;at Object.&amp;lt;anonymous&amp;gt; (&lt;SPAN class="" style="color: #545454; text-decoration: underline;"&gt;init.js:390&lt;/SPAN&gt;) &lt;BR /&gt;at &lt;SPAN class="" style="color: #545454; text-decoration: underline;"&gt;init.js:63&lt;/SPAN&gt; &lt;BR /&gt;at Object.&amp;lt;anonymous&amp;gt; (&lt;SPAN class="" style="color: #545454; text-decoration: underline;"&gt;init.js:365&lt;/SPAN&gt;) &lt;BR /&gt;at &lt;SPAN class="" style="color: #545454; text-decoration: underline;"&gt;init.js:63&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Feb 2018 01:01:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/print-predefined-layers-via-widget/m-p/799372#M5008</guid>
      <dc:creator>SimonWebster</dc:creator>
      <dc:date>2018-02-16T01:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Print predefined layers via widget</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/print-predefined-layers-via-widget/m-p/799373#M5009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Use this:&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layerInfosObj&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getLayerInfoById&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'AdminBoundaryReduced_255_0'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setTopLayerVisible&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Feb 2018 15:03:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/print-predefined-layers-via-widget/m-p/799373#M5009</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-02-16T15:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Print predefined layers via widget</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/print-predefined-layers-via-widget/m-p/799374#M5010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked first time. Seriously amazing. Thank you.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Feb 2018 02:28:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/print-predefined-layers-via-widget/m-p/799374#M5010</guid>
      <dc:creator>SimonWebster</dc:creator>
      <dc:date>2018-02-19T02:28:28Z</dc:date>
    </item>
  </channel>
</rss>

