[flexcoders] Overriding Focus Manager?
Hello All, I have a project I'm working on in Flex 3.5 that involves writing a bunch of validation stuff for focusIn and focusOut for components. Depending on the type of validation selected this could generate an Alert message. So the problem I am running into is say I have two TextInput boxes, both with their FocusOut property set to validate a phone number, and if the phone number is incorrect, it will pop an alert and place the focus back into that textbox.. A user types in a Phone Number and hits tab. The focusOut on Text1 does its validation and pops a message that the phone number needs to be at least 10 digits in length. The focus gets pulled from Text2 to place it back into Text1 thereby calling the focus out in Text2 which is blank so it also pops an alert and now we have an infinite loop of alert and focus movement. I've been trying to find a way to code around this and am fishing for ideas. One idea I had was to somehow override the focusManager for this form, but am not having much luck figuring out how to exactly do this. Anyone have any ideas? Thanks, Amanda
[flexcoders] Create Custom TabNavigator (TabNavigator + MenuBar)
Hello, I am wanting to create a custom TabNavigator to include the functionality of a MenuBar. So I am wanting the drop down of the MenuBar, but the seperation of space like the TabNavigator. How would I go about doing this. I have seen several examples of how to create custom components, but none about the TabNavigator. Would I create an mxml component with a mx:VBox as the root and mx:Text for each of the menu bar items? Would I then set the render attribute of the TabNavigator to be this new component? Thanks, Amanda
[flexcoders] Re: Namespace issue displaying xml in Tree
No, that really isn't the name. I put 'x' so no one could see the actual name. I added: public var ns2:Namespace = new Namespace (http://service.xx.xx.xx.xx.xx.xx/;); default xml namespace = ns2; but i haven't gotten that to work. --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: It is really @http://sevice.xxxxx::name You may have to declare a namespace and use it instead and maybe use a labelFunction From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mandy Sent: Thursday, August 14, 2008 12:43 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Namespace issue displaying xml in Tree I am trying to display xml data in a tree but can't get the xml to correctly populate the Tree because of the namespace in front of the attributes. Here is the xml I am getting back: ns2:getProductsResponse xmlns:ns2=http://service.xxx.xx.xx.xx.xx.xx/ http://service.xxx.xx.xx.xx.xx.xx/ return ns2:size=344 ns2:name=Products ns2:link=Products product ns2:name=WEATHER ns2:link=WEATHER product ns2:name=ANALYSES ns2:link=WEATHER.ANALYSES product ns2:name=CYCLONE ns2:link=WEATHER.ANALYSES.CYCLONE/ /product /product /return /ns2:getProductsResponse The tree is defined (I have tried both @name and @ns2:name): mx:Tree id=Tree width=100% height=100% labelField=@name change=treeChanged(event) themeColor=#99 folderClosedIcon=@Embed(source='images/marble.png') folderOpenIcon=@Embed(source='images/marble.png') defaultLeafIcon=@Embed(source='images/marble.png') dragEnabled=true dragMoveEnabled=false visible=true/ Here is my code to get the xml: public function getProductsResult(resultObj:Object):void { private var ns2:Namespace = new Namespace (http://service.xxx.xx.xx.xx.xx.xx/ http://service.xxx.xx.xx.xx.xx.xx/ ); default xml namespace = ns2; var xml:XMLListCollection = new XMLListCollection(new XMLList (resultObj.result)); var productsXML:XMLListCollection = new XMLListCollection (xml.children ()); } productsXML contains everything under the ns2:getProductsResponse element. Any ideas would be greatly appreciated. Thanks, Amanda
[flexcoders] Re: Namespace issue displaying xml in Tree
I got the xml to display by replacing ns2: with , but never did get use namespace to work. Oh well, I think replacing the ns2: is good for now. Thanks guys. ~Amanda --- In flexcoders@yahoogroups.com, Tim Hoff [EMAIL PROTECTED] wrote: Hi Amanda, I usually just strip out the namespace junk; when the result is returned. Something like: public function onResult(event: * = null) : void { var myXML : XML = event.result as XML; model.myXML = new XML(myXML.toXMLString().replace (xmlns:ns2=http://service.xxx.xx.xx.xx.\ xx.xx/,)) } You would probably want to get rid of all of the ns2: stuff as well; using a RegEx replace. Just one approach. -TH --- In flexcoders@yahoogroups.com, Mandy saltydg2003@ wrote: No, that really isn't the name. I put 'x' so no one could see the actual name. I added: public var ns2:Namespace = new Namespace (http://service.xx.xx.xx.xx.xx.xx/;); default xml namespace = ns2; but i haven't gotten that to work. --- In flexcoders@yahoogroups.com, Alex Harui aharui@ wrote: It is really @http://sevice.xxxxx::name You may have to declare a namespace and use it instead and maybe use a labelFunction From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mandy Sent: Thursday, August 14, 2008 12:43 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Namespace issue displaying xml in Tree I am trying to display xml data in a tree but can't get the xml to correctly populate the Tree because of the namespace in front of the attributes. Here is the xml I am getting back: ns2:getProductsResponse xmlns:ns2=http://service.xxx.xx.xx.xx.xx.xx/ http://service.xxx.xx.xx.xx.xx.xx/ return ns2:size=344 ns2:name=Products ns2:link=Products product ns2:name=WEATHER ns2:link=WEATHER product ns2:name=ANALYSES ns2:link=WEATHER.ANALYSES product ns2:name=CYCLONE ns2:link=WEATHER.ANALYSES.CYCLONE/ /product /product /return /ns2:getProductsResponse The tree is defined (I have tried both @name and @ns2:name): mx:Tree id=Tree width=100% height=100% labelField=@name change=treeChanged(event) themeColor=#99 folderClosedIcon=@Embed(source='images/marble.png') folderOpenIcon=@Embed(source='images/marble.png') defaultLeafIcon=@Embed(source='images/marble.png') dragEnabled=true dragMoveEnabled=false visible=true/ Here is my code to get the xml: public function getProductsResult(resultObj:Object):void { private var ns2:Namespace = new Namespace (http://service.xxx.xx.xx.xx.xx.xx/ http://service.xxx.xx.xx.xx.xx.xx/ ); default xml namespace = ns2; var xml:XMLListCollection = new XMLListCollection(new XMLList (resultObj.result)); var productsXML:XMLListCollection = new XMLListCollection (xml.children ()); } productsXML contains everything under the ns2:getProductsResponse element. Any ideas would be greatly appreciated. Thanks, Amanda
[flexcoders] Namespace issue displaying xml in Tree
I am trying to display xml data in a tree but can't get the xml to correctly populate the Tree because of the namespace in front of the attributes. Here is the xml I am getting back: ns2:getProductsResponse xmlns:ns2=http://service.xxx.xx.xx.xx.xx.xx/; return ns2:size=344 ns2:name=Products ns2:link=Products product ns2:name=WEATHER ns2:link=WEATHER product ns2:name=ANALYSES ns2:link=WEATHER.ANALYSES product ns2:name=CYCLONE ns2:link=WEATHER.ANALYSES.CYCLONE/ /product /product /return /ns2:getProductsResponse The tree is defined (I have tried both @name and @ns2:name): mx:Tree id=Tree width=100% height=100% labelField=@name change=treeChanged(event) themeColor=#99 folderClosedIcon=@Embed(source='images/marble.png') folderOpenIcon=@Embed(source='images/marble.png') defaultLeafIcon=@Embed(source='images/marble.png') dragEnabled=true dragMoveEnabled=false visible=true/ Here is my code to get the xml: public function getProductsResult(resultObj:Object):void { private var ns2:Namespace = new Namespace (http://service.xxx.xx.xx.xx.xx.xx/;); default xml namespace = ns2; var xml:XMLListCollection = new XMLListCollection(new XMLList (resultObj.result)); var productsXML:XMLListCollection = new XMLListCollection(xml.children ()); } productsXML contains everything under the ns2:getProductsResponse element. Any ideas would be greatly appreciated. Thanks, Amanda
[flexcoders] Re: Error 1069 Decoding Error
I fixed the problem. The method the webservice was suppose to return to had the wrong signature. I had this signature: public function getProductsResult(result:ResultEvent):void { } when I needed this signature: public function getProductsResult(resultObj:Object):void { } Thanks for the help! ~Amanda --- In flexcoders@yahoogroups.com, Peeyush Tuli [EMAIL PROTECTED] wrote: Could be a problem with a malformed soap response which is not confirming to the schema bound in the wsdl. Please use a HTTP proxy like Charles to verify the response from the server. Check if a fault element is in the xml response, which a soap webservice enabled server should send in most cases. If the server response seems ok in charles, then try to turn on the strict schema validation on the server side. It should tell if the problem is server side or not. ~Peeyush On Tue, Aug 12, 2008 at 6:21 PM, Mandy [EMAIL PROTECTED] wrote: Here is the full xml response: [RPC Fault faultString=Error #1069 faultCode=DecodingError faultDetail=null] (mx.messaging.messages::AcknowledgeMessage)#0 body = ?xml version=1.0 encoding=utf-8?soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; soapenv:Body ns2:getProductsResponse xmlns:ns2=http://service.xxx.xx.xxx.xxx.xxx.xxx/; return ns2:size=344 ns2:name=Products ns2:link=Products product ns2:name=WEATHER ns2:link=WEATHER product ns2:name=CYCLONE ns2:link=WEATHER.ANALYSES.CYCLONE/ product ns2:name=HYDROMARINE ns2:link=WEATHER.ANALYSES.HYDROMARINE/ product ns2:name=MISCELLANEOUS ns2:link=WEATHER.ANALYSES.MISCELLANEOUS/ /product /return /ns2:getProductsResponse /soapenv:Body/soapenv:Envelope ~Amanda --- In flexcoders@yahoogroups.com flexcoders% 40yahoogroups.com, Josh McDonald dznuts@ wrote: My xml response here doesn't really give us a lot to go on :) But, 1069 is field not found so you're probably decoding into a class that's missing a required field that's trying to be populated. -Josh On Tue, Aug 12, 2008 at 5:19 AM, Mandy saltydg2003@ wrote: I am getting a decoding error calling a JAX-WS webservice. Both the flex app calling the webservice and the webservice are on the same machine, so I don't think I need a crossdomain.xml file. The funny thing is the webservice is returning the xml response to me that I want, but it gets sent to the fault method. I am using the Flex 2 SDK. Here is the error: [RPC Fault faultString=Error #1069 faultCode=DecodingError faultDetail=null] (mx.messaging.messages::AcknowledgeMessage)#0 body = ?xml version=1.0 encoding=utf-8? soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; soapenv:Body My xml response here /soapenv:Body/soapenv:Envelope Here is my code: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.controls.Alert; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; public function get(event:ResultEvent):void { Alert.show(event.toString()); } public function web(event:FaultEvent):void { Alert.show(EVENT + event.toString () + \nFAULT + event.fault.toString() + \nMESSAGE + event.message.toString() + \nTYPE + event.type.toString() + \nEVENT_PHASE + event.eventPhase.toString()); } public function callWS():void { ProductsWS.getProducts(username, password); } ]] /mx:Script mx:WebService id=ProductsWS wsdl=http://host:port/Workspace/Project/WEB- INF/wsdl/Sample.wsdl useProxy=false fault=web(event) showBusyCursor=true requestTimeout=30 mx:operation name=getProducts result=get (event) fault=web(event)/ /mx:WebService mx:Button id=CallWS label=call WS click=callWS(); enabled=true x=292 y=234/ /mx:Application Thanks, Amanda -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: josh@
[flexcoders] Re: Error 1069 Decoding Error
Here is the full xml response: [RPC Fault faultString=Error #1069 faultCode=DecodingError faultDetail=null] (mx.messaging.messages::AcknowledgeMessage)#0 body = ?xml version=1.0 encoding=utf-8?soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; soapenv:Body ns2:getProductsResponse xmlns:ns2=http://service.xxx.xx.xxx.xxx.xxx.xxx/; return ns2:size=344 ns2:name=Products ns2:link=Products product ns2:name=WEATHER ns2:link=WEATHER product ns2:name=CYCLONE ns2:link=WEATHER.ANALYSES.CYCLONE/ product ns2:name=HYDROMARINE ns2:link=WEATHER.ANALYSES.HYDROMARINE/ product ns2:name=MISCELLANEOUS ns2:link=WEATHER.ANALYSES.MISCELLANEOUS/ /product /return /ns2:getProductsResponse /soapenv:Body/soapenv:Envelope ~Amanda --- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote: My xml response here doesn't really give us a lot to go on :) But, 1069 is field not found so you're probably decoding into a class that's missing a required field that's trying to be populated. -Josh On Tue, Aug 12, 2008 at 5:19 AM, Mandy [EMAIL PROTECTED] wrote: I am getting a decoding error calling a JAX-WS webservice. Both the flex app calling the webservice and the webservice are on the same machine, so I don't think I need a crossdomain.xml file. The funny thing is the webservice is returning the xml response to me that I want, but it gets sent to the fault method. I am using the Flex 2 SDK. Here is the error: [RPC Fault faultString=Error #1069 faultCode=DecodingError faultDetail=null] (mx.messaging.messages::AcknowledgeMessage)#0 body = ?xml version=1.0 encoding=utf-8?soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; soapenv:Body My xml response here /soapenv:Body/soapenv:Envelope Here is my code: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.controls.Alert; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; public function get(event:ResultEvent):void { Alert.show(event.toString()); } public function web(event:FaultEvent):void { Alert.show(EVENT + event.toString () + \nFAULT + event.fault.toString() + \nMESSAGE + event.message.toString() + \nTYPE + event.type.toString() + \nEVENT_PHASE + event.eventPhase.toString()); } public function callWS():void { ProductsWS.getProducts(username, password); } ]] /mx:Script mx:WebService id=ProductsWS wsdl=http://host:port/Workspace/Project/WEB-INF/wsdl/Sample.wsdl; useProxy=false fault=web(event) showBusyCursor=true requestTimeout=30 mx:operation name=getProducts result=get (event) fault=web(event)/ /mx:WebService mx:Button id=CallWS label=call WS click=callWS(); enabled=true x=292 y=234/ /mx:Application Thanks, Amanda -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
[flexcoders] Error 1069 Decoding Error
I am getting a decoding error calling a JAX-WS webservice. Both the flex app calling the webservice and the webservice are on the same machine, so I don't think I need a crossdomain.xml file. The funny thing is the webservice is returning the xml response to me that I want, but it gets sent to the fault method. I am using the Flex 2 SDK. Here is the error: [RPC Fault faultString=Error #1069 faultCode=DecodingError faultDetail=null] (mx.messaging.messages::AcknowledgeMessage)#0 body = ?xml version=1.0 encoding=utf-8?soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; soapenv:Body My xml response here /soapenv:Body/soapenv:Envelope Here is my code: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.controls.Alert; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; public function get(event:ResultEvent):void { Alert.show(event.toString()); } public function web(event:FaultEvent):void { Alert.show(EVENT + event.toString () + \nFAULT + event.fault.toString() + \nMESSAGE + event.message.toString() + \nTYPE + event.type.toString() + \nEVENT_PHASE + event.eventPhase.toString()); } public function callWS():void { ProductsWS.getProducts(username, password); } ]] /mx:Script mx:WebService id=ProductsWS wsdl=http://host:port/Workspace/Project/WEB-INF/wsdl/Sample.wsdl; useProxy=false fault=web(event) showBusyCursor=true requestTimeout=30 mx:operation name=getProducts result=get(event) fault=web(event)/ /mx:WebService mx:Button id=CallWS label=call WS click=callWS(); enabled=true x=292 y=234/ /mx:Application Thanks, Amanda