Solved

Two-way web part communication

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

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…
The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

695 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