Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you use Parsley with GraniteDS in Flex?
    primarykey
    data
    text
    <p>I want to use the Parsley framework and I want to use GraniteDS for remoting. As of 2.1, GraniteDS generates AS3 service classes from your Java code as local proxies, and I want to use these classes in Parsley.</p> <p>I can successfully inject the service classes with Parsley but when I call any of their methods I get a null object error</p> <pre><code>at org.granite.tide::Component/http://www.adobe.com/2006/actionscript/flash/proxy::callProperty()[C:\workspace_\graniteds\as3\framework\org\granite\tide\Component.as:172] at library::BookServiceBase/get()[C:\Documents and Settings\MedLineTec\Adobe Flash Builder 4\library\src\library\BookServiceBase.as:36] </code></pre> <p>This would be because Parsley is creating instances of the service classes without actually injecting them with the relevant "context" to do the GraniteDS remoting. I need to figure out how to give the GraniteDS context to the service classes which parsley instantiates. I saw <a href="http://www.spicefactory.org/forum/viewtopic.php?t=832&amp;sid=d616494f9791d7747700e2017ad7b16d" rel="nofollow" title="a post on the parsley forums">a post on the parsley forums</a> where someone recommended:</p> <pre><code>&lt;parsley:ContextBuilder&gt; &lt;parsley:FlexConfig type="{UserManagerConfig}"/&gt; &lt;parsley:RuntimeConfig instances="{[tideContext]}" /&gt; &lt;/parsley:ContextBuilder&gt; ... [Bindable] private var tideContext:Context = Spring.getInstance().getSpringContext(); </code></pre> <p>But that didn't work for me. I'm familiar with GraniteDS but not with Parsley so maybe this is the solution but applying it correctly is above my head.</p> <p>If someone has it going with another framework like Swiz or Spring ActionScript then please also pass that solution on as it might be very similar.</p> <p>UPDATE: I figured out by reading the Granite source code that after I inject a service with Parsley (e.g. bookService), if I run</p> <pre><code>private var tideContext:Context = Spring.getInstance().getSpringContext(); bookService.meta_init("bookService", tideContext); </code></pre> <p>Then I can successfully use the service. So I guess I just need to know how to do this in a sort of automatic way with all the services I declare in Parsley.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload