Futurescale, Inc.
PureMVC Home
The PureMVC Framework
Code at the Speed of Thought
Over 10 years of community discussion and knowledge are maintained here as a read-only archive.
New discussions should be taken up in issues on the appropriate projects at
https://github.com/PureMVC
PureMVC Architects Lounge
PureMVC Manifold
Port to AS3
Standard Version
two instance of component problem
Pages: [
1
]
« previous
next »
Author
Topic: two instance of component problem (Read 8239 times)
oklamos
Newbie
Posts: 6
two instance of component problem
«
on:
April 23, 2009, 12:48:35 »
Hello,
I have the following problem :
in my mxml app i have one componenet (DebugView) in two instances (ucGatewayDebugView and ucSIMDebugView )
In the app mediator constractor i registered two mediators for the component:
facade.registerMediator( new DebugViewMediator(app.ucGatewayDebugView ) );
facade.registerMediator( new DebugViewMediator(app.ucSIMDebugView ) );
In the debugMediator i have the following function that add text line to textArea in the debugView Conponent:
case ApplicationFacade.DATA_SHOW_IN_DEBUG:
showData(note.getBody() as String,COLOR_RECEIVE);
break;
.
.
.
private function showData(sData:String,sColor:String):void
{
uc.txtDebug.text += sData
; // the line added only in ucGatewayDebugView !!
}
the problem is that the debugMediator add the text line only in one component instance (ucGatewayDebugView )
Any advice please ?
Logged
puremvc
Global Moderator
Hero Member
Posts: 2871
Re: two instance of component problem
«
Reply #1 on:
April 23, 2009, 06:44:24 »
Your mediators need to be registered with unique names. In the constructor of the mediator instead of just passing super the NAME constant you've defined for the mediator, try appending the id of the component like:
super(NAME+"/"+viewComponent.id, viewComponent);
-=Cliff>
Logged
oklamos
Newbie
Posts: 6
Re: two instance of component problem
«
Reply #2 on:
April 23, 2009, 07:17:18 »
Thanks Cliff , its work now
Logged
Pages: [
1
]
« previous
next »
Stack Overflow
GitHub
Linked In
Google Plus
Twitter
Powered by SMF 2.0.15
|
SMF © 2006-2007, Simple Machines LLC
|
Content © 2006-2018, Futurescale, Inc.
Loading...