|
|
Passing parameters to web parts
Last post 12-07-2005, 5:43 PM by ecroot. 10 replies.
-
12-07-2005, 5:43 PM |
-
ecroot
-
-
-
Joined on 12-07-2005
-
-
Posts 10
-
-
|
Passing parameters to web parts
Can someone point me to information about passing parameters to web parts? I would like to pass parameters to a web part, such as a list, so that it will dynamically set the filter for that web part, assuming I have already built the view (filter) for that web part in SharePoint (using the builder UI). I would like to set the filters for one or MORE web parts on a web page or site, based on a value set by the user. For instance, the user may only want data for a particular facility. I set up a radio button to allow the user to pick one of a set of facility names, and that action sets the parameter and then passes it to the other web parts to set the filters for all other web parts to that facility parameter. I have not used the custom SQL web part, but soon will try it out. Again, I would want to do the same thing, run a SQL statement and set parameters to pass on to other web parts. Note that I am familiar with the intrinsic ways of connecting one or more web parts using the built in builder UI for SP, by passing the row to the other web part and then setting the key value. Thanks, Eric
|
|
-
12-13-2005, 4:58 PM |
-
12-13-2005, 8:27 PM |
-
ecroot
-
-
-
Joined on 12-07-2005
-
-
Posts 10
-
-
|
Passing parameters to web parts
Thanks. Nice reference. Will read. Quickly perused it. I am a developer in CF and OOP-based VFP. I am new to SP development. Seems VERY messy to work in. Am I missing something? What is your background? Are you a SP developer? How would I go about getting my feet wet with developer training in SP, basics? Here is what I want to do, short and sweet. I want a set of users to come into a common SP site. Either on one page or more, I would like them to log in. Based on their log in, I will be able to determine their physical location or group that I would use to control filtering for their data. Once logged in, I would pass a parameter to each SP web part on the page to set a filter for their data, so only their data is shown and they can only edit or add to their data set. However, I could have a view, as administrator, that would allow me to look at all groups of data. This is standard stuff in any SQL database application, sending a SQL statement with a filter condition or for any load event of a screen or data view. Just pass a parameter, have the SQL code grab the parameter to set the filter, and off you go. But SP web parts seem to be a black box. Tried to view the code in FP2003 for web parts and I could make out some aspects of control, but not much. Pretty much lost. Any help MUCH appreciated. My dream would be to find a workshop or two-day class that would allow me to ask standard developer questions about how SP handles standard development tasks, using other platforms as a reference. Eric
|
|
-
12-13-2005, 8:28 PM |
-
ecroot
-
-
-
Joined on 12-07-2005
-
-
Posts 10
-
-
|
Passing parameters to web parts
Oh, sorry. Forgot to respond to your main question. I am looking to pass a parameter to an out-of-the-box webpart that has been customized either through FP2003 or the standard SP UI interface. Eric
|
|
-
12-15-2005, 7:27 AM |
-
michaellotter
-
-
-
Joined on 06-25-2003
-
-
Posts 665
-
-
|
Passing parameters to web parts
Hi Eric, SharePoint development is a very different environment for development because you are building web parts to be placed onto portal pages that show information from other systems. SharePoint product is still very new and is still growing and because of this there is not a lot of standards on how to do things and this is why everything seems to be all over the place. My background I would say would be jack of all trades (vb.net, c#, infopath, k2.net, ...) but a master of SharePoint. I do a lot of design, development and deployment for small to enterprise business and governments. Most of my knowledge on SharePoint came from hands on experience and help other people in newsgroups. If I was going to do training with a company I would look into MindSharp or SharePointSolutions. What you are looking to do can definitely be done and there might be a couple of different ways of doing it to. How familiar are you with IIS and .NET, UserControls? Cheers Michael Lotter michaell@onsphere.com www.onsphere.com
|
|
-
12-15-2005, 12:04 PM |
-
ecroot
-
-
-
Joined on 12-07-2005
-
-
Posts 10
-
-
|
Passing parameters to web parts
A master... wish you were here in the Seattle area. Where are you located? So in almost every other coding language, you can pass parameters as easily as a statement in the front accepting the parameter and another one setting a variable to one or more parameters. The the code does whatever it wants with that variable. On the outside of that code block, a simple statement is used to pass the parameter or store it for retrieval by the receiving code, even something as crude as sending a parameter in a URL. Is there something simple like that in SP for web parts? Is there a property that can receive the parameter and another that can contribute the property? It seems like there should be, since the out-of-the-box web parts can be connected using the UI to send a row value (database id field for a data record) to one or more other web parts. If the above could be done simply by code, rather than the UI, then I would be set. I wish there was a book or web site that layed out the platform, structure, object methods, properties, and events for SP. So far, I am not sure that exists. I hack into the code of existing web parts and it looks horrendous from a code organization, object perspective. It looks like a maintenance nightmare. Am I missing something? Again, any help appreciated. Eric Root
|
|
-
12-15-2005, 1:39 PM |
-
michaellotter
-
-
-
Joined on 06-25-2003
-
-
Posts 665
-
-
|
Passing parameters to web parts
Hi Eric, When I say "master" I mean thats my highest level of expertise and I personally know there are other people out there that are a lot better but I think I can hold my own. I am currently located in Raleigh, NC but I am always traveling to client sites. Currently I am home for the holidays and working on a WSS\C#\MS SQL application. Before that I did a large SharePoint project for a major Florida city. There are several good books that could help out. Take a look at "SharePoint Builiding Office 2003 Solutions" and "Advanced SharePoint Services Solutions". The below link should shed some light on Web Parts http://msdn.microsoft.com/library/en-us/spptsdk/html/SPPTWPFWPPInf_SV01072936.asp?frame=true
The below link has some good information on concepts and architecture. http://msdn.microsoft.com/library/en-us/spptsdk/html/SPPTWSSConcepts_SV01072207.asp?frame=true
The big thing about SharePoint that a lot of people don't understand is that there are two different levels. Windows SharePoint Service and Office SharePoint Portal.
When major integration with other systems needs to be done with SharePoint I usually recommend it be done on 3 different levels. Web Parts (Smart Part) as presentation (starting and ending point), Web Services or COM+ (business layer) and MS SQL (Store Procedures, Views, Functions, ....).
If you use UserControls check out Smart Part because this something that is very handy.
You also see more value from SharePoint when you use InfoPath and a workflow application. The workflow application makes SharePoint a lot more user friendly for your end users. Hope this helps and if you want to email me fill free to.
Cheers
Michael Lotter michaell@onsphere.com www.onsphere.com Michael Lotter michaell@onsphere.com www.onsphere.com
|
|
-
12-26-2005, 12:58 PM |
-
BobMixon
-
-
-
Joined on 11-07-2004
-
-
Posts 851
-
-
|
Passing parameters to web parts
Hi Michael and Eric, Great conversation thread, hope you don't mind my chiming in here. Eric, to answer your fundamental question, there is a defined communications mechanism for communicating between Web Parts. The environment is different than that of others because each Web Part is considered a black-box, self contained unit. First and foremost, take a look at the article I posted today regarding passing parameters to a Web Part for filter the results: http://bobmixon.xwiki.com/xwiki/bin/view/Main/AdvancedListFiltering-UsingInputParameters The only code you would have to write would be a single Web Part that obtains the currently logged in user context, sets up the appropriate filter parameter packet you wish, then passes it along to other Web Parts using standard Web Part connections.
If This Post Was Helpful, Please Rate It!
Bob Mixon KM, BPM, Portals and Intranets (also my Blog)
Bob Mixon http://www.BobMixon.com Microsoft SharePoint MVP
|
|
-
12-26-2005, 1:00 PM |
-
BobMixon
-
-
-
Joined on 11-07-2004
-
-
Posts 851
-
-
|
Passing parameters to web parts
Eric, One other note, I have personally worked with Michael and he is an outstanding resource. I have had him working on a project of mine for some time and he always comes through with quality work! 
If This Post Was Helpful, Please Rate It!
Bob Mixon KM, BPM, Portals and Intranets (also my Blog)
Bob Mixon http://www.BobMixon.com Microsoft SharePoint MVP
|
|
-
12-29-2005, 4:09 PM |
-
ecroot
-
-
-
Joined on 12-07-2005
-
-
Posts 10
-
-
|
Passing parameters to web parts
Michael, Thanks for the information. I will research all. I see that Bob Mixon has joined us in this thread. Super. I will email you directly, since you have given me permission. One note to anyone else that reads this thread. I talked with a company called WorkPlaceArchitects.com about some tools that they have put together for SP, including "persistent selector" web parts that provide a UI to set up what I call persistent filters. It appears that one of their tools will allow multiple filters and that they can operate over multiple lists, pages, and sites. So theoretically, this would certainly solve my issues (person logs on and they can see and manipulate cross-site information that is filtered ONLY for their location/operation). But, it has a cost! $18,000 for the tools (one server license) and initial training, and $3,600 each year thereafter for one server license. According to Bob Mixon, I was lucky as a newbie to connect with you. Thanks. And yes, so far, a web object IS a black box to me. When I asked specifically how SP uses MS SQL server compared to a "normal" database/database application, they basically said you don't want to go there! A monster. I have other specific questions based on what you presented here, but I will do that in email unless you prefer that post it here. Eric Root ecroot@earthlink.net
|
|
-
12-29-2005, 4:25 PM |
-
ecroot
-
-
-
Joined on 12-07-2005
-
-
Posts 10
-
-
|
Passing parameters to web parts
Bbb, Thanks. This looks just like what I want. Will have to play with it soon. If I can filter ONE web part (list) with the parent, can I do this with OTHER/MULTIPLE web parts (lists) also, if they are on the same page or pages within the same site? I know I can do web part connections that way, sending a row source to multiple other lists. If you would like to keep in the loop with Michael on my email responses to him as I go down this exploration, feel free to email me and I will copy you. This all looks familar to me, since I am familiar with MS SQL Enterprise Manager's filter query builder. I was hoping something like this existed, but I couldn't figure out how to access it in the SP UI since much of the options are contextual. Eric Root ecroot@earthlink.net
|
|
|
|
|