Greetings,
In my flex viewer, I need to change the template size at runtime. Have found the previous thread but cannot ask question there.
I refer to the following link:
http://forums.esri.com/Thread.asp?c=158&f=2421&t=279252
I follow the steps advised by Robert as follows:
(1) added the line in IWidgetTemplate.as
function setResize(value1:Number, value2:Number):void;
(2) added the following code in the WidgetTemplate.as
public function setResize(nHeight:Number, nWidth:Number):void
{
this.height = nHeight;
wCanvas.height = nHeight;
this.width = nWidth;
wCanvas.width = nWidth - 40;
}
But I got the error:
access of undefined property wCanvas.
(3) add the following in mx:State in the mxml which I want to resize the template.
<mx:SetProperty target="{wCanvas}" name="height" value="{height}"/>
<mx:SetProperty target="{wCanvas}" name="width" value="{width - 40}"/>
But wherever I put the mx:state, It always return me:
<mx:state> is not allowed here.
I am not sure whether step (3) is correct, and where should I define wCanvas? or should I use wTemplate instead of wCanvas?
Or is it because the version is different (I use version 3.6).
Any idea? advice is appreciated.