CodeVerge.Net Beta
Login Idy
Register Password
  Forgot?
Explore    Item Entry    Members   
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML





Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.dotnetnuke.custom_modules Tags:
Item Type: NewsGroup Date Entered: 11/4/2004 5:40:23 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 0 Views: 3 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
6 Items, 1 Pages 1 |< << Go >> >|
jbcage
Asp.Net User
Cross module communication11/4/2004 5:40:23 PM

0/0

My question is how do I access the currently loaded object for a module? I want an onclick event in one module to call a public method in a 2nd module. In the 2nd module, the method modifies the value of a global variable (and does some other stuff).

My problem is that I can't access the currently loaded 2nd module object. I don't know how to get to it. I can create a new instance of it with something like MyModule mod = new MyModule(); but that doesn't help b/c I can't change to global variables of the module already loaded on the page.

I imagine there are some native DNN methods to access the current module objects loaded on a page (as an arraylist or vector or something) but I don't know what those methods are. Could someone provide me with a brief code example?
cathal
Asp.Net User
Re: Cross module communication11/4/2004 8:34:36 PM

0/0

You want to take a look at IMC (inter module communication). There some notes & an example @ http://www.kodhedz.com/Default.aspx?tabid=38

Cathal
jbcage
Asp.Net User
Re: Cross module communication11/5/2004 3:58:52 PM

0/0

Awesome! That's just what I was looking for. I'm trying it now and hopefully I'll get it working. Basically what I have is a skin object that needs to talk to some custom modules on the page. Thanks!
jbcage
Asp.Net User
Re: Cross module communication11/5/2004 10:55:25 PM

0/0

I've gotten it partially working however raising the ModuleCommunication event seems to wipe out postback info so I get NullReferenceExceptions when the page reloads after the click (Object reference not set to instance of object). Specifically, I seem to be losing the module data.

When I click the icon once to fire the modulecommunication event, the page reloads with the skin and container but the module contents are lost and I see the error message above the module title. If I click the button a second time, the skin and contain disappear too and I only see the error message on a blank page.

The error message is this:

DotNetNuke.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at PDFExporter.PDFExport.cmdGenerate_Click(Object sender, ImageClickEventArgs e) in c:\localhost\desktopmodules\pdfexporter\pdfexport.ascx.cs:line 197 at System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) at System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain() --- End of inner exception stack trace ---


My code is C# and the general setup for the Communicator class is this setup like this (I inherit SkinObject and implement the IModuleCommunicator interface):

public class PDFExport : DotNetNuke.SkinObject, DotNetNuke.IModuleCommunicator
{
//My button
protected System.Web.UI.WebControls.ImageButton pdfImage;

//Implement the interface event
public event ModuleCommunicationEventHandler ModuleCommunication;

//bunch of methods and stuff

//button click handler
private void cmdGenerate_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
ModuleCommunicationEventArgs modEventArgs = new ModuleCommunicationEventArgs();
ModuleCommunication(this, modEventArgs);
}
}


The error that always gets thrown complains about the line line shown: ModuleCommunication(this, modEventArgs). Does anyone have some experience with this so they can shed some light on my problem.
jbcage
Asp.Net User
Re: Cross module communication11/8/2004 8:01:55 PM

0/0

Keeping thread alive... anyone know what info is being lost?
xpdit
Asp.Net User
Re: Cross module communication11/9/2004 8:38:05 AM

0/0

ok
this is the deal., in the article previously referenced in this thread, it is at kodhedz.net , i mentioned that the actual module is lost, the data is only presisted as a new event that is raised onmodulecommunication. unless you have your receiving module access it immediately on the postback when that event is raised, the data is lost in cyber space. I have used imc in several projects and it works perfectly for many things. however, it will not maintain its state as it is in essence just a raised event that happens somewhere between pageinit and page render.
Intuition without concept is blind; Concept without intuition is empty -- I. Kant : Critique of Pure Reason

In the olden days, books were burned. Now the website is shut down.

KodHedZ Software Development
6 Items, 1 Pages 1 |< << Go >> >|



Search This Site:


Meet Our Sponsors:



Other Resources:

ng.asp-net-forum.asp-net_futures - Web Programming Newsgroups cross-platform plug-in for delivering the next generation. April 2007 - Posts - Sam Gentile If (DeveloperTask==Communication ...
Cross-Cultural Communication In this module, cross-cultural communication will be outlined and demonstrated ... world, and how it impacts our verbal and non-verbal communications with others. ...
Communicate to Make a Difference Each module should take about 1.5 hours to complete thoroughly. ... Read what learners have written about "Practicing Cross-Cultural Communication" ...
Cross Cultural Communication - School of Education Communication and ... Ma Cross Cultural Communications and Media Studies ... CCC8086 Language & Cross-Cultural Communication. Module leader: Peter Sercombe ...
www.olce.org/pdfs/BIL PDFs/Cross Cultural - ESL Module.pdf ... THE CROSS-CULTURAL COMMUNICATION MODULE. The following are the goals for this module on cross-cultural ... C. Language Use and Cross-Cultural Communications ...
Adtran Opti-6100 Cross-Connect Mux. High Capacity Fan... - NexTag.com Compare prices for Adtran Opti-6100 Cross-Connect Mux. High Capacity Fan Module [1184537l1]. at NexTag. Prices starting from $1,037.99
Cross Cultural Communication - School of Education Communication and ... Core module: CCC8086 Language and cross-cultural communication - Semester 1 ... CCC8086 Language & Cross-Cultural Communication. Module leader: Peter Sercombe ...
Francis K. Cheung : Decoupled Communication with Prism (Shared Services) One common method of cross module communication is through shared services. ... The Position module consumes these services by leveraging the shell ...
Modules Listing IF1101E Information Revolution and Society Modular ... ... module open to. all first year students. IF2101 Media Communications ... on developing skills in the communication business, ... from a cross-cultural ...


 
All Times Are GMT