juanpgenovese (1) [Avatar] Offline
#1
Good morning to you all.
I'm trying to complete the project following the book step by step.
However, I stumbled into an issue that I can't solve.
Simply, the TasksListBox doesn't call the listTasks() method.
It seems like the creationComplete event is never called.

I tried to use the book source code, but also couldn't make it work.

Did anyone suffered from the same problem and found a fix?

Thank you very much for your time!
rainyglade (9) [Avatar] Offline
#2
Re: Tasks won't load on Flex - Iteration 6
I have seen this problem as well. I've double-checked all my code, but I can't find the problem. My tasks are making it to the database, but the task list isn't updated unless I log off and log back in.

Any ideas are appreciated.

Louise
peterarmstrong (94) [Avatar] Offline
#3
Re: Tasks won't load on Flex - Iteration 6
Do you do creationComplete="listTasks()" as shown on p. 189?

Can you try running the code from the completed iteration 6 in the zip file at
http://www.manning-source.com/books/armstrong/FlexibleRailsManningBookCode.zip

Thanks,
Peter
rainyglade (9) [Avatar] Offline
#4
Re: Tasks won't load on Flex - Iteration 6
Yes, I have added that code on p. 189.

I also get the same results when I run the book code. The database gets updated, but the task list doesn't refresh unless I log out and log in again.

I'm using Rails 2.1.0.

Thanks,
Louise
javinto (5) [Avatar] Offline
#5
Re: Tasks won't load on Flex - Iteration 6
Hi,

I'm having these sorts of problems as well. Fact is that I do net get them constantly. Sometimes I can add up to 3 new projects and with the fourth the project list doesn't get updated. Same with deleting. Rails just adds and deletes but the Flex application just doesn't alwasy refresh (there is no HTTP communication either according to Firebug). Sometimes I have to restart, but sometimes I just have to wait.

Trying the same on IE7 however does not work at all! On adding an project or location I get a Flash error: Error #2032: Stream Error. URL: http://localhost:3002/locations.xml"]. URL: /locations.xml"

Any idea?
javinto (5) [Avatar] Offline
#6
Re: Tasks won't load on Flex - Iteration 6
Guess what!

Safari on Windows fully works with the application!! No streaming errors (like IE), no update problems (like FF). I can update as many projects, locations, tasks as I want and the application keeps refreshing correctly!

