tag:robotlegs.tenderapp.com,2009-10-18:/discussions/robotlegs-2/9114-how-to-mediate-a-view-manuallyRobotlegs: Discussion 2014-01-20T12:24:19Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/309965272014-01-11T12:30:40Z2014-01-11T12:30:40Zhow to mediate a view manually ?<div><p>Hello,</p>
<p>Sorry, I haven't noticed your post until today, because you've
marked it as private. Is there any reason you want to keep this
discussion private, or have you marked it as such by accident?</p>
<p>Re-parenting means the view is removed from stage and then added
again. So, its mediator is removed and then created again, and, of
course, initialize() is called again.<br>
That shouldn't be an issue for you, unless your mediator is doing
more than just adding event listeners in its initialize()
method.</p>
<p>If you want to mediate a view manually, you can do this:<br>
<a href=
"https://github.com/robotlegs/robotlegs-framework/tree/master/src/robotlegs/bender/extensions/mediatorMap#mediating-objects-manually">
https://github.com/robotlegs/robotlegs-framework/tree/master/src/ro...</a></p>
<p>But, I don't see why that is necessary, because as I said, the
re-parented view will have its mediator created automatically.</p>
<p>Ondina</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/309965272014-01-17T01:15:13Z2014-01-17T01:17:05Zhow to mediate a view manually ?<div><p>hi<br>
I had convert this discussion to public, when i pushed this
discussion ,i didn't aware i made a private discussion, so sorry. I
think i found the problem, I new a rsl config file for module when
module add to stage, when the depth of module was changed, there
will trigger add_to_stage event, then my program reinitialize rsl
context for the module and the mediator is also initialized. now i
listen creationComplete event to initialize rsl context of module ,
and it works well. sorry for my poor english. another question,
when i debug the project , everything works well. but when i use
release version of the project, rsl framework always throw a null
pointer error.</p></div>foodyitag:robotlegs.tenderapp.com,2009-10-18:Comment/309965272014-01-17T09:56:21Z2014-01-17T09:56:21Zhow to mediate a view manually ?<div><p>Hi,</p>
<blockquote>
<p>when i debug the project , everything works well. but when i use
release version of the project, rsl framework always throw a null
pointer error.</p>
</blockquote>
<ul>
<li>
<p>Try setting the "Framework linkage" to <strong>Merged into
code</strong>, instead of Runtime shared library (RSL) for your
modules - under Project- properties - Flex Build Path - Framework
linkage</p>
</li>
<li>
<p>If you did not compile your module in the main application, then
maybe you should also try to choose "Do not optimize (module can be
loaded by multiple applications)" for your module, under Project -
Properties - Flex Modules - Edit Module</p>
</li>
</ul>
<p>I'm using FlashBuilder! Settings may differ in other IDEs</p>
<ul>
<li>
<p>Also, see this article and the replies there: <a href=
"http://forums.adobe.com/message/3835326">http://forums.adobe.com/message/3835326</a><br>
and this:<br>
<a href=
"http://blogs.adobe.com/aharui/2011/04/catching-uncaughterror-in-flex-modules.html">
http://blogs.adobe.com/aharui/2011/04/catching-uncaughterror-in-fle...</a></p>
</li>
<li>
<p>Also, check the ApplicationDomain of your modules. See these
discussions and the links there: <a href=
"http://knowledge.robotlegs.org/discussions/problems/650-robotlegs-modular-loading-from-swf#comment_19031706">
http://knowledge.robotlegs.org/discussions/problems/650-robotlegs-m...</a><br>
<a href=
"http://knowledge.robotlegs.org/discussions/problems/505-loading-robotlegs-project-swf-into-robotlegs-project#comment_14398958">
http://knowledge.robotlegs.org/discussions/problems/505-loading-rob...</a><br>
<a href=
"http://knowledge.robotlegs.org/discussions/problems/521-loading-one-robotlegs-project-to-another-robotlegs-project#comment_14629656">
http://knowledge.robotlegs.org/discussions/problems/521-loading-one...</a></p>
</li>
<li>
<p>Not sure if that could be an issue too, but try setting the
additional compiler arguments like this:</p>
</li>
</ul>
<pre>
<code>-keep-as3-metadata+=Inject
-keep-as3-metadata+=PostConstruct</code>
</pre>
<p><a href=
"https://github.com/robotlegs/robotlegs-framework/wiki/common-problems#metadata-stripping">
https://github.com/robotlegs/robotlegs-framework/wiki/common-proble...</a></p>
<ul>
<li>Are you keeping a reference to the context? <a href=
"http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/keep-a-reference-to-your-context-or-it-will-be-garbage-collected">
http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/kee...</a></li>
</ul>
<p>Let me know how it goes.</p>
<p>Ondina</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/309965272014-01-18T15:15:30Z2014-01-18T15:15:30Zhow to mediate a view manually ?<div><p>hi Ondina<br>
after i added below compiler arguments :</p>
<pre>
<code>-keep-as3-metadata+=Inject
-keep-as3-metadata+=PostConstruct</code>
</pre>
the release version of my flex project works well, thanks a lot.
btw, without these arguments, debug version of my project also
works.</div>foodyitag:robotlegs.tenderapp.com,2009-10-18:Comment/309965272014-01-20T12:20:03Z2014-01-20T12:20:03Zhow to mediate a view manually ?<div><p>You're welcome:)<br>
Glad to hear that it works.</p></div>Ondina D.F.