Howdy,
I tried to get data from a module via a widget. Is that even possible?
currently I fail miserably
My module in the modul_user folder looks like this:
`
testpanel
├── handlers
│ ├── base.cfc
│ └── Home.cfc
├── ModuleConfig.cfc
├── plugins
├── views
│ └── home
│ └── index.cfm
└── widgets
└── TestPanel.cfc
`
The TestPanel.cfc in the widgets folder contatins only some lines with code:
`
component extends=“contentbox.models.ui.BaseWidget” singleton{
testpanel function init(controller){
// super init
super.init(controller);
// Widget Properties
setName(“TestPanel”);
setVersion(“1.0”);
setDescription(“A widget that renders a the TestPanel Module”);
setAuthor(“Author”);
setAuthorURL(“https://www.author”);
return this;
}
any function renderIt(){
var content = runEvent(event=‘testpanel:Home.index’,eventArguments=arguments);
if( !isNull(content) ){
return content;
}
}
}
`
And the file handlers/Home.cfc:
`
component extends=“base” {
public void function index(event,rc,prc){
event.setView(view=“home/index”);
}
}
`
When I execute the code, I get every time following failure on the widget-page in the admin-area:
Error rendering widget: No matching function member [setView] for call with named arguments found, available function members are [asc,changeDelims,cJustify,compare,compareNoCase,deserializeJSON,each,every,filter,find,findNoCase,findOneOf,getToken,hasPrefix,hasSuffix,insert,isEmpty,lCase,left,len,listAppend,listAvg,listChangeDelims,listCompact,listContains,listContainsNoCase,listDeleteAt,listEach,listEvery,listFilter,listFind,listFindNoCase,listFirst,listGetAt,listIndexExists,listInsertAt,listItemTrim,listLast,ListLen,listMap,listPrepend,listQualify,listReduce,listRemoveDuplicates,listRest,listSetAt,listSome,listSort,listToArray,listValueCount,listValueCountNoCase,lJustify,ltrim,map,mid,reduce,reFind,reFindNoCase,REMatch,REMatchNoCase,removeChars,repeatString,replace,replaceNoCase,rEReplace,rEReplaceNoCase,reverse,right,rJustify,rtrim,some,spanExcluding,spanIncluding,stripCr,trim,uCase,ucFirst,wrap]
The frontend shows nothing.
Why do not I just get a hello world back from the View? It seems that I forget what …
Andy