Re: web part connections
From: John Jansen \(MSFT\) (johnjan_at_online.microsoft.com)
Date: 03/22/04
- Next message: Jason: "MSNBC Weather Webpart"
- Previous message: Ram Yadav: "Re: Add Field Type Artical on MSDN is gone???"
- In reply to: Mike Walsh [MVP]: "Re: web part connections"
- Next in thread: Jeff: "Re: web part connections"
- Reply: Jeff: "Re: web part connections"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 22 Mar 2004 13:36:56 -0800
For the List View Web Part, you are correct: the radio buttons are what they
are.
However, if you change to using a Data View Web Part using FrontPage 2003,
then you have the ability to use any view style and fire connections. One
of the view styles is a dropdown list, so you could do it pretty easily.
There is a bit of trick with using the dropdown style, though, because the
connections wizard does not know how to create an onchange event.
If you want to pursue that, here are the steps:
1. Insert two Data Views of your data.
2. Select one of the Data Views, choose Style from the Data View Details
taskpane.
3. Choose the drop-down box style from the list of styles, click OK.
4. Right click this Data View, choose Web Part connections.
5. Connect to the other Data View as you would normally.
6. Go into Code View.
7. Look for the <a target="_self"> code that looks similar to this (usually,
it would be the first <a> tag in the page) and copy the entire block for the
first XSL:ATTRIBUTE (see below):
<a target="_self">
<!-- NOTE: start copying here -->
<xsl:attribute xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
name="href"><xsl:variable name="cursel">dvt_curselkey={<xsl:value-of
select="$CurrentRowKey"/>}</xsl:variable><xsl:variable
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
name="fields">@ID=<xsl:value-of
select="ddwrt:ConnEncode(string(@ID))"/></xsl:variable>javascript:<xsl:value
-of
select="ddwrt:GenFireConnection(concat('99d2bb39-f973-482c-a0ca-e49b56eae72d
*',$fields),string($cursel))"></xsl:value-of></xsl:attribute>
<!-- NOTE: end copying here-->
<xsl:attribute name="style"><xsl:if test="$CurrentRowKey =
$dvt_curselkey">font-weight: bold;</xsl:if></xsl:attribute>
<xsl:value-of select="@Title"/>
</a>
8. Look for the code for the <option> tag. It should be right above the <a>
tag.
9. Paste in the section of code you copied above.
10. Change the name="href" part to name="value". At this point, you should
have something like this:
<option style="display:{$GroupStyle}">
<xsl:attribute xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
name="value"><xsl:variable name="cursel">dvt_curselkey={<xsl:value-of
select="$CurrentRowKey"/>}</xsl:variable><xsl:variable
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
name="fields">@ID=<xsl:value-of
select="ddwrt:ConnEncode(string(@ID))"/></xsl:variable>javascript:<xsl:value
-of
select="ddwrt:GenFireConnection(concat('99d2bb39-f973-482c-a0ca-e49b56eae72d
*',$fields),string($cursel))"></xsl:value-of></xsl:attribute>
<a target="_self">
<xsl:attribute xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
name="href"><xsl:variable name="cursel">dvt_curselkey={<xsl:value-of
select="$CurrentRowKey"/>}</xsl:variable><xsl:variable
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
name="fields">@ID=<xsl:value-of
select="ddwrt:ConnEncode(string(@ID))"/></xsl:variable>javascript:<xsl:value
-of
select="ddwrt:GenFireConnection(concat('99d2bb39-f973-482c-a0ca-e49b56eae72d
*',$fields),string($cursel))"></xsl:value-of></xsl:attribute>
<xsl:attribute name="style"><xsl:if test="$CurrentRowKey =
$dvt_curselkey">font-weight: bold;</xsl:if></xsl:attribute>
<xsl:value-of select="@Title"/>
</a>
</option>
11. Look for the <select> tag for the drop down. It should look something
like:
<select name="ID" size="1">
12. Add an onchange event handler for the tag, as follows:
<select name="ID" size="1" onchange="eval(this.options.value)">
Now when you change the value your drop-down, your connection should fire.
-- Thanks! John Jansen Microsoft Office FrontPage This posting is provided "AS IS" with no warranties, and confers no rights. "Mike Walsh [MVP]" <englantilainen@mvps.org> wrote in message news:O9NnRSAEEHA.3716@TK2MSFTNGP10.phx.gbl... > The standard web part connections as provided with the product gives you - > as you have found - radio buttons. > > I tend to tell end-users in situations like this that that is the way it > works and be done with it. > > But I suppose there *might* be a clever programming way round this which > someone else may be able to supply. I would however still tell first try > telling the user you have been told that this (radio-buttons) is the way it > works. [It's not a lie after all.] > > Mike Walsh, Helsinki, Finland > WSS FAQ at wss.collutions.com > Please reply to the newsgroup > "Jeff" <anonymous@discussions.microsoft.com> wrote in message > news:117c301c40ffd$2aa38ac0$a101280a@phx.gbl... > > Hi, > > I've created three new lists in WSS site, all imported > > from Excel spreadsheet. I've successfully created webpart > > connection between two, so that, for example, the > > companies field can filter all related products. When I > > create the connection, I get the radio buttons to the left > > of each choice instead - ie., when radio button is > > checked, the product list is shown with the filtered view > > on product. The customer has suggested it would be nice to > > have a drop down list to choose from instead, ie., all > > companies are selectable from dropdown and will display > > associated technologies (and possibly some other fields) > > when chosen. Is this something that can be done with > > the form webpart, any pointers, or references? > > Thanks, Jeff > >
- Next message: Jason: "MSNBC Weather Webpart"
- Previous message: Ram Yadav: "Re: Add Field Type Artical on MSDN is gone???"
- In reply to: Mike Walsh [MVP]: "Re: web part connections"
- Next in thread: Jeff: "Re: web part connections"
- Reply: Jeff: "Re: web part connections"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|