DataView to Dataview

  • Thread starter Thread starter Bernie
  • Start date Start date
B

Bernie

Hi all
I am trying to get a connection between two dataview
parts, supplied from a web service.

If they are both in list view I can use the 'connections'
wizard in FP and everything works fine. Thing is when
there are over 200 items to select from this takes quite a
chunk of the page, so I would like to use a dropdown!

Can any body out there explain to me (In really easy/Idiot
proof terms) how I could go about this?

I know this has already been brought up in one group, but
not being too 'seasoned' on this topic, I didn't really
understand.

Bernie
 
Hi Bernie,

I am in the process of writing a HOW TO article for this, but here is the
text of the article:

Insert two Data Views of your data.

Select one of the Data Views, choose Style from the Data View Details
taskpane.

Choose the drop-down box style from the list of styles, click OK.

Right click this Data View, choose Web Part connections.

Connect to the other Data View as you would normally.

Go into Code View.

Look for the 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">
<!-- 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>
<!--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>


Look for the code for the <option> tag. It should be right above the <a>
tag.

Paste in the blob you copied above.

And then change the name="href" 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>



Look for the <select> tag for the drop down. It should look something like:

<select name="ID" size="1">

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
Micosoft Office FrontPage
This posting is provided "AS IS" with no warranties, and confers no rights.
Any code examples are for example only and will not be supported by Product
Support or Microsoft in general.
 
"Now when you change the value your drop-down, your
connection should fire"

Hi John

No shoulds about it, this is a total worker, and in nice
easy peasy terms for a 'Green' FP user like myself.

Many Many Thanks, This is GREAT :-)

Bernie
-----Original Message-----
Hi Bernie,

I am in the process of writing a HOW TO article for this, but here is the
text of the article:

Insert two Data Views of your data.

Select one of the Data Views, choose Style from the Data View Details
taskpane.

Choose the drop-down box style from the list of styles, click OK.

Right click this Data View, choose Web Part connections.

Connect to the other Data View as you would normally.

Go into Code View.

Look for the 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">
<!-- 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

482c-a0ca-e49b56eae72d
*',$fields),string($cursel))"></xsl:value-
of> said:
<!--end copying here-->
<xsl:attribute name="style"><xsl:if test="$CurrentRowKey =
$dvt_curselkey">font-weight:
bold; said:
<xsl:value-of select="@Title"/>

</a>


Look for the code for the <option> tag. It should be
right above the said:
tag.

Paste in the blob you copied above.

And then change the name="href" 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

482c-a0ca-e49b56eae72d
*',$fields),string($cursel))"></xsl:value-
of> said:
<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

482c-a0ca-e49b56eae72d
*',$fields),string($cursel))"></xsl:value-
 
Thanks for the feedback and for being a guinnea pig for the article.

Hopefully it will be published soon, as I have seen this question quite a
few times from different people.
 
Totally cool and very cool at the same time, thanks John! It took me about
thirty minutes to find those tags but I think I got a good method for
locating!
Thanks again!

Derek
 
Back
Top