Try putting the RemoteObject outside the
popup but leave the other code in. Start there. We’ve seen RemoteObject
have problems before.
Matt
Wow! - Tracy, that actually worked!
- I did as you suggested, and removed everything except my
<TitleWindow> tags, and an ActionScript function - that sends Trace()
text to my debug window (triggered by the creationComplete event).
So, where do you think my previous code is
failing? There is a radically small amount of code from my first
example - so I am really baffled and frustrated that Flex is getting tripped up
this easily... I will try to tweak where I
put certain pieces of code, etc. but I gotta say, this is really odd - since
this SAME code, works fine when it's in an <Application> tag.
Typically, immediately after the main
container code, is where I put my ActionScript Code. Like in the
Root Application, I put my ActionScript functions just after the
"Application" tag - or if it's a Custom Component, I put my
ActionScript functions just after the Tags that define the component.
Are there any rules I need to follow,
regarding WHERE I should declare my ActionScript Variables, Functions or
Objects? Also, are there any specific rules, as to where I should put my
RemoteObject declarations - so my code executes reliably?
It's a little disappointing to have this
many problems, so close to the beginning of learning this new language...
I understand what it means (and what it takes) to learn & take on a new
language - but to have all these goofy problems, really takes the fun out of
things...
Well, if you could shed more light on
these problems I am having, I would greatly appreciate it :)
Mike
From: [email protected] [mailto:[email protected]] On Behalf Of Tracy Spratt
Sent: Friday, June 17, 2005 1:21
PM
To: [email protected]
Subject: RE: [flexcoders] Code not
executing in Popup Window
Rip out everything but the
creationComplete handler with the trace. See what happens.
Tracy
It's not just RemoteObject -
TRACE doesn't even work - which means, the
code isn't even executing -
Is there any reason, why the code isn't
executing properly?
Thanks again,
Mike
From: [email protected] [mailto:[email protected]] On Behalf Of Matt Chotin
Sent: Friday, June 17, 2005 12:03
AM
To: [email protected]
Subject: RE: [flexcoders] Code not
executing in Popup Window
I don’t see a problem but I know
that others have run into issues when the RemoteObject has been contained in a
popup. It seems to work better if it’s hung off the Application or
something that’s a little more “permanent” instead.
Matt
Hello All,
I have "known to be working" code,
contained inside of a Custom Created
TitleWindow component. The code handles all
the RemoteObject
declarations, and populates a List Control, upon
the Result Event.
The Popup Window is launched from a Button
residing in my Main
Application.
After clicking the launch Button, the Window pops
up perfectly and all
the controls are there, but nothing happens.
In fact, the function that
retrieves the data, also sends a trace() message
to the debug window -
and nothing even happens when I do that.
It's almost as if the code contained in my custom
control, doesn't even
exist. Is my problem, the way in which I am
creating my Popup Window?
There must be something simple I am doing wrong...
Here is the code in my main application that
launches the window:
------------------------------------------------------------------------
----
public function launchWindow()
{
var pop =
mx.managers.PopUpManager.createPopUp(this, Categories,
false, null, true);
}
------------------------------------------------------------------------
----
Here is the code, inside my custom component
called "Categories.mxml":
------------------------------------------------------------------------
----
<?xml version="1.0"
encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.macromedia.com/2003/mxml"
title="Manage Categories"
closeButton="true" click="deletePopUp()"
creationComplete="getCategoriesOnly();">
<mx:RemoteObject id="remoteService"
source="services.InfoNexus"
endpoint="http://www.mysite.com/flashgateway.aspx"
showBusyCursor="true">
<mx:method
name="getCategoriesOnly"
result="getCategoriesOnly_Handler(event.result)"
fault="getCategoriesOnly_Fault(event.fault)"/>
</mx:RemoteObject>
<mx:Script>
<![CDATA[
//=======
CATEGORIES =======//
function
getCategoriesOnly()
{
trace("getCategories just kicked
off");
remoteService.getCategoriesOnly();
}
function
getCategoriesOnly_Handler(result)
{
trace("getCategories_Handler just kicked
off");
categories_List.dataProvider = result;
}
function
getCategoriesOnly_Fault(result)
{
}
]]>
</mx:Script>
<mx:VBox>
<mx:Label text="Categories:"/>
<mx:List id="categories_List"
width="250" height="200"/>
</mx:VBox>
<mx:ControlBar>
<mx:Button label="Get Categories"
click="getCategoriesOnly()"/>
<mx:Button label="Delete"/>
</mx:ControlBar>
</mx:TitleWindow>
------------------------------------------------------------------------
----
Could you all shed some light, as to why this
isn't working?
Thanks in advance,
Mike
Yahoo! Groups Links