cancel
Showing results for 
Search instead for 
Did you mean: 

aikau page and pubSub help

jonno70
Champ on-the-rise
Champ on-the-rise

Hi

I am developing an aikau page - with a number of widgets, including a document list and document preview.  All pretty successfully thanks to Dave Draper's great tutorial.

The final piece of the page is a widget that displays content from Alfresco.  This I can do by "calling" KnowledgeWidget.js, which gets the html content I want to display and uses domConstruct to build the widget content.  At the moment the path to the Alfresco content is hard coded.

What I want to do is call my aikau page with a parameter  ie. http://localhost:8081/share/page/hdp/ws/knowledge?page=Policy

and pass this parameter to my KnowledgeWidget.js

page = page.url.args.page;  gets me the parameter.

And I believe I need to use pubSub to get the parameter to the widget - but I can't figure out how to do it..  Or if I can do it.

I have followed Dave's tutorials, particularly the DataLists with the pubSub and the basic sub/sub in Ole's examples as well.

Any advice will be greatly appreciated

thanks, Jon

1 REPLY 1

ddraper
World-Class Innovator
World-Class Innovator

First of all, thanks for the kind words about the tutorial, etc - it's very much appreciated!

If you're getting the request parameter in the JavaScript controller of the WebScript then the best approach would be to create a configuration attribute on your custom widget and set it in the controller (rather than trying to do it on the client side). 

We do this quite a bit in the unit test application in order to change the way that the test page behaves. Please review the examples below as to how this can be done: