A web part that is a consumer and provider at the same time.  
Author Message
RayCan





PostPosted: SharePoint - Development and Programming, A web part that is a consumer and provider at the same time. Top

I have already implemented a provider and consumer ASP.NET web parts and using them in sharepoint. Now I have to send some information from my consumer web part to another consumer web part. Is it possible If not can I handle it using ViewState

Thanks



SharePoint Products and Technologies2  
 
 
Andy Burns





PostPosted: SharePoint - Development and Programming, A web part that is a consumer and provider at the same time. Top

Yes, that's possible, though I must confess I've not tried it yet. There are standard web parts in WSS3 that are both. You'll have to make sure that your consumer that is providing info is also a provider.

A good article that also shows creating web parts (and transformers)

http://www.carlosag.net/Articles/WebParts/webPartsTransformers.aspx

I don't see that there is a reason why you couldn't have a class that implements an IFoo interface (and so is an IFoo provider) and had an IBar consumer.

Also, this link discusses that question near the end:

http://www.theserverside.net/tt/articles/showarticle.tss id=WebParts2


 
 
RayCan





PostPosted: SharePoint - Development and Programming, A web part that is a consumer and provider at the same time. Top

Hello Andy,

Thanks for the reply. I am using the ASP.NET web part framewok to create my web part for sharepoint and therefore I am using my own custom Interface for two web parts. When I implement another provider interface in my *consumer*, it gives me an error that there is a problem in connection. I cannot use ICellProvider or ICellConsumer.

Thanks


 
 
Andy Burns





PostPosted: SharePoint - Development and Programming, A web part that is a consumer and provider at the same time. Top

What's the error you get
 
 
RayCan





PostPosted: SharePoint - Development and Programming, A web part that is a consumer and provider at the same time. Top

In my consumer when I implement another interface and deploy the web part to the GAC. Connection item of the context menu gets disabled and it says there is an error with one of the web parts in this page and does not let me make the connection dynamically (through web browser interface)

Thanks for your help


 
 
RayCan





PostPosted: SharePoint - Development and Programming, A web part that is a consumer and provider at the same time. Top

Here is the exact error that web part shows in the tooltip of the context menu , when I try to make the connection via web browser interface:

"Web part connections cannot be created or modified at this time.One or more web parts on this page contains more information about the problem."


 
 
ToddFriedlich





PostPosted: SharePoint - Development and Programming, A web part that is a consumer and provider at the same time. Top

Help!! I am having the same problem. Anyone have any ideas

 
 
RayCan





PostPosted: SharePoint - Development and Programming, A web part that is a consumer and provider at the same time. Top

I gave it up. Everyone says it is doable as long as the consumer and provider interfaces are different but in practise it does not work. I'd appreicate if you could let me know if you find a solution.

Are you using asp.net web part framework or WSS

Thanks


 
 
ToddFriedlich





PostPosted: SharePoint - Development and Programming, A web part that is a consumer and provider at the same time. Top

I'm using WSS. With the help of a coworker, we seem to have solved this.
Rather than decorating the Consumer method with

[ConnectionConsumer("OfficeTrackSelector")]

we used

[ConnectionConsumer("OfficeTrackSelector","otc")]

It seems that the second parameter is an ID for the consumer, without it, the consumer seems to use a default, which causes conflicts if there are multiples. Not 100% sure, but it works, so I guess I'll deal with it.

Hope this works for you..
todd

 
 
RayCan





PostPosted: SharePoint - Development and Programming, A web part that is a consumer and provider at the same time. Top

That worked for me two. Thanks a lot man