Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0InterModuleCommunication help, please ...InterModuleCommunication help, please ...
Previous
 
Next
New Post
3/18/2007 5:33 PM
 
I have a text string in Module "A" that I would like to pass to Module "B".

Can someone please outline (in a little bit of detail) how I should do this?

Thanks.



Joe Craig
Patapsco Research Group, Ellicott City, MD
DotNetNuke Development and Services (http://patapscorg.com)
 
New Post
3/18/2007 5:58 PM
 

(code examples in vb)
first, in the 'SENDING' module, add the following to the Implements section

Implements Entities.Modules.Communications.IModuleCommunicator

then add a function prototype for the ModuleCommunication function

Public Event ModuleCommunication(ByVal sender As Object, ByVal e As DotNetNuke.Entities.Modules.Communications.ModuleCommunicationEventArgs) Implements DotNetNuke.Entities.Modules.Communications.IModuleCommunicator.ModuleCommunication

and to 'SEND' a message with data to another module...

Dim moduleCommunicationEventArgs As New _
DotNetNuke.Entities.Modules.Communications.ModuleCommunicationEventArgs

moduleCommunicationEventArgs.Sender = "myModuleName"
moduleCommunicationEventArgs.Target = targetModuleID ' ID of module you want to send to
moduleCommunicationEventArgs.Value = "A"
moduleCommunicationEventArgs.Type = "string"
RaiseEvent ModuleCommunication(Me, moduleCommunicationEventArgs)

now, in the 'RECEIVING' module, add the following to the Implements section

Implements Entities.Modules.Communications.IModuleListener

then add a function to 'catch' any thrown messages

Public Sub OnModuleCommunication(ByVal s As Object, ByVal e As _
DotNetNuke.Entities.Modules.Communications.ModuleCommunicationEventArgs) Implements _
DotNetNuke.Entities.Modules.Communications.IModuleListener.OnModuleCommunication
  Dim sValue as string = ""
  ' make sure this module is the intended target
  If CInt(e.Target) = Me.ModuleId Then
    sValue = e.Value.ToString()
  End If
End Sub

 
New Post
3/19/2007 9:49 AM
 
Thanks.

I'm doing this in C#, but I think that I can translate.  If not, I'll ask for help again!



Joe Craig
Patapsco Research Group, Ellicott City, MD
DotNetNuke Development and Services (http://patapscorg.com)
 
New Post
3/24/2007 1:13 PM
 

How can we pass the module ID of a module still under development?

I think I have the basics figured out but can't quite get a handle on the sender and the target. Are we looking at getType(namespace.class).Sender ... if so, on my receiver side, the class of the sender isn't showing as defined.

Confused about how to link the two up.


pmgerholdt
 
New Post
3/24/2007 6:09 PM
 

Think of the intermodule communication system as an Message/Event system.

When you raise a SEND event - EVERY module on the current PAGE that has subscribed to the InterModule listener - has its listener triggered.

The ARGS object that is passed to the module contails the Target property that you declared in the SENDing modules - send function

In the Listener - on ALL receiving modules - that is ANY module on the page that has implemented a intermodule message Listen - you do a test against Target and compare it with your reveiving moduleid - to determine if the message is for that module

Sender is a simple string - it can actually be any name that identifies where the message came from.
If you want to ping pong messages back - you can stick the sending moduleid into the sender string.

Be very carefull with cascading events if you try this stuff - REMEMBER - all modules subscribed modules get the event

>>>>

NOTE: one of the features of this system is that a message can be broadcast to all the modules you have on a single page - by creating your own messageid.

For example - i have a dashboard for a client site that controls how all the custom modules on a page appear to the client.  The dashboard sends intermodule events with moduleids in the range -100 to -199 - and all the other modules have a listener that looks for target between -100 and -199  and react accordingly 

Westa

 

 

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0InterModuleCommunication help, please ...InterModuleCommunication help, please ...


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out