Forum


HomeHomePremiumPremiumDevelopmentDevelopmentDate Sharing Between Modules?Date Sharing Between Modules?
Previous
 
Next
New Post
11/1/2016 8:15 AM
 

I have a situation where some data fields from Module A need to be accessed from Module B. How can this be done?

Also, If the a value in module A changes (user selects a new value from a dropped down control), can Module B get notified to refreshed itself based on the newly selected value?

 
New Post
11/2/2016 7:50 AM
 

Hi Ahmad,

When you say "data fields" from Module A - How are you saving this data right now? To you own custom tables? To the module settings?

Thank you,

Aderson

 
New Post
11/2/2016 8:30 AM
 

Ahmed,

There are several ways to do this.  

A classic webforms example, which as been in DNN for years, is implementing the IModuleCommunicator interface of DotNetNuke.Entities.Modules.Communications.  Here is an article that explains it.  

A more modern approach would be to implement an observer pattern in javascript.  For example, you could have a common js library that both modules reference.  Module B could use a common function to register a callback function (event) and Module A could call a function that would therefore call the callback function from Module B.  This is like a Pub/Sub architecture.  Here is an example of how to do in jquery. 

 

 
New Post
11/2/2016 10:52 AM
 
I am saving the data in my own custom database.
 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentDate Sharing Between Modules?Date Sharing Between Modules?



Try FREE
30 days money back guaranteed