So, flashplayer 9 is NOT browser compatible?!
rainyglade (9) [Avatar] Offline
#7
Re: Tasks won't load on Flex - Iteration 6
You are right. I tried the book code (without any changes or modifications since the last time when it didn't work) in Safari, and after adding a task, it shows up in the tasks list.

Thanks for the help!

Louise
{-.-}Hafa! (2) [Avatar] Offline
#8
Re: Tasks won't load on Flex - Iteration 6
yeah, the same happened to me.. it simply didn't call the listTasks() after the creation of a new one. seemed not to trigger the taskCreate event in the MainBox component.

Trying through safari it worked fine. =), but are we stuck on using only Safari to develop it? =( no good have only one browser as target.

thanks in advance !!
peterarmstrong (94) [Avatar] Offline
#9
Re: Tasks won't load on Flex - Iteration 6
Could you please post the following details:

- Flash player version (not just 9, I mean the minor version too)
- IE version (major and minor)

Also, can you please test this with Rails 2.0.x instead of 2.1 to see if there's any difference? (The book was last tested against Rails 2.0.x.)

I will try to look into this on the weekend -- this week is an absolute nightmare for me.

Thanks,
Peter
javinto (5) [Avatar] Offline
#10
Re: Tasks won't load on Flex - Iteration 6
Hi Peter

I tried the Pomodo iteration no 6 'out of the box'. Just replaced the database.yml file bu can't get it to work due to a session problem in Rails probably. Here's my rails log partially:

Processing SessionsController#create (for 127.0.0.1 at 2008-08-06 00:49:47) [POST]
Session ID: afbab4a47aad4c549411c45fab179d18
Parameters: {"format"=>"xml", "action"=>"create", "controller"=>"sessions", "login"=>"ludwig", "password"=>"foooo"}
SQL (0.000000) SET NAMES 'utf8'
SQL (0.000000) SET SQL_AUTO_IS_NULL=0
User Columns (0.041000) SHOW FIELDS FROM `users`
User Load (0.000000) SELECT * FROM `users` WHERE (`users`.`login` = 'ludwig') LIMIT 1
Completed in 0.14800 (6 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.04100 (27%) | 200 OK [http://localhost/session.xml]
/! FAILSAFE /! Wed Aug 06 00:49:47 +0200 2008
Status: 500 Internal Server Error
wrong number of arguments (2 for 1)
E:/inet/ruby/lib/ruby/1.8/cgi/session.rb:267:in `respond_to?'
E:/inet/ruby/lib/ruby/1.8/cgi/session.rb:267:in `initialize_without_cgi_reader'
E:/Development/Rails/FlexibleRailsManningBookCode/code/iteration06/pomodo/vendor/rails/actionpack/lib/action_controller/cgi_ext/session.rb:39:in `initialize'

I did some further testing though with my own Pomodo Rails 2.1 version. Here are the results:

A) Windows Vista, Rails 2.1 with Mongrel 1.1.5, Flash player 9.r115 and 9.r124, Firefox 3.0.1 => No errors but constantly refresh problems after having added a project or deleted one. Finally things get updated/refreshed but my Tamper data addon (or use Firebug) showed a duration of 17 seconds (17503ms to be precise)!!!
B) Windows Vista, Rails 2.1 with Mongrel 1.1.5, Flash player 9.r115, IE 7.0.6000.16681 => Only after having added a new Project I get a Streaming error in Flash on the GET projects.xml. I do not get one after having deleted a project!!!
C) Windows Vista, Rails 2.1 with Mongrel 1.1.5, Flash player 9.r115 and 9.r124, Safari 3.1.2 =>
Everything works smooth; like intended.
D) Windows Vista, Rails 2.1 with Mongrel 1.1.5, Flash player 9.r124, IE 7.0.6000.16681 => After having updated flashplayer the Streaming error has gone, but now the projects don't get updated after having added one. You need to update another one or delete one to get a refresh!!
E) Windows XP-SP2, Rails 2.1 with Mongrel 1.1.5, Flash player 9.r115, Firefox 2.0.16 => Works smoothly, like Safari. No problems!

Hopes this helps. Good luck.
rainyglade (9) [Avatar] Offline
#11
Re: Tasks won't load on Flex - Iteration 6
I have Flash 9.0.124.0 and IE 6.0.2900.2180.xpsp_sp2_qfe.070227-2300
OS is WinXP

I do not have Rails 2.0 installed yet, but will try to test on that version as well.

Thanks,
Louise
rainyglade (9) [Avatar] Offline
#12
Re: Tasks won't load on Flex - Iteration 6
Okay, I tested this problem using IE version 6.0.2900.2180.xpsp+sp2_gdr.050301-1519 and Rails 2.0.2. When I add a task, it still doesn't show up in the list of tasks unless I log off and log in again. I have Flash 9.0.124.0 installed as well.

It does work okay on FireFox version 2.0.0.16.

Thanks,
Louise
{-.-}Hafa! (2) [Avatar] Offline
#13
Re: Tasks won't load on Flex - Iteration 6
well,

using flash player 9.0 r124, rails 2.0.2, works fine for both Firefox 3.01 and Safari 3.1.2 for Windows, but the same on IE7 7.0.6000.16643 does not work =[...

by the way, the book is very nice.. =)

see you.

Rafael
peterarmstrong (94) [Avatar] Offline
#14
Re: Tasks won't load on Flex - Iteration 6
Hi,

To be honest, you guys have figured this out better than me. This sounds like something that Adobe needs to address (or nag Microsoft about) ... specific versions of IE breaking things is not something I can control.

If someone could post this to http://bugs.adobe.com/flex/ that would be great. (It makes sense for the people who actually found the bug to file it.)

Thanks,
Peter
jimeriksson (1) [Avatar] Offline
#15
Re: Tasks won't load on Flex - Iteration 6
Hi,

Here is a workaround you can use until someone finds a real solution to this problem:

1. Change the call to the "render" method in the "create" action in the TasksController

from:

format.xml { render smilieml => @task, :status => :created,
:location => @task }

to:

format.xml { render smilieml => @task}

For some reason Flex couldn't handle the status code. Not in my version anyway.

2: Make the url unique in the svcTasksList service in the MainBox.mxml by appending current time or some random value. For example like this:

public function listTasks():void {
svcTasksList.url = "/tasks.xml?timestamp="+new Date().getTime().toString();
svcTasksList.send();
}

This way you prevent Internet Explorer from caching GET requests (I think it's an IE issue but I'm not sure). You should probably set this in some http header property like "Cache control" but I couldn't get it to work.

Hope this works for you
javinto (5) [Avatar] Offline
#16
Re: Tasks won't load on Flex - Iteration 6
Jim, brilliant!! This works for me as well in Internet Explorer as Firefox. You really need both modifications in order to have it run well.

Question now is, is this a Flashplayer or browser issue?
rameshkt (1) [Avatar] Offline
#17
Re: Tasks won't load on Flex - Iteration 6
Hello,

I have followed the book, but logging in does not list tasks, projects etc.. I am not able to create tasks,projects,locations as well. Using LiveHTTP headers I can see the following in logging in :-

http://localhost:3000/session.xml



POST /session.xml HTTP/1.1

Host: localhost:3000

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.3) Gecko/2008092510 Ubuntu/8.04 (hardy) Firefox/3.0.3

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: sa,en;q=0.8,en-us;q=0.5,hi;q=0.3

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 300

Connection: keep-alive

Cookie: _pomodo_session=BAh7BzoMdXNlcl9pZGkIIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVyOjpG%250AbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--a49d436e8f183bfa6b1ad3f7c2f5b23ac4be8e8c

Content-Type: application/x-www-form-urlencoded

Content-Length: 32



login=*******&password=********

HTTP/1.x 200 OK

Cache-Control: private, max-age=0, must-revalidate

Connection: Keep-Alive

Date: Wed, 01 Oct 2008 15:41:05 GMT

Content-Type: application/xml; charset=utf-8

Etag: "055e7be9a9129eef61871e33f497e119"

Server: WEBrick/1.3.1 (Ruby/1.8.6/2007-09-24)

X-Runtime: 0.02422

Content-Length: 621

----------------------------------------------------------

#request# POST http://localhost:3000/session.xml

POST /session.xml Content-Type: application/x-www-form-urlencoded

Content-Length: 32



login=******&password=******

#request# GET http://localhost:3000/bin/com/pomodo/assets/logo_md.png


The debug panel displays the following:-

[Wed Oct 1 21:11:05 GMT+0530 2008] user = <user>
<created_at type="datetime">2008-08-17T19:51:20+05:30</created_at>
<crypted_password>4ba140ec15b948003fca10baab60ab0bae4d161c</crypted_password>
<email>rameshk</email>
<first_name>Ramesh</first_name>
<id type="integer">3</id>
<last_name>Krishnan</last_name>
<login>rameshkt</login>
<remember_token nil="true"/>
<remember_token_expires_at type="datetime" nil="true"/>
<salt>3c867722c59e9833af6244be2c0325cace44d65d</salt>
<updated_at type="datetime">2008-08-17T19:51:20+05:30</updated_at>
</user>

I have followed the iterations as given in the book except running "newdb.bat" and tests in 5.5
I have tried out the suggestions in this thread, but no effect.
I can list and create tasks, projects, locations in html mode.

Would be much obliged if you could help me out. I am trying out Ruby on Rails and Flex 3 for an enterprise logistics application.

Regards.

Ramesh
javinto (5) [Avatar] Offline
#18
Re: Tasks won't load on Flex - Iteration 6
Hi Ramesh,

To be honest, I do not have a clue except that there might be a typo somewhere in Flex that does not trigger the right events. Did you try loading the bookcode?

Jan
bobwalsh (2) [Avatar] Offline
#19
Re: Tasks won't load on Flex - Iteration 6
I'm having the same issue with iteration 6... and 7: login works, interface loads, but no data (dropdowns, grids is loaded). Only difference is that I am using FlashPlayer10 on this MacBookPro, not 9.

Are there issues with 10? should I uninstall it? Any resolution/workaround??
bobwalsh (2) [Avatar] Offline
#20
Re: Tasks won't load on Flex - Iteration 6
Turned out to be some sort of weird memory state issue on my MacBook Pro: restarting my MBP resolved the issue. But would still like some information re FlashPlayer10 vs. 9 and what effect - if any - that has on any RonR/Flex-AIR apps.
javabk (1) [Avatar] Offline
#21
Re: Tasks won't load on Flex - Iteration 6
HI,

I had the same problem on both Safari and FF (on Mac) I moved creationComplete="listTasks()" from parent <mx:VDividedBox> to its child
<mx:VBox width="100%" height="60%" creationComplete="listTasks()">

and it's working fine on both browsers

Khaled