Solved

Two-way web part communication

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

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…
We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

733 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