16 Replies Latest reply on Feb 19, 2010 11:34 PM by maximf171983

    How to Fix Error 1119?

    maximf171983

      So i have the following code and i have an error 1119, i have no clue how to fix it (i'm really new to flex, just trying to cut and paste what i found in order to make it work for my project) , if someone can offer me a fix i will be really greatful

      (the line that gives the error is highlited in red)

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
          backgroundGradientColors="[0x000000,0x323232]"
          xmlns:ilog="http://www.ilog.com/2007/ilog/flex" xmlns:local="*"
          creationComplete="init()" width="100%" height="100%"
          horizontalScrollPolicy="off" verticalScrollPolicy="off"
          backgroundColor="0x323232"
          viewSourceURL="srcview/index.html">
        <mx:Script>
          <![CDATA[
            import ilog.utils.TimeUnit;
            import mx.collections.HierarchicalData;
            import mx.rpc.*;
                
            private function onWheel(e:MouseEvent):void
            {
              e.stopImmediatePropagation();
             (e.delta < 0) ? zoomOut() : zoomIn();
            }
           
            private function zoomOut():void
            {
              var allowed:Boolean = (ganttSheet.visibleTimeRangeStart.time != ganttSheet.minVisibleTime.time ||
                        ganttSheet.visibleTimeRangeEnd.time != ganttSheet.maxVisibleTime.time);
              if (allowed)         
                ganttSheet.zoom(2, null, true);
            }
           
            private function zoomIn():void
            {
              ganttSheet.zoom(0.5, null, true);
            }
           
          ]]>
        </mx:Script>
        <mx:HTTPService id="model"
                          url = "c:/taskdata.xml"/>
                         
       
        <ilog:TaskChart id="tc" width="100%" height="100%"
                        taskDataProvider="{new HierarchicalData(model.activities.*)}"
                        taskStartTimeField="@start"
                        taskEndTimeField="@end">
          <ilog:dataGrid>
            <ilog:GanttDataGrid color="0xCECECE" alternatingItemColors="[0x404040, 0x464646]"
              indentation="2" width="150" >
              <ilog:columns>
                <mx:AdvancedDataGridColumn dataField="@name" headerText="Task" />
                <!--headerText="@Resource(key='Activity', bundle='taskchart')"-->
              </ilog:columns>
            </ilog:GanttDataGrid>
          </ilog:dataGrid>  
          <ilog:ganttSheet>
            <ilog:GanttSheet alternatingItemColors="[0x404040, 0x464646]" id="ganttSheet"
                             nonWorkingAlpha="0.1" nonWorkingColor="0xFFFFFF"
                             mouseWheel="onWheel(event)"
                             minZoomFactor="1728000"
                            
                             />  
          </ilog:ganttSheet>
          <ilog:timeScale>
            <ilog:TimeScale mouseWheel="onWheel(event)"/>
          </ilog:timeScale>              
        </ilog:TaskChart>
      </mx:Application>

        • 1. Re: How to Fix Error 1119?
          archemedia Level 4

          <mx:HTTPService id="model"
                              url = "c:/taskdata.xml"/>
                             
           
            <ilog:TaskChart id="tc" width="100%" height="100%"
                            taskDataProvider="{new HierarchicalData(model.activities.*)}"

           

          1.

          You're trying to bind the taskDataProvider to a HTTPService!

          'model' is your service, so it will never have a property called 'activities'.

          You should bind to the result of your HTTPService.

          2. It looks like you're using a static xml file, right? Then why use HTTPService if you aren't getting data from a server?

          You could embed your xml instead!

           

          Does this help?

          Dany

          • 2. Re: How to Fix Error 1119?
            maximf171983 Level 1

            I am using httpservice because i use that application in a java program, where i generate diffrent xml's and show the task chart for it. Because i'm embedding the compiled swf using <iframe> the results always stay the same.....

            • 3. Re: How to Fix Error 1119?
              archemedia Level 4

              An HTTPService doesn't do anything unless you call it's send() function. You should also add functions to the result and fault properties of the service in order to do something with them. You can then bind other components to the lastResult property of your service.

               

              Dany

              • 4. Re: How to Fix Error 1119?
                maximf171983 Level 1

                can you help me out with the code? i never used flex before,and just trying to get something done for the senior project

                • 5. Re: How to Fix Error 1119?
                  archemedia Level 4

                  Can you provide a url from which I can retrieve a xml file?

                   

                  Dany

                  • 6. Re: How to Fix Error 1119?
                    maximf171983 Level 1

                    the xml file is on my localhost, i generate it dynamically.... i can email it to you....

                    • 7. Re: How to Fix Error 1119?
                      archemedia Level 4

                      please do

                       

                      d

                      • 8. Re: How to Fix Error 1119?
                        maximf171983 Level 1

                        what's your email address?


                        • 9. Re: How to Fix Error 1119?
                          archemedia Level 4

                          Click on my photo and then choose 'send private mail'

                           

                          d

                          • 10. Re: How to Fix Error 1119?
                            archemedia Level 4

                            Maybe this helps you further:

                             

                                 Remove the HTTPService tag

                             

                            Add this

                              <mx:XML id="tdxml" source="xml/taskdata.xml"/>

                            Change this
                              <ilog:TaskChart id="tc" width="100%" height="100%"
                                              taskDataProvider="{tdxml.activities.activity}"
                                              taskStartTimeField="@start"
                                              taskEndTimeField="@end">

                             

                            d

                            • 11. Re: How to Fix Error 1119?
                              maximf171983 Level 1

                              thank you! i will test it when i will get to my computer later. but if i will embed that compiled .swf file into a jsp code, will it always use the new data generated?

                              • 12. Re: How to Fix Error 1119?
                                archemedia Level 4

                                nope, in that case, you will indeed need an httpService. That's why I need a LINK to an xml file instead of the xml file itself. You should put it on a server and provide me the link to it.

                                 

                                d

                                • 13. Re: How to Fix Error 1119?
                                  maximf171983 Level 1

                                  ok, i will put it on my server later in the evening and send you a message once i do, thank you

                                  • 14. Re: How to Fix Error 1119?
                                    maximf171983 Level 1

                                    were you able to access the xml? i had some problems with the webserver lately (i sent you the address in a private message)

                                    • 15. Re: How to Fix Error 1119?
                                      archemedia Level 4

                                      This works:

                                       

                                      <?xml version="1.0" encoding="utf-8"?>
                                      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
                                          backgroundGradientColors="[0x000000,0x323232]"
                                          xmlns:ilog="http://www.ilog.com/2007/ilog/flex" xmlns:local="*"
                                          creationComplete="init()" width="100%" height="100%"
                                          horizontalScrollPolicy="off" verticalScrollPolicy="off"
                                          backgroundColor="0x323232"
                                         
                                          viewSourceURL="srcview/index.html">
                                         
                                          <mx:HTTPService id="taskService" url="http://maximf83.dyndns.org:8080/AssetManagement/taskdata.xml"
                                              result="handleResult(event)" fault="handleFault(event)"/>

                                             
                                        <mx:Script>
                                          <![CDATA[
                                              import mx.collections.ArrayCollection;
                                              import mx.rpc.events.FaultEvent;
                                              import mx.rpc.events.ResultEvent;
                                              import mx.collections.XMLListCollection;
                                            import ilog.utils.TimeUnit;
                                            import mx.collections.HierarchicalData;
                                            import mx.rpc.*;
                                           
                                           [Bindable]  
                                            private var taskCollection:HierarchicalData;

                                            
                                             private function init():void
                                             {
                                                    taskService.send();
                                             }
                                            
                                            private function onWheel(e:MouseEvent):void
                                            {
                                              e.stopImmediatePropagation();
                                             (e.delta < 0) ? zoomOut() : zoomIn();
                                            }
                                          
                                            private function zoomOut():void
                                            {
                                              var allowed:Boolean = (ganttSheet.visibleTimeRangeStart.time != ganttSheet.minVisibleTime.time ||
                                                        ganttSheet.visibleTimeRangeEnd.time != ganttSheet.maxVisibleTime.time);
                                              if (allowed)        
                                                ganttSheet.zoom(2, null, true);
                                            }
                                          
                                            private function zoomIn():void
                                            {
                                              ganttSheet.zoom(0.5, null, true);
                                            }
                                          
                                           private function handleResult(evt:ResultEvent):void
                                           {
                                              taskCollection = new HierarchicalData(evt.result.schedule.activities.activity);
                                               taskCollection.childrenField = "activity";

                                           }
                                          
                                           private function handleFault(evt:FaultEvent):void
                                           {
                                              
                                           }
                                          ]]>
                                        </mx:Script>

                                       

                                            
                                        <ilog:TaskChart id="tc" width="100%" height="100%"
                                                        taskDataProvider="{taskCollection}"
                                                        taskStartTimeField="start"
                                                        taskEndTimeField="end">
                                          <ilog:dataGrid>
                                            <ilog:GanttDataGrid
                                              indentation="2" width="150" >
                                              <ilog:columns>
                                                <mx:AdvancedDataGridColumn dataField="name" headerText="Task"  />
                                              </ilog:columns>
                                            </ilog:GanttDataGrid>
                                          </ilog:dataGrid> 
                                          <ilog:ganttSheet>
                                            <ilog:GanttSheet id="ganttSheet"
                                                             nonWorkingAlpha="0.1" nonWorkingColor="0xFFFFFF"
                                                             mouseWheel="onWheel(event)"
                                                             minZoomFactor="1728000"
                                                           
                                                             /> 
                                          </ilog:ganttSheet>
                                          <ilog:timeScale>
                                            <ilog:TimeScale mouseWheel="onWheel(event)"/>
                                          </ilog:timeScale>             
                                        </ilog:TaskChart>
                                      </mx:Application>

                                      • 16. Re: How to Fix Error 1119?
                                        maximf171983 Level 1

                                        awesome!! thanx a lot! it works

                                         

                                         

                                         

                                        now i wanted to ask you, does the XML file need to be changed or the same result should be shown no matter if it's static call to a file or http-service?

                                         

                                        because what happens is that all the fields are shown on the gantt charts as leaf fields (green bar) even though there are some fields that suppose to be summary tasks (blue bar, folder icon on the side). And the first summary task that have only one child is shown in the result as if it had no child tasks at all....

                                         

                                        any idea why that might happen?