<?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 Can the config file be changed dynamically? in ArcGIS Viewer for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/can-the-config-file-be-changed-dynamically/m-p/117633#M4058</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I want to change the config file that gets loaded depending on a user's action. My Flex application has a master view with a large map that has several widgets. I want a details view popup to include the same map, but smaller, zoomed in, and with a different config that removes all the widgets.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've seen a handful of similar posts like &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/42344-How-do-I-manage-multiple-flex-sites?highlight=multiple+config+files"&gt;http://forums.arcgis.com/threads/42344-How-do-I-manage-multiple-flex-sites?highlight=multiple+config+files&lt;/A&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/23260-Very-basic-Flex-Veiwer-question.?highlight=multiple+config+files"&gt;http://forums.arcgis.com/threads/23260-Very-basic-Flex-Veiwer-question.?highlight=multiple+config+files&lt;/A&gt;&lt;SPAN&gt; but those deal with passing the config file name in a URL parameter. My Flex application includes the ViewerContainer in two different Spark Panels, one in the main application and a second in a TitleWindow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd like to pass in the name of the config file to use depending on which view is presented. Is that possible, or is there a different way I should approach this? I'm using Flex Viewer 3.5.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Oct 2013 20:23:37 GMT</pubDate>
    <dc:creator>BartPosselt</dc:creator>
    <dc:date>2013-10-17T20:23:37Z</dc:date>
    <item>
      <title>Can the config file be changed dynamically?</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/can-the-config-file-be-changed-dynamically/m-p/117633#M4058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I want to change the config file that gets loaded depending on a user's action. My Flex application has a master view with a large map that has several widgets. I want a details view popup to include the same map, but smaller, zoomed in, and with a different config that removes all the widgets.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've seen a handful of similar posts like &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/42344-How-do-I-manage-multiple-flex-sites?highlight=multiple+config+files"&gt;http://forums.arcgis.com/threads/42344-How-do-I-manage-multiple-flex-sites?highlight=multiple+config+files&lt;/A&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/23260-Very-basic-Flex-Veiwer-question.?highlight=multiple+config+files"&gt;http://forums.arcgis.com/threads/23260-Very-basic-Flex-Veiwer-question.?highlight=multiple+config+files&lt;/A&gt;&lt;SPAN&gt; but those deal with passing the config file name in a URL parameter. My Flex application includes the ViewerContainer in two different Spark Panels, one in the main application and a second in a TitleWindow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd like to pass in the name of the config file to use depending on which view is presented. Is that possible, or is there a different way I should approach this? I'm using Flex Viewer 3.5.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 20:23:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/can-the-config-file-be-changed-dynamically/m-p/117633#M4058</guid>
      <dc:creator>BartPosselt</dc:creator>
      <dc:date>2013-10-17T20:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can the config file be changed dynamically?</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/can-the-config-file-be-changed-dynamically/m-p/117634#M4059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The name of the config file used is set in com.esri.viewer.ViewerContainer.mxml in the setConfigFile function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private function setConfigFile():void
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; //retrieve FlashVars.
&amp;nbsp;&amp;nbsp;&amp;nbsp; var flashvarConfig:String = FlexGlobals.topLevelApplication.parameters.config;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (flashvarConfig)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; configFile = flashvarConfig;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; //retrieve config from URL and override FlashVar
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (urlConfigParams.config)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; configFile = urlConfigParams.config;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you don't pass a config parameter in the URL then flashvarConfig is used, which represents config.xml&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can change things in this function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For example here's my own setConfigFile function where I've added a section to get the config from a Cookie.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private function setConfigFile():void
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; //retrieve FlashVars.
&amp;nbsp;&amp;nbsp;&amp;nbsp; var flashvarConfig:String = FlexGlobals.topLevelApplication.parameters.config;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (flashvarConfig)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; configFile = flashvarConfig;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; //retrieve config from Cookie and override FlashVar
&amp;nbsp;&amp;nbsp;&amp;nbsp; var cookie:Object = CookieUtil.getCookie("config");
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (cookie){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; configFile = cookie.toString();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CookieUtil.deleteCookie("config");
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; //retrieve config from URL and override FlashVar and Cookie
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (urlConfigParams.config)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; configFile = urlConfigParams.config;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So you need to change the value of the configFile variable for your ViewerContainer somehow. Maybe what you could do is hardcode it in setConfigFile(), use a specific config-abc.xml depending on the id of each ViewerContainer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:54:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/can-the-config-file-be-changed-dynamically/m-p/117634#M4059</guid>
      <dc:creator>YohanBienvenue</dc:creator>
      <dc:date>2021-12-11T06:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can the config file be changed dynamically?</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/can-the-config-file-be-changed-dynamically/m-p/117635#M4060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;BR /&gt;So you need to change the value of the configFile variable for your ViewerContainer somehow. Maybe what you could do is hardcode it in setConfigFile(), use a specific config-abc.xml depending on the id of each ViewerContainer.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's pretty close to what I was looking for. A quick test shows that it works just like you said, but it would be good to be able to set the config file from the parent application, rather than hardcoding in the Flex viewer's source, which will be overwritten when updated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My map needs are quite simple, so I'm going to explore using the Flex API directly.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 13:11:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/can-the-config-file-be-changed-dynamically/m-p/117635#M4060</guid>
      <dc:creator>BartPosselt</dc:creator>
      <dc:date>2013-10-18T13:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can the config file be changed dynamically?</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/can-the-config-file-be-changed-dynamically/m-p/117636#M4061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Have you looked into the following User Config Selection Widget:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=a28b758b3fc14c5794b30d5c230713fb"&gt;http://www.arcgis.com/home/item.html?id=a28b758b3fc14c5794b30d5c230713fb&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems like it might do what you are looking for.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 14:56:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/can-the-config-file-be-changed-dynamically/m-p/117636#M4061</guid>
      <dc:creator>GeorgeHaskett</dc:creator>
      <dc:date>2013-10-18T14:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can the config file be changed dynamically?</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/can-the-config-file-be-changed-dynamically/m-p/117637#M4062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Have you looked into the following User Config Selection Widget:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=a28b758b3fc14c5794b30d5c230713fb"&gt;http://www.arcgis.com/home/item.html?id=a28b758b3fc14c5794b30d5c230713fb&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It seems like it might do what you are looking for.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I only took a quick look at that widget, but it appears to be loading the .html file with the ?config=value based on what role is selected. So I don't think that would work in my case.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 15:10:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/can-the-config-file-be-changed-dynamically/m-p/117637#M4062</guid>
      <dc:creator>BartPosselt</dc:creator>
      <dc:date>2013-10-18T15:10:06Z</dc:date>
    </item>
  </channel>
</rss>

