How to remove the resizable button WidgetTemplate

2689
2
Jump to solution
06-03-2012 06:08 PM
FarhadNavaei
New Contributor III
Hi,

I need to remover the resizable button (right-bottom corner) of a viewer:WidgetTemplate, so that the user cannot resit it. I set resizable="false", but I got an error. What should I do?
Thanks
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
IvanBespalov
Occasional Contributor III
NB! tested in FlexViewer 25

1
in <BaseWidget> tag of MyGreatestWidget.mxml:
<?xml version="1.0" encoding="utf-8"?> <viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009" [INDENT]xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:viewer="com.esri.viewer.*" isResizeable="false">[/INDENT]


[/HR]

2
in <script> tag of MyGreatestWidget.mxml:
<?xml version="1.0" encoding="utf-8"?> <viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009" [INDENT]xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:viewer="com.esri.viewer.*" preinitialize="basewidget1_preinitializeHandler(event)"> <fx:Script> <![CDATA[ [INDENT]import mx.events.FlexEvent;  protected function basewidget1_preinitializeHandler(event:FlexEvent):void { [INDENT]this.isResizeable = false;[/INDENT] }[/INDENT] ]]> </fx:Script>[/INDENT]


[/HR]

3
in configuration file of MyGreatestWidget.mxml:
<configuration> [INDENT]<ismygreatestwidgetresizeable>mygreatestwidgetisnotresizeable</ismygreatestwidgetresizeable>[/INDENT] </configuration>

<?xml version="1.0" encoding="utf-8"?> <viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009" [INDENT]xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:viewer="com.esri.viewer.*" widgetConfigLoaded="init()"> [INDENT]<fx:Script> <![CDATA[ [INDENT]import mx.events.FlexEvent;     private function init():void { [INDENT]if (configXML) { [INDENT]if (String(configXML.ismygreatestwidgetresizeable) == "mygreatestwidgetisnotresizeable") { [INDENT]this.isResizeable = false;[/INDENT] }[/INDENT] }[/INDENT] }[/INDENT] ]]> </fx:Script>[/INDENT][/INDENT]


[/HR]

...
and other 357 ways to do it :cool:

[/HR]

P.S. There is such an ancient tradition, to ask questions about "Flex Viewer" on Flex Viewer Forum page

View solution in original post

2 Replies
IvanBespalov
Occasional Contributor III
NB! tested in FlexViewer 25

1
in <BaseWidget> tag of MyGreatestWidget.mxml:
<?xml version="1.0" encoding="utf-8"?> <viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009" [INDENT]xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:viewer="com.esri.viewer.*" isResizeable="false">[/INDENT]


[/HR]

2
in <script> tag of MyGreatestWidget.mxml:
<?xml version="1.0" encoding="utf-8"?> <viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009" [INDENT]xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:viewer="com.esri.viewer.*" preinitialize="basewidget1_preinitializeHandler(event)"> <fx:Script> <![CDATA[ [INDENT]import mx.events.FlexEvent;  protected function basewidget1_preinitializeHandler(event:FlexEvent):void { [INDENT]this.isResizeable = false;[/INDENT] }[/INDENT] ]]> </fx:Script>[/INDENT]


[/HR]

3
in configuration file of MyGreatestWidget.mxml:
<configuration> [INDENT]<ismygreatestwidgetresizeable>mygreatestwidgetisnotresizeable</ismygreatestwidgetresizeable>[/INDENT] </configuration>

<?xml version="1.0" encoding="utf-8"?> <viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009" [INDENT]xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:viewer="com.esri.viewer.*" widgetConfigLoaded="init()"> [INDENT]<fx:Script> <![CDATA[ [INDENT]import mx.events.FlexEvent;     private function init():void { [INDENT]if (configXML) { [INDENT]if (String(configXML.ismygreatestwidgetresizeable) == "mygreatestwidgetisnotresizeable") { [INDENT]this.isResizeable = false;[/INDENT] }[/INDENT] }[/INDENT] }[/INDENT] ]]> </fx:Script>[/INDENT][/INDENT]


[/HR]

...
and other 357 ways to do it :cool:

[/HR]

P.S. There is such an ancient tradition, to ask questions about "Flex Viewer" on Flex Viewer Forum page
FarhadNavaei
New Contributor III
Thanks. Sorry if I brought the question in wrong forum
0 Kudos