Select to view content in your preferred language

Widgets - Undefined state 'open'. ERROR

2361
13
09-01-2010 04:24 AM
Kevin_RogersBwire
New Contributor
Flex Team,

I am getting a problem whenever I insert a widget e.g the searchwidget into my custom adobe flex web map applications. After runnning itm I get the following error

ArgumentError: Undefined state 'open'.
at mx.core::UIComponent/getState()
at mx.core::UIComponent/findCommonBaseState()
at mx.core::UIComponent/commitCurrentState()
at mx.core::UIComponent/commitProperties()
at spark.components.supportClasses::GroupBase/commitProperties()
at spark.components::Group/commitProperties()
at mx.core::UIComponent/validateProperties()
at mx.managers::LayoutManager/validateProperties()
at mx.managers::LayoutManager/doPhasedInstantiation()
at mx.managers::LayoutManager/doPhasedInstantiationCallback()

What is the cause?
Tags (2)
0 Kudos
13 Replies
yangyi
by
New Contributor
�?常�??谢�?�??�??�?样�?�?�?�?�?��??�?个�??误�??:confused:
0 Kudos
JadeFreeman
Occasional Contributor III
I've been trying to compile the 2.3.1 version against the 4.5 sdk.  Is it possible that's why I'm getting the Undefined state "open" error at runtime?  The application compiles just fine but when I run the application and open a widget I get the error.

I apologize if I missed the answer in one of the previous posts (I couldn't find a way to translate the non english posts).
0 Kudos
IanKramer
New Contributor III
Hi Jebu23,
Not sure if you found a solution to this...I have been porting over the widget functionality to PureMVC and ran into the same problem.  One of the first things to check is to make sure that the WidgetTemplateSkin is referenced correctly in WidgetTemplate.as.  You need to add an important statement like this "import com.esri.viewer.skins.WidgetTemplateSkin".

The other thing I had to do was add to find the constructor function for WidgetTemplate (do a search for "public function WidgetTemplate()") and add the following code below the event listener.

setStyle("skinClass", Class(WidgetTemplateSkin));

I'm not sure if that will solve your problem, but it worked for me in Flex 4.5.  Good Luck!

Btw, you can translate the Chinese in Google Translator...works pretty well.

Ian
0 Kudos
xppJulian
New Contributor
Hi Jebu23,
Not sure if you found a solution to this...I have been porting over the widget functionality to PureMVC and ran into the same problem.  One of the first things to check is to make sure that the WidgetTemplateSkin is referenced correctly in WidgetTemplate.as.  You need to add an important statement like this "import com.esri.viewer.skins.WidgetTemplateSkin".

The other thing I had to do was add to find the constructor function for WidgetTemplate (do a search for "public function WidgetTemplate()") and add the following code below the event listener.

setStyle("skinClass", Class(WidgetTemplateSkin));

I'm not sure if that will solve your problem, but it worked for me in Flex 4.5.  Good Luck!

Btw, you can translate the Chinese in Google Translator...works pretty well.

Ian






I use your solution �?but problems appeared, I do not know how to do, there is a mistake in the" protected override function partAdded(partName:String, instance:Object):void",that says:
TypeError: Error #1009: �?��?访�?�空对象�?�?��??�?�?��??�?��?�??
at managers::WidgetTemplate/partAdded()
at spark.components.supportClasses::SkinnableComponent/findSkinParts()
at spark.components.supportClasses::SkinnableComponent/attachSkin()
at spark.components.supportClasses::SkinnableComponent/validateSkinChange()
at spark.components.supportClasses::SkinnableComponent/createChildren()
at spark.components::SkinnableContainer/createChildren()
at mx.core::UIComponent/initialize()
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()
at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::childAdded()
at mx.core::Container/addChildAt()
at mx.core::Container/addChild()


Do you have a solution about it?
0 Kudos