2 Replies Latest reply on Mar 17, 2008 12:19 PM by relcustuser

    LineChart not working when using Flex with Seam & JBoss

    relcustuser
      This is my first use of Flex with JBOSS Seam and I tried incorporation of Flex LineCharts with Seam on helloworld.mxml. I get this compile error while trying to compile/deploy task for JBOSS. I could get other parts like Label, Button, TextInput working. Only Charts Line or Bar seem to have issue with compiling.

      C:\projects\GraniteDSHelloWorldSeam\view\helloworld.mxml(55): Error: Type was not found or was not a compile-time constant: LineChart.
      [mxmlc] <mx:LineChart id="myChart"


      Please provide any suggestion if you came across similar issue.

      I appreciate your help.


      Code below for the helloworld.mxml

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns:seam="org.granite.seam.*">

      <seam:SeamRemoteObject id="HelloWorldRO" destination="destSeamHelloWorld" fault="onRemoteFault(event);">
      <seam:addOperations>
      <seam:SeamOperation name="sayHello" result="sayHelloResult(event);"/>
      </seam:addOperations>
      </seam:SeamRemoteObject>

      <mx:Script>
      <![CDATA[
      import mx.collections.ICollectionView;
      import mx.collections.ArrayCollection;
      import mx.rpc.events.ResultEvent;
      import mx.utils.ObjectUtil;
      import mx.rpc.events.FaultEvent;
      import mx.controls.Alert;

      private var startTime:Number;
      private var endTime:Number;

      private function sayHelloResult(event:ResultEvent): void {

      endTime = getTimer();
      outputText.text = event.result.toString();

      Alert.show("Time taken for response : " + Number(endTime - startTime) + " ms \nServer Response : " + event.result.toString() );
      }

      private function onRemoteFault(event:FaultEvent):void {
      trace(ObjectUtil.toString(event.fault));
      Alert.show('Fault: ' + event.fault.faultCode + ' - ' + event.fault.faultString + '. toString() is [' + ObjectUtil.toString(event.fault) + ']');
      }

      private function sendServerRequest(): void {
      startTime = getTimer();
      HelloWorldRO.sayHello();
      }

      [Bindable]
      public var expenses:ArrayCollection = new ArrayCollection([
      {Month:"Jan", Profit:2000, Expenses:1500, Amount:450},
      {Month:"Feb", Profit:1000, Expenses:200, Amount:600},
      {Month:"Mar", Profit:1500, Expenses:500, Amount:300}
      ]);

      ]]>
      </mx:Script>

      <mx:Label text="Send Server Request " x="244" y="192" fontSize="16" fontWeight="bold" width="209" height="24" color="#A9CCD3"/>
      <mx:Button x="494" y="195" label="Click" click="sendServerRequest();"/>
      <mx:TextInput name="outputText" id="outputText" width="350" x="244" y="243" editable="false" text=""/>

      <mx:Panel title="Line Chart">
      <mx:LineChart id="myChart"
      dataProvider="{expenses}"
      showDataTips="true"
      >
      <mx:horizontalAxis>
      <mx:CategoryAxis
      dataProvider="{expenses}"
      categoryField="Month"
      />
      </mx:horizontalAxis>
      <mx:series>
      <mx:LineSeries
      yField="Profit"
      displayName="Profit"
      />
      <mx:LineSeries
      yField="Expenses"
      displayName="Expenses"
      />
      </mx:series>
      </mx:LineChart>
      <mx:Legend dataProvider="{myChart}"/>
      </mx:Panel>


      </mx:Application>
      Text