Ask a questionAsk a question
 

AnswerHow to wire a connection between 2 web parts

  • Wednesday, November 04, 2009 1:10 PMSPA-TMF Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,

    I have 2 web parts on a page.  One web part displays Invoices filetered by user and the other web part (Line Items) displays a list of invoices for the invoice selected in the Invoices list.  See image below:



    My question is:
    Can someone point me in the direction (via link or suggestion) as to how I can wire the Invoice Number in the first list to be a link that when clicked will display the associated Line Items in the list below.

    Current Status:
    I have setup the relationship between the two web parts such that the Line Items web part is looking for the Invoice number from the Invoice list above.  I just need to figure out how to wire the Invoice number to initiate an OnClick event to send that value to the Line Items List.


    Thank you for your help.

    Sincerely,
    Tim

Answers

All Replies

  • Wednesday, November 04, 2009 3:52 PMSigis Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Is there a requirement that second list mus be shown as Data Sheet View? If not, then simple web part connection (http://office.microsoft.com/en-us/sharepointserver/HA100241051033.aspx) could be a solution for you. If second list must be in Data View, then it looks like  there is no simple solutions (or at least it is not known for me ;).
    Why are you looking at me?
    http://www.sharepointdrive.com
  • Wednesday, November 04, 2009 7:28 PMSPA-TMF Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Sigis,

    I was able to create the view as you indicated however once of things missing in this setup is the ability to sum the columns with numberic values inside of them.  So I then try to modify the web part however I only have the ability to access the XSL for the web part.

    Do you know if there is a way to modify the XSl to sum specified columns?  I'm not an XSL guy but need to provide this type of view.

    Thank you for any help you can provide.

    Sincerely,
    Tim
  • Wednesday, November 04, 2009 8:27 PMSigis Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Well, again not direct answer ;) - standard list views have Totals section where you can select columns to calculate count or sum of their values.

    If you need some xsl, here is example (you just need to place in some right place):

    <tr>
    <td class="ms-vb">Total : <xsl:value-of select="sum(/dsQueryResponse/Rows/Row/@Price)" /></td>
    </tr>


    Do not press -> http://www.sharepointdrive.com
  • Thursday, November 05, 2009 9:46 AMAvinashKT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi Tim,

    You can refer this link... to pass data between two web parts-
    http://avinashkt.blogspot.com/2007/06/communication-between-web-parts.html
    Regards, Avinash | avinashkt.blogspot.com
  • Tuesday, November 10, 2009 11:24 AMGuYumingMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Could you please kindly share with us how do you setup the relationship between the two web parts?