Hi there

I've got two different groovy classes in two different pages (lets say Widget 
and WidgetFactory), and in a third page I'm trying to call an instance of the 
WidgetFactory, getting it to create a Widget. 

I've included the groovy code for both classes in the third page using the 
"wiki.parseGroovyFromPage(…" call, which works as I can successfully call 
methods on the widget factory.

However, calling the createWidget method on the factory produces an error, in 
that the WidgetFactory code doesn't know anything about Widgets (i.e. it 
doesn't know about the Widget class). Am I doing something wrong?

I would like to be able to modularise the code in some way. It doesn't matter 
if there are many different classes declared in the one page, or just one; as 
long as I can instantiate them, and they know about each other. This would be 
great as it will mean I can reuse these classes around a few different pages. 

I've tried including the code using the include macro (outside the groovy 
block) , and using the xwiki.includeForm call (inside the groovy block), with 
no success.

Thanks,
Nigel

_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to