Solved

Two-way web part communication

Posted on 2013-01-11
3
598 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 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