Solved

Two-way web part communication

Posted on 2013-01-11
3
575 Views
Last Modified: 2013-01-14
I am new to SharePoint and ASP.NET development. I am looking to develop a page that has a "filters" web part and multiple "report" web parts. The idea is that the same "report" web part can be used for multiple reports. Each report has a set of filters. I am looking for a way to connect one "filters" web part to multiple "report" web parts and have communication in both directions between the two. I am trying to have the "filters" web part get all the filters from all the "report" web parts it is associated with. Then as a user changes the filter settings in the "filters" web part, I want to notify all "report" web parts that the filter settings have changed. I started down the path of web part connections, but it appears that a web part cannot be a provider and a consumer of the same web part, or in other words, only supports one way communcation. The other road block is that a consumer can only have one provider so I cannot get the "filters" web part to get filters from multiple "report" web parts. Any guidance will be greatly appreciated!
0
Comment
Question by:ZaDrizzle
3 Comments
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 250 total points
ID: 38773318
Hi,
at least for the multiple providers - this should be possible by setting
"AllowMultipleConnections = true" in the ConnectionConsumer properties
e.g.
public class SampleConnectionConsumer : WebPart {

protected ISampleProvider SampleProvider;

[ConnectionConsumer("Sample for EE", AllowMultipleConnections = true)]
public void SampleProviderConnectionPoint(ISampleProvider provider) {
SampleProvider = provider;
}
...
}

Open in new window


I would have to test something about the two-way connection. Will be back soon.

HTH
Rainer
0
 
LVL 14

Assisted Solution

by:KoenVosters
KoenVosters earned 250 total points
ID: 38773562
I would not use a two-way connection, or try to code a two-way connection.

I would use the one provider - multiple subscribers filter. Then on the filter webparts, the action would actually trigger a refresh and put the filter in the querystring. The provider webpart is then able to change it's value based on the querystring, which then pushes it back to all the subscribers.

So instead of two-way it would be

provider -> subscriber
subscriber -> querystring -> provider
0
 

Author Comment

by:ZaDrizzle
ID: 38774616
Thank you both for the feedback!

KoenVosters,

To clarify, you are saying that the report web part would be the provider and the filters web part would be the subscriber? Then when filter settings are changed in the filters web part, perform a refresh and use the querystring to pass the new settings to the report web parts?
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

There is one common problem that all we SharePoint developers share: custom solution deployment. This topic can't be covered fully in this short article, so all I want to do in this one is to review it from a development-to-operations perspectiv…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now