?
Solved

Two-way web part communication

Posted on 2013-01-11
3
Medium Priority
?
625 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 1000 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 1000 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

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

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

I used to be SharePoint evangelist in our company, so my Outlook always full of questions about how to do this, or where I can find that. One day I found such an email with the following question: "how to attach 3-State workflow (one of the workflow…
In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

765 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