Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5933257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:56:53+00:00 2026-05-22T14:56:53+00:00

I have flex project where i want to call webservice and pass values from

  • 0

I have flex project where i want to call webservice and pass values from it to the xml file to update fusion chart xml
My code is

<fx:Script>
    <![CDATA[
        import mx.controls.Alert;
        import mx.events.FlexEvent;
        import mx.rpc.events.FaultEvent;
        import mx.rpc.events.ResultEvent;
        public var PUENumber:String;
        protected var xmlLoader:URLLoader;
        [Bindable]
        public var avgPUEXml:XML = new XML;

        protected function init():void
        {
            xmlLoader = new URLLoader();
            xmlLoader.addEventListener(Event.COMPLETE,setDataXML)
            xmlLoader.load(new URLRequest("data/AvgPUE.xml")); //Loading xml file for the chart from the folder
        };

        protected function setDataXML(event:Event):void
        {
            avgPUEXml = XML(event.target.data);
            avgPUEXml.value = PUENumber; //updating chart xml value
            fw.FCDataXML = avgPUEXml.toString();
            fw.FCRender(); 
        };

         protected function getDC_POWERdataResult_resultHandler(event:ResultEvent):void
        {
            PUENumber = getDC_POWERdataResult.lastResult; //getting value to update in xml file
            init();
        } 
         protected function bordercontainer1_creationCompleteHandler(event:FlexEvent):void
        {
            getDC_POWERdataResult.token = mGEMWS.getDCPUE("4","715"); //user details to get data from the method
        } 

    ]]>
</fx:Script>

<fx:Declarations>
    <s:CallResponder id="getDC_POWERdataResult" result="getDC_POWERdataResult_resultHandler(event)"/>
    <mgemws:MGEMWS id="mGEMWS" showBusyCursor="true"
                   fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"/>
</fx:Declarations>

    <ns1:FusionWidgets id="fw" FCChartType="Bulb" FCDataXML="avgPUEXml" />

in the declaration am calling web service. and on creationCompelete am sending userid details to get data from webservice. now where exactly i need to call init function so that it updates xml file with values coming from web service and display the fusion widget

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:56:54+00:00Added an answer on May 22, 2026 at 2:56 pm

    You don’t need the ‘setDataXML’ handler method. Also you don’t need any ‘URLLoader’ or ‘URLRequest’ in the ‘init’ method. FusionCharts supports XML data as well as XML path. So remove the ‘setDataXML’ and remove all the codes from the ‘init’ method and add just fw.addEventListener(FCEvent.FCRenderEvent, wgdtRendHandler);
    and add below handler method –

    protected function wgdtRendHandler(e:FCEvent):void{
         e.target.FCSetDataURL='data/AvgPUE.xml';
         e.target.removeEventHandler(FCEvent.FCRenderEvent, wgdRendHandler);
    }
    

    I think this should work for you. In case you still don’t get the updated data in the chart, check the XML file in the ‘init’ method whether it’s updated properly at that point of time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a Flex Library project - a .swc file - which is
I have a list of webservices from a Flex project. I am trying to
In a Flex project, I have an array with objects in it. I want
I have a RichEditiableText component in a Flex 4.5 project and I want to
I have a list in flex mobile project which contains multiple rows. I want
Using Flex Builder : I have created a new Actionscript Project. I want to
i'm converting code project from Flash AS 3 to Flex 4. I've got a
I have the following code in my flex project. <mx:Canvas id=scroller styleName=myCanvas width=635 horizontalScrollPolicy=off
I have some interesting problem for an hour.. In my flex project, all width
We have a Flex client and a server that is using the Spring/Blazeds project.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.