AnsweredAssumed Answered

dojo topic pub/sub

Question asked by wmakari on Mar 30, 2017
Latest reply on Apr 3, 2017 by wmakari

To support my custom workflow I have made small change jimu.js/LayoutManager.js. The change that I have made is creating an object that I then publish within this file as follows

 

topic.publish("channel_id","object with attributes i need to pass to widget");

 

I have a custom widget in my application that I would like to subscribe to the channel specified above when the user launches the widget to use it.

 

i have tried this in the startup method of my custom widget

 

topic.subscribe("channel_id",function (e){

 

alert(JSON.stringify(e));

 

});

 

My custom widget does seem to be able to subscribe to the channel published from LayoutManager.js. Is this possible? Is there any other way I can achieve this? Any pointers will be gratefully received.

Outcomes