I’m a little confused as to when it is necessary to include wirebox as a property injection.
property wirebox inject="wirebox";
I have wirebox enabled, but I still have to include it in objects when I want to use getInstance.
`
myObj =wirebox.getInstance(“someObject”);
`
Is this the way it is suppose to work or is there something wrong with my setup?
Also I was trying to use getModel in an object but could not get it to work. Should I be using getModel or getInstance to pull in a object bean?
Here is an example of what I mean.
component SomeService
singleton
output=“false”
accessors=true
{
property struct name=“StructToHoldObjs” setter=false getter=false;
// is this the correct way to reference wirebox in an object?
property name=“wirebox” inject=“wirebox”;
function init (){
StructToHoldObs = {};
return this;
}
void function AddSomeStuff (Key, DataString){
if (structkeyexists(StructToHoldObjs,Key)){
structdelete(StructToHoldObjs,Key);
}
// This works
var SD = wirebox.getInstance(“OBJ.SOMEDATAOBJ”);
// These methods do not work
// var SD = getModel(“OBJ.SOMEDATAOBJ”);
// var SD = wirebox.getModel(“OBJ.SOMEDATAOBJ”);
structInsert(StructToHoldObjs,key,SD);
}}