<?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: Problem with resize flex viewer template in ArcGIS Viewer for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/problem-with-resize-flex-viewer-template/m-p/19351#M657</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no reference to wCanvas in the later versions of the viewer, you should be able to change the size of the widget using the properties of wTemplate, add the following function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public function setResize(nHeight:Number, nWidth:Number):void&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;wTemplate.height&amp;nbsp; = nHeight;&amp;nbsp; &lt;/P&gt;&lt;P&gt;wTemplate.width = nWidth;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then call the function from what ever action you want:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;setResize(900,900)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anthony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Dec 2014 09:06:52 GMT</pubDate>
    <dc:creator>AnthonyGiles</dc:creator>
    <dc:date>2014-12-09T09:06:52Z</dc:date>
    <item>
      <title>Problem with resize flex viewer template</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/problem-with-resize-flex-viewer-template/m-p/19350#M656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my flex viewer, I need to change the template size at runtime. Have found the previous thread but cannot ask question there.&lt;/P&gt;&lt;P&gt;I refer to the following link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://forums.esri.com/Thread.asp?c=158&amp;amp;f=2421&amp;amp;t=279252"&gt;http://forums.esri.com/Thread.asp?c=158&amp;amp;f=2421&amp;amp;t=279252&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I follow the steps advised by Robert as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1) added the line in IWidgetTemplate.as&lt;/P&gt;&lt;P&gt;function setResize(value1:Number, value2:Number):void;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(2) added the following code in the WidgetTemplate.as&lt;/P&gt;&lt;P&gt;public function setResize(nHeight:Number, nWidth:Number):void&lt;BR /&gt;{&lt;BR /&gt; this.height&amp;nbsp; = nHeight;&lt;BR /&gt; wCanvas.height = nHeight;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; this.width = nWidth;&lt;BR /&gt; wCanvas.width = nWidth - 40;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I got the error:&lt;/P&gt;&lt;P&gt;access of undefined property wCanvas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(3) add the following in mx:State in the mxml which I want to resize the template.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;mx:SetProperty target="{wCanvas}" name="height" value="{height}"/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;mx:SetProperty target="{wCanvas}" name="width" value="{width - 40}"/&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But wherever I put the mx:state, It always return me:&lt;/P&gt;&lt;P&gt;&amp;lt;mx:state&amp;gt; is not allowed here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure whether step (3) is correct, and where should I define wCanvas? or should I use wTemplate instead of wCanvas?&lt;/P&gt;&lt;P&gt;Or is it because the version is different (I use version 3.6).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea? advice is appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Dec 2014 08:23:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/problem-with-resize-flex-viewer-template/m-p/19350#M656</guid>
      <dc:creator>WuYang</dc:creator>
      <dc:date>2014-12-09T08:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with resize flex viewer template</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/problem-with-resize-flex-viewer-template/m-p/19351#M657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no reference to wCanvas in the later versions of the viewer, you should be able to change the size of the widget using the properties of wTemplate, add the following function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public function setResize(nHeight:Number, nWidth:Number):void&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;wTemplate.height&amp;nbsp; = nHeight;&amp;nbsp; &lt;/P&gt;&lt;P&gt;wTemplate.width = nWidth;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then call the function from what ever action you want:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;setResize(900,900)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anthony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Dec 2014 09:06:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/problem-with-resize-flex-viewer-template/m-p/19351#M657</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2014-12-09T09:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with resize flex viewer template</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/problem-with-resize-flex-viewer-template/m-p/19352#M658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anthony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for the answer, seems new version is easier, but after I update the code, the template size never change. should I change the basewidget also?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: After I drag the template I can change the size. I use setResize at init(), is should resize when loading the template right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 04:05:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/problem-with-resize-flex-viewer-template/m-p/19352#M658</guid>
      <dc:creator>WuYang</dc:creator>
      <dc:date>2014-12-10T04:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with resize flex viewer template</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/problem-with-resize-flex-viewer-template/m-p/19353#M659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure what you are trying to achieve by setting the width and height in the init() function. Out of the box widgets can be resized in the main config file, by adding the width and height attributes to the widget tag:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Widget_tag/01m30000001w000000/" title="http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Widget_tag/01m30000001w000000/"&gt;ArcGIS Viewer for Flex&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g: &amp;lt;widget label="GeoRSS" url="widgets/GeoRSS/GeoRSSWidget.swf" config="widgets/GeoRSS/GeoRSSWidget.xml" width="350" height="300"/&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are creating your own widget then you can add the width and height attributes to the widgetTemplate tag:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;viewer:WidgetTemplate id="wTemplate" width="350" height="300" .....&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anthony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 08:10:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/problem-with-resize-flex-viewer-template/m-p/19353#M659</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2014-12-10T08:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with resize flex viewer template</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/problem-with-resize-flex-viewer-template/m-p/19354#M660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank Anthony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have already set the width and height according to page you gave.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I need to change every time because in my widget I need to load several images (the number of images will change each time).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am thinking another approach, which use a auto scrollbar to the widget, but also cannot get what I want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Dec 2014 04:09:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/problem-with-resize-flex-viewer-template/m-p/19354#M660</guid>
      <dc:creator>WuYang</dc:creator>
      <dc:date>2014-12-12T04:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with resize flex viewer template</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/problem-with-resize-flex-viewer-template/m-p/19355#M661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I dynamically change the size of my widgets at runtime using this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;wTemplate.widgetWidth = wTemplate.width = 530;
wTemplate.widgetHeight = wTemplate.height = 335;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:46:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/problem-with-resize-flex-viewer-template/m-p/19355#M661</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-10T20:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with resize flex viewer template</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/problem-with-resize-flex-viewer-template/m-p/19356#M662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;awesome, it works. thanks so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2014 04:19:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/problem-with-resize-flex-viewer-template/m-p/19356#M662</guid>
      <dc:creator>WuYang</dc:creator>
      <dc:date>2014-12-15T04:19:19Z</dc:date>
    </item>
  </channel>
</rss>

