[Arp] Commands and viewRef
Buchanan, Aaron
aaron.buchanan at la.tribalddb.com
Thu Jan 6 11:55:54 PST 2005
Ordered.
Thank you,
Aaron
________________________________
From: Arp-bounces at ariaware.com [mailto:Arp-bounces at ariaware.com] On Behalf Of Keith Peters
Sent: Monday, January 03, 2005 5:19 AM
To: 'General List for Ariaware RIA Platform users and developers'
Subject: RE: [Arp] Commands and viewRef
Head First Design Patterns:
http://www.amazon.com/exec/obidos/ASIN/0596007124/bit101-20
I recently blogged about it: http://www.bit-101.com/blog/archives/000100.html
________________________________
From: Arp-bounces at ariaware.com [mailto:Arp-bounces at ariaware.com] On Behalf Of Buchanan, Aaron
Sent: Monday, December 06, 2004 3:00 AM
To: General List for Ariaware RIA Platform users and developers
Subject: RE: [Arp] Commands and viewRef
I feel so lost.
Does any one have a link (or book) that I could use to begin to understand this stuff?
This whole thing may be too advanced for me, But I would sure like to know it..
I have the utmost respect for you all and hope that you might be patient with a
not-so-savy straggler.
until then,
I will try to decode these emails again and again.
Theres gotta be something I can get out of it..
Thank you,
Aaron
________________________________
From: Arp-bounces at ariaware.com on behalf of Aral Balkan
Sent: Sat 12/4/2004 12:04 AM
To: General List for Ariaware RIA Platform users and developers
Subject: Re: [Arp] Commands and viewRef
Hi Matthias,
just noticed that there are already some topics sent out even if I haven´t received any of them ...
Sorry, the list doesn't send out all prior emails to new sign-ups. As you can imagine that could mean a lot of traffic as the archives fill up. You can always check for older messages on the public archives, though.
So I have a dynamic menu created in my so called navigation.as / navigation form
I have registered an event called "getContent" to that form which will dispatched within an onRelease function of a given button
Surely you mean that you listen for the "click" event :) Otherwise you'd have to have your Controller listen for the event on the button itself and that's a bit yucky!
The executeOperation () in the GetContentCommand.as executes as desired, but the (conceptual) problem I have now is the onResultOperation() of the GetContentCommand.as
Within the executeOperation() I call the remote service to get all the contents of a given page id which is also passed from the navigation.as correctly
So if the button belongs to a page with her uid = 5 I will have all the database contents having a pid = 5
So, up to here everything works fine
but I don t know how to proceed....
As for now in the examples, the documentation I only see cases where the onResultOperation() invokes methods on the viewRef, which would be in this case my navigation.as, but I wont have in any case the navigation taking care about the content
You should pass the pid back to the viewRef. However, the viewRef, in your case, should point to your *main application form* (as that's the best place, imho, to carry out navigation related functions.) The application form can then display page 5. So, how do we achieve this when, as you pointed out, viewRef points to the navigation form?
The key here is to have the application form listen for the getContent event on the navigation form and itself broadcast (bubble) the getContent event. You can then have the Controller listen for the getContent event on the application form and the viewRef will be set accordingly.
In fact, in the sample application (the pizza service one), I am not happy with the additional navigation form. It creates the type of (imho unnecessary) event bubbling that I just described. In the next release (which is Very Close (tm) btw), the navigation in the samples will be part of the application form which makes much more sense to me currently.
how to invoke onResultOperation() on a different class than the viewRef
See above (and don't!) :)
what would be the best way to define the Contents.as and where to place it
Really depends on what features it will have. Will it broadcast any system/view events? If so, it should probably be its own form. What you want is to follow the rules of encapsulation as much as possible.
Hope this helps,
Aral
--
Aral Balkan
Managing Director, Ariaware Ltd.
Tel: +44 (0) 870 7542240
Fax:+44 (0) 870 7542240
Mob: +44 (0) 7986 124219
* Web: http://www.Ariaware.com
* Blog: http://www.FlashAnt.org
* Macromedia Certified Instructor
Flash MX 2004 Advanced ActionScript Development
Flash MX 2004 Professional ActionScript Development
* Director of Educational Content - Ultrashock <http://www.Ultrashock.com>
* Author - Friends of ED <http://www.FriendsOfEd.com> , Macromedia DevNet <http://www.macromedia.com/devnet>
* Director - London MMUG <http://londonmmug.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/arp_ariaware.com/attachments/20050106/39573d86/attachment-0001.htm
More information about the Arp
mailing list