tag:robotlegs.tenderapp.com,2009-10-18:/discussions/solutions/9-mediate-non-visual-view-componentsRobotlegs: Discussion 2018-10-18T16:35:21Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/46482002011-01-10T18:35:33Z2011-01-10T18:35:33ZMediate non-visual view components<div><p>good explanation</p></div>Nikos tag:robotlegs.tenderapp.com,2009-10-18:Comment/46482002011-01-25T21:09:38Z2011-01-25T21:09:39ZMediate non-visual view components<div><p>I tried this exact thing but I am getting an error I am unsure
of:<br>
mediatorMap.mapView(AudioPlayer,AudioPlayerMediator,null, false,
false);<br>
mediatorMap.createMediator(AudioPlayer);<br>
AudioPlayer is a regular class that extends EventDispatcher, and
AudioPlayerMediator obviously extends Mediator. But I am getting
the following error:<br>
TypeError: Error <a href="/discussions/solutions/1034" title=
"Discussion #1034">#1034</a>: Type Coercion failed: cannot convert
org.robotlegs.selfdirected.views.components.controlPanel::AudioPlayer$
to
org.robotlegs.selfdirected.views.components.controlPanel.AudioPlayer.<br>
Any idea what I am doing wrong with my non-visual component?<br>
Thanks for this post, it is one of the only posts I could find on
loading audio as a view.</p></div>Todd Coulsontag:robotlegs.tenderapp.com,2009-10-18:Comment/46482002011-01-26T15:18:28Z2011-01-26T15:18:28ZMediate non-visual view components<div><p>@Todd: I'm not really sure what is going wrong here. Could you
maybe post your code or attach a zip file of the project?</p></div>Abel de Beertag:robotlegs.tenderapp.com,2009-10-18:Comment/46482002011-01-26T16:33:36Z2011-01-26T16:33:37ZMediate non-visual view components<div><p>I really appreciate any eyes that can go on this. TIA.</p></div>Todd Coulsontag:robotlegs.tenderapp.com,2009-10-18:Comment/46482002011-01-26T16:35:10Z2011-01-26T16:35:12ZMediate non-visual view components<div><p>Sorry I tried to post this, but it said I had not seen a comment
and then took my attachment off.</p></div>Todd Coulsontag:robotlegs.tenderapp.com,2009-10-18:Comment/46482002011-01-26T16:58:39Z2011-01-26T17:07:31ZMediate non-visual view components<div><p>Ahh yes, easy one:<br>
<code>mediatorMap.createMediator()</code> expects an
<em>instance</em> of the view component class, where you give it
the <em>Class</em>. So just change that line in your context to:
<code>mediatorMap.createMediator(new AudioPlayer())</code></p>
<p>Edit: I could have seen that from your first post BTW... But I
didn't. ;) Oh and that means I typed my original post incorrectly
as well! Will fix it now.</p></div>Abel de Beertag:robotlegs.tenderapp.com,2009-10-18:Comment/46482002011-01-26T17:36:43Z2011-01-26T17:36:43ZMediate non-visual view components<div><p>fabulous! makes perfect sense now, I thought it created an
instance from the Class provided.</p></div>Todd Coulson