PDA

View Full Version : Views that get data two possible ways? Kind of a design question.


CDHBookingEdge
11-24-2006, 08:37 AM
I used the word View, but in this scenario my view happens to be a dialog, a TitleWindow that's popped up. Anyway, so here's the scenario.

I have two dialogs. Let's call the first one the datagrid dialog, and the second one the chart dialog to hopefully help against confusion. The user can bring the chart dialog up in one of two ways, either thru the main interface, or as an option on the datagrid dialog.

Why does that matter you ask? Due to the fact that if brought up the second way, then the datagrid dialog already has data that can be used to show the chart in the chart dialog. So there is no need make another trip to the server. But, if brought up from the main interface then yes there is a need to go to the server to get the needed data. Now I can handle the two different ways part, as I've figured out some ways to do some types of overloading and such. BUT here's my current gotcha! I'm faced with. When the trip to the server is needed, that is going to be done (standardly) thru a RemoteObject, right?

Now am I making this harder in my mind than it really is? (Please note/remember I'm having trouble with grasping RemoteObjects, due to the fact that I'm currently unable to get ColdFusion working on this computer, so I've yet to play around with them and see them in action.) I mean, and here's the real question I think, as stupid as it may sound:

Is this statement true, and I'm just missing the full realization of it? Just because I have a RemoteObject declared in my MXML, that in no way means that any trip to the server is going to be done to converse with it, unless I specifically call a method. Am I trying to give this RemoteObject more "power" than it really has, at least in my mind I mean.

Thanks, sorry if that was a bit confusing, I'm on 20+ hours of being up and not looking like it's going to end that soon.

Thanks in advance,
Christopher

meddlingwithfir
11-25-2006, 06:06 AM
Oof -- I just wrote up a big reply, and got about halfway done before I thought -- "Man I wonder if this is even what he's asking" :P

So I'll stick to the simple response:


Is this statement true, and I'm just missing the full realization of it? Just because I have a RemoteObject declared in my MXML, that in no way means that any trip to the server is going to be done to converse with it, unless I specifically call a method. Am I trying to give this RemoteObject more "power" than it really has, at least in my mind I mean.


That statement is true. Just having the RemoteObject declared does NOT make any requests to your CFC on the server (other than to maybe verify whether or not the arguments you set it up for are valid? Not sure if it does this or not actually).

CDHBookingEdge
11-25-2006, 07:25 AM
LOL yeah that's about what happened to me when I was writing the first post, it was like (put in picture of fingers typing) ..wait a minute..am I being silly? (put in picture of fingers stopping..erasing some..then retyping)
So ok now I'm starting to get it. It (meaning the remoteobject declaration) just says " hey look there's gonna be this thing Im gonna use to talk to the server and these are the paramaters about it and this is what methods I'm going to allow to be called"

That sound about right?
(See the above statements are why I'm not a technical editor)

Christopher

meddlingwithfir
11-27-2006, 03:57 PM
Yep, that's what I take it to mean.

I tried to go one step further and look at the source code for the RemoteObject , but when I did the shortcut (ctrl-click while hovering over the <mx:RemoteObject> tag) -- it told me the source could not be found!

Hrm. Is the source code hidden for this class, or is there another way to get it?

Message:

Source could not be found for mx.rpc.remoting.mxml.RemoteObject in
C:\Program Files\Adobe\Flex Builder 2 Plug-in\Flex SDK 2\frameworks\libs\rpc.swc