- Begin PreInit
- End PreInit
- Begin Init
- End Init
- Begin InitComplete
- End InitComplete
- Begin LoadState
- Provider: CreateChildControls
- End LoadState
- Begin ProcessPostData
- Consumer: CreateChildControls
- End ProcessPostData
- Begin PreLoad
- End PreLoad
- Begin Load
- Provider: OnLoad
- Consumer: OnLoad
- End Load
- Begin ProcessPostDataSecondTry
- End ProcessPostDataSecondTry
- Begin Raise ChangedEvents
- End Raise ChangedEvents
- Begin Raise PostBackEvent
- Provider: Button Click Event Method is called
- End Raise PostBackEvent
- Begin LoadComplete
- Provider: Connection Provider Method is called
- Consumer: Connection Consumer Method is called
- End LoadComplete
- Begin PreRender
- Provider: OnPreRender
- Consumer: OnPreRender
- End PreRender
- Begin PreRenderComplete
- End PreRenderComplete
- Provider: SaveViewState
- Consumer: SaveViewState
- Begin SaveState
- Provider: SaveViewState
- Consumer: SaveViewState
- End SaveState
- Begin SaveStateComplete
- End SaveStateComplete
- Begin Render
- Provider: RenderControl
- Provider: Render
- Provider: RenderBeginTag
- Provider: RenderContents
- Provider: RenderEndTag
- Consumer: RenderControl
- Consumer: Render
- Consumer: RenderBeginTag
- Consumer: RenderContents
- Consumer: RenderEndTag
Showing posts with label provider. Show all posts
Showing posts with label provider. Show all posts
Thursday, January 31, 2008
Connected Webparts Lifecycle in detail
The list below shows you what is going on while your connected Webparts get "alive":
Wednesday, January 16, 2008
Webpart beeing Provider and Consumer at the same time
This is basically a easy task to do, but the first time I really had to create such a webpart I made a tiny mistake during the implementation of the Provider/Consumer Interfaces and I ran into one of this terrible SharePoint errors.
The Problem:
I created a Webpart (based on System.Web.UI.WebControls.WebParts.WebPart) ...no problem
I added the bits needed to Consume from another WebPart (I have to say that I was using a own defined Interface, pretty simple one) ...no problem
I implemented another own defined Interface to act as a Provider WebPart for other webparts too... no problem
Building Solution, deploying it, adding the Webparts to a page ...no problem
Connecting my Webpart to a Provier Webpart ...no problem
Now, connecting a consumer to my Webpart... BIG PROBLEM!
The message I got trying to connect the a consumer webpart to my webpart was pretty strange: "There is a problem with one ore more connections, please check one of the webparts for more details" -> but there was no information to find -> thanks SharePoint...
anyway, I tried a hell of things till I found out what was actually the problem.
The Solution:
It is quit easy - To act as a Provider and Consumer Webpart at the same type, in the Consumer- as well as in the Provider-Implementation, the ConnectionProviderAttribute ID must be defined. I usually just defined the DisplayName by taking the first overload of ConnectionProvider. But in case of having multiple ways of communication, the provider and consumer attributes muts be uniquely signed.
Does not work:
[ConnectionProvider("A parameter value")]
public IMyProvider GetMyProvider()
{
return this;
}
Works:
[ConnectionProvider("A parameter value","ParamValue1")]
public IMyProvider GetMyProvider()
{
return this;
}
In the example above, the Provider Implementation gets a unique ID called "ParamValue1". However, note that the consuming Webpart must use the same ID-value to establish the connection. Otherwise, it will not work.
The Problem:
I created a Webpart (based on System.Web.UI.WebControls.WebParts.WebPart) ...no problem
I added the bits needed to Consume from another WebPart (I have to say that I was using a own defined Interface, pretty simple one) ...no problem
I implemented another own defined Interface to act as a Provider WebPart for other webparts too... no problem
Building Solution, deploying it, adding the Webparts to a page ...no problem
Connecting my Webpart to a Provier Webpart ...no problem
Now, connecting a consumer to my Webpart... BIG PROBLEM!
The message I got trying to connect the a consumer webpart to my webpart was pretty strange: "There is a problem with one ore more connections, please check one of the webparts for more details" -> but there was no information to find -> thanks SharePoint...
anyway, I tried a hell of things till I found out what was actually the problem.
The Solution:
It is quit easy - To act as a Provider and Consumer Webpart at the same type, in the Consumer- as well as in the Provider-Implementation, the ConnectionProviderAttribute ID must be defined. I usually just defined the DisplayName by taking the first overload of ConnectionProvider. But in case of having multiple ways of communication, the provider and consumer attributes muts be uniquely signed.
Does not work:
[ConnectionProvider("A parameter value")]
public IMyProvider GetMyProvider()
{
return this;
}
Works:
[ConnectionProvider("A parameter value","ParamValue1")]
public IMyProvider GetMyProvider()
{
return this;
}
In the example above, the Provider Implementation gets a unique ID called "ParamValue1". However, note that the consuming Webpart must use the same ID-value to establish the connection. Otherwise, it will not work.
Labels:
attribute,
connectionprovider,
consumer,
id,
provider,
sharepoint,
webpart,
wss
Subscribe to:
Posts (Atom)
