8 Replies Latest reply on May 16, 2007 9:47 PM by cheftimo

    Flex 2 TFS FlexGrocer project

    cheftimo Level 2
      I have been studying the FlexBuilder 2 TFS book. By the end of lesson 8 you have built a horizontal list custom component (CategoryView.mxml) and a VBox custom component (FoodList.mxml). The former supposedly displays a row of categories, each consisting of an image and a descriptive label; the latter is supposed to display a vertical list of products from the selected category, also an image and label.

      Fine and dandy – everything runs, but the images do not dsplay.

      After I triple checked all the code and the project’s structure, I made a separate project for the completed project, the way it came in the CD. Guess what: those images don’t show up there either. They do appear when you view the cart, if it contains any items, as expected.

      I doesn’t give you a lot of confidence when the finished project that comes with the book doesn’t even work – especially when you write to the book’s author twice (by putting comments on his blog, which is obviously being checked often by its owner), ask him what the problem might be and if there is a URL where one can see the finished project functioning, and never get a reply. I have written to him twice: once about a month ago and again last week.

      Has anyone out there tried to run the finished project? And have you been successful?
        • 1. Re: Flex 2 TFS FlexGrocer project
          craigkaminsky Level 3
          Hi,

          I, too, have been working through Flex 2 TFS. I'm bouncing back and forth between learning the hard way and studying the book/lessons. So far, no issues with the app working.

          Here's the structure of my bin folder after compiling and running the application:
          assets (folder)
          --> assets contains a buttload of images/photos
          utils (folder)
          --> empty
          views (folder)
          --> also empty
          the rest of the root folder contains the various HTML and SWF files generated from the compiler (Dashboard.html, Dashboard.swf, etc.)

          I've uploaded the project, with my exercises to day to the following location, if you want to check it out and verify that it is working:
          http://208.112.47.188/flexgrocer/ecomm.html (I'll leave this up for a couple days)

          One change I had to make from the book to the "real world" is the reference to the images in TextAndPic.mxml and GroceryDetail.mxml. The book indicates that you need to reference them as '../assets/picName'. However, when you compile the application, the SWF files and assets folder are in the same directory. So, change the image references to 'assets/picName' and you should be good to go.

          Cheers,
          Craig
          • 2. Re: Flex 2 TFS FlexGrocer project
            cheftimo Level 2
            Hello, Craig:

            Thank you very much for your help. I was hoping Jeff Tapper (TFS author) would respond to one of my comments on his blog. He must know by now that there is an error. I posted this on his blog today:

            I looked some more into the images not displaying in components TextAndPic and GroceryDetail. Craigkaminsky at the Adobe forums came up with the answer. I quote from his post:

            “One change I had to make from the book to the "real world" is the reference to the images in TextAndPic.mxml and GroceryDetail.mxml. The book indicates that you need to reference them as '../assets/picName'. However, when you compile the application, the SWF files and assets folder are in the same directory. So, change the image references to 'assets/picName' and you should be good to go.”

            So now, the finished FlexGrocer project is working OK. I think this should be added to the book’s errata. Don’t you?


            That should do it for TFS. I don’t anticipate more problems now that I know the finished project does work.

            Now, I don’t know if you - or anyone else who reads this – might be interested in looking at a problem with custom components. I have gone through the relevant chapter several times with no luck. I also started this thread - http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&catid=585&threadid =1246251&messageid=4533252 - a while ago and several people have responded but nobody has come up with a solution. Any takers?

            Thank you again, Craig. Best regards,

            Carlos
            • 3. Re: Flex 2 TFS FlexGrocer project
              Santanu Karar Level 1
              This book still is sounds very good to me. I just love the flex 2 architecture now! AS3 Rocks!!

              And also, a lot of Thanks - to the authors of this book.
              • 4. Re: Flex 2 TFS FlexGrocer project
                cheftimo Level 2
                Hello again:

                I have run into a problem working through the lessons in Flex 2 TFS. I am not doing the lessons in order because there are some subjects of particular interest to me. I did Lessons 1 through 11, then skipped ahead to Lesson 17. For this, I created a new project – FlexGrocer17 – with the files in ‘flex2tfs\Lesson17\start’.

                Up to the end of Chapter 11, everything was working OK. Starting Chapter 17, the project compiles and Dashboard.mxml works fine; but both DataEntry.mxml and Ecomm.mxml generate the following runtime error:

                [RPC Fault faultString="Error #1085: The element type "br" must be terminated by the matching end-tag "</br>"." faultCode="Client.CouldNotDecode" faultDetail="null"] … etc.

                I only found one <br> tag in the whole project and it’s in a comment block in ‘cfcs/dummyAggData.cfm’. Removing that entire comment does NOT correct the problem.

                I tried creating another project starting at Lesson 18, and the error is still present – so I know it is not some faulty code I added.

                What I find curious is that the finished project (created from ‘Lesson25\complete’) totally works. So, the error is being introduced somewhere between Lessons 12 and 16 – and is being corrected somewhere between Lesson 18 and the end. The project – all three MXMLs - is even working on my web server at http://www.timos.com/FlexGrocerFinished/DataEntry.html.

                I would appreciate hearing from anyone that has tried running the project, whether it has run OK or not in the above-mentioned lessons, or who has any ideas about where to look to find the error.

                Carlos
                • 5. Re: Flex 2 TFS FlexGrocer project
                  cebdev
                  I am also working through this book. After discovering the "errata" site for the end of trace.........

                  Asynchronously invoking SOAP Operation: getSalesData
                  Encoding SOAP request envelope
                  Encoding SOAP request body
                  Encoded SOAP Operation request: <?xml version="1.0" encoding="utf-8"?>
                  <SOAP-ENV:Envelope xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=" http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><ns0:getSalesData SOAP-ENV:encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0=" http://cfcs.flexGrocer"><startDate xsi:type="xsd:dateTime">2002-04-01T04:00:00.000Z</startDate><endDate xsi:type="xsd:dateTime">20074-02-01T05:00:00.000Z</endDate><category xsi:type="xsd:string">All</category></ns0:getSalesData></SOAP-ENV:Body></SOAP-ENV:Envelop e>
                  'BACF3E9C-CA7F-B370-11A0-96D69DA36474' producer sending message 'E961CE45-79C2-4DC4-A124-96D69FB53E90'
                  'direct_http_channel' channel sending message:
                  (mx.messaging.messages::SOAPMessage)#0
                  body = "<?xml version="1.0" encoding="utf-8"?>
                  <SOAP-ENV:Envelope xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=" http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><ns0:getSalesData SOAP-ENV:encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0=" http://cfcs.flexGrocer"><startDate xsi:type="xsd:dateTime">2002-04-01T04:00:00.000Z</startDate><endDate xsi:type="xsd:dateTime">20074-02-01T05:00:00.000Z</endDate><category xsi:type="xsd:string">All</category></ns0:getSalesData></SOAP-ENV:Body></SOAP-ENV:Envelop e>"
                  clientId = "DirectHTTPChannel0"
                  contentType = "text/xml; charset=utf-8"
                  destination = "DefaultHTTP"
                  headers = (Object)#1
                  httpHeaders = (Object)#2
                  SOAPAction = """"
                  messageId = "E961CE45-79C2-4DC4-A124-96D69FB53E90"
                  method = "POST"
                  recordHeaders = false
                  timestamp = 0
                  timeToLive = 0
                  url = " http://localhost:8501/flexGrocer/cfcs/aggregate.cfc"
                  'BACF3E9C-CA7F-B370-11A0-96D69DA36474' producer acknowledge of 'E961CE45-79C2-4DC4-A124-96D69FB53E90'.
                  'BACF3E9C-CA7F-B370-11A0-96D69DA36474' producer fault for 'E961CE45-79C2-4DC4-A124-96D69FB53E90'.
                  Server.Error.Request:HTTP request error
                  'BACF3E9C-CA7F-B370-11A0-96D69DA36474' producer acknowledge of '739CD265-4AAA-87C3-2624-96D69FABB590'.
                  'BACF3E9C-CA7F-B370-11A0-96D69DA36474' producer fault for '739CD265-4AAA-87C3-2624-96D69FABB590'.
                  Server.Error.Request:HTTP request error

                  how do I figure out whats wrong?
                  • 6. Re: Flex 2 TFS FlexGrocer project
                    cheftimo Level 2
                    cebdev:

                    I'll be glad to try to help you, but I can't figure out what you are asking. Where did you run into this error?
                    • 7. Re: Flex 2 TFS FlexGrocer project
                      bererton
                      I'm running through the book as well, and ran into the same picture problem (pictures are shown when I run the app locally, but don't show when I put the contents of the bin directory on my web server). I seem to have fixed most of the picture problems using the method discussed here (simply remove the ../ from the assets path).

                      Unfortunately, it doesn't seem to have worked for the category navigation images at the top of the Ecomm application. That is the images with the word "nav_name.jpg". it's really odd. Here's the image source code line in TextAndPic.mxml:
                      <mx:Image source="{'assets/nav_' + data.catName + '.jpg'}"
                      height="31" width="93"/>

                      Again it works on my local machine, but when I copy everything to my web server everything works *except* the navigation bar images.

                      Any ideas?

                      ~C
                      • 8. Re: Flex 2 TFS FlexGrocer project
                        cheftimo Level 2
                        bererton:

                        I had the same problem you describe with those image paths, but was able to fix it. It’s odd that your project works in one server and not in the other, unless you moved folders around before uploading.

                        I am away from my computer for a day or two, so I cannot look at this now. But, in case you didn’t notice, I have the finished project on a web server – View Source is enabled, so you should be able to check everything there. Look for the URL link on the third post above your post in this thread.

                        Hope this helps,

                        Carlos