Using SessionStorage in a Model

Hi,

I read this page http://ortus.svnrepository.com/coldbox/trac.cgi/wiki/cbModelGuide
but I am having trouble getting it to actually work.

I have a model that I'm trying to access the sessionstorage in order
to populate the arguments for an init function of a component that the
model extends.

<code>
<cfcomponent displayName="top_ten_functions"
extends="shared.component">

  <cfproperty name="SessionStorage"
type="coldbox:plugin:sessionstorage" scope="instance" />

  <cfscript>
    this.init( aid = instance.SessionStorage.getVar("aid") );
  </cfscript>

</cfcomponent>
</code>

The code above continuously returns "Element SESSIONSTORAGE is
undefined in INSTANCE." ... if I try to dump instance before the init
line, it tells me that instance doesn't exist ... anyone have any
ideas what I'm doing wrong here?

Thanks!

Hi
Once coldbox injected every dependencies then it will call a method onDIcomplete. put your code inside the method then you will have the values.

coldbox.xml.cfm setting for model

this.init( aid = instance.SessionStorage.getVar("aid") );

Also I would suggest to read model integration guide once more.

Thanks
Sana