Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

DataView (w/subview) connection question

  Asked By: Karen    Date: Sep 15    Category: Sharepoint    Views: 1603

I'm using a DataView web part, and have what are hopefully easy
questions...

I want to display Compounds and the child Protocols in
one "selector" web part, and when the user clicks on a protocol, the
other web part should show the proper graph.

I've made several attempts, but I can't figure out how to:
1) Make the ProtocolName show up in the web part connection options
(only CompoundName does)
2) Make the ProtocolName clickable for the connection (only
CompoundName is a choice)

Here are the guts of my simple XML data source files:

<ProtocolSelector xmlns="https://hostname/sites/sitename/Shared%
20Documents/ProtocolSelector.xsd">
<Compound CompoundName="Compound1">
<Protocol ProtocolName="Protocol1" />
<Protocol ProtocolName="Protocol2" />
</Compound>
<Compound CompoundName="Compound2">
<Protocol ProtocolName="Protocol3" />
</Compound>
</ProtocolSelector>

<ProtocolSummary xmlns="https://hostname/sites/sitename/Shared%
20Documents/ProtocolSummary.xsd">
<Protocol ProtocolName="Protocol1" ProtocolGraph="../Shared%
20Documents/Graphs/Protocol1Graph.gif" />
<Protocol ProtocolName="Protocol2" ProtocolGraph="../Shared%
20Documents/Graphs/Protocol2Graph.gif" />
<Protocol ProtocolName="Protocol3" ProtocolGraph="../Shared%
20Documents/Graphs/Protocol3Graph.gif" />
</ProtocolSummary>

Share: 

 

7 Answers Found

 
Answer #1    Answered By: Michelle White     Answered On: Sep 15

This sounds very doable. I don't have time to test it out today. Perhaps
later in the week...

Do you mind posting the xsd files  and the gifs as attachments?

 
Answer #2    Answered By: Sheena Ray     Answered On: Sep 15

I'm trying to do this solely with FrontPage and DVWPs.

The ProtocolSelector DVWP should look like this:

Compound1
Protocol1
Protocol2

Compound2
Protocol3

Compound3
Protocol4
Protocol5
Protocol6

When the user  clicks on a protocol, the
ProtocolSummary DVWP should display  a gif (will
eventually have more summary info).

Protocol2

+------+
| |
| |
| |
+------+

To attempt this with the following files...
1) Put all the attached files  into your test site's
"Shared Documents" library.
2) In the files, replace "hostname" and "sitename"
with values from your test setup.
NOTE: Fake protocol  summary images are borrowed from
Google to avoid sending more files.

 
Answer #3    Answered By: Jaime Weaver     Answered On: Sep 15

To ensure the files  of my previous post made  it, I'll include them
inline:
(they may be uglified with line wraps)

ProtocolSelector.xml
--------------------

<?xml version="1.0" encoding="utf-8"?>
<ProtocolSelector xmlns="http://hostname/sites/sitename/Shared%
20Documents/ProtocolSelector.xsd">
<Compound CompoundName="Compound1">
<Protocol ProtocolName="Protocol1" />
<Protocol ProtocolName="Protocol2" />
</Compound>
<Compound CompoundName="Compound2">
<Protocol ProtocolName="Protocol3" />
</Compound>
<Compound CompoundName="Compound3">
<Protocol ProtocolName="Protocol4" />
<Protocol ProtocolName="Protocol5" />
<Protocol ProtocolName="Protocol6" />
</Compound>
</ProtocolSelector>

ProtocolSelector.xsd
--------------------

<?xml version="1.0"?>
<xs:schema id="ProtocolSelector"
targetNamespace="http://hostname/sites/sitename/Shared%
20Documents/ProtocolSelector.xsd"
xmlns:mstns="http://hostname/sites/sitename/Shared%
20Documents/ProtocolSelector.xsd"
xmlns="http://hostname/sites/sitename/Shared%
20Documents/ProtocolSelector.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema" target="_blank" rel="nofollow">http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="ProtocolSelector" msdata:IsDataSet="true"
msdata:EnforceConstraints="False">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Compound">
<xs:complexType>
<xs:sequence>
<xs:element name="Protocol" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="ProtocolName"
form="unqualified" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="CompoundName" form="unqualified"
type="xs:string" />
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

ProtocolSummary.xml
-------------------

<?xml version="1.0" encoding="utf-8"?>
<ProtocolSummary xmlns="http://hostname/sites/sitename/Shared%
20Documents/ProtocolSummary.xsd">
<Protocol ProtocolName="Protocol1"
ProtocolGraph="http://www.google.com/logos/olympics06_opening.gif" />
<Protocol ProtocolName="Protocol2"
ProtocolGraph="http://www.google.com/logos/lunarnewyear06.gif" />
<Protocol ProtocolName="Protocol3"
ProtocolGraph="http://www.google.com/logos/mozart.gif" />
<Protocol ProtocolName="Protocol4"
ProtocolGraph="http://www.google.com/logos/mlk06.gif" />
<Protocol ProtocolName="Protocol5"
ProtocolGraph="http://www.google.com/logos/braille.gif" />
<Protocol ProtocolName="Protocol6"
ProtocolGraph="http://www.google.com/logos/newyear06.gif" />
</ProtocolSummary>

ProtocolSummary.xsd
-------------------

<?xml version="1.0"?>
<xs:schema id="ProtocolSummary"
targetNamespace="http://hostname/sites/sitename/Shared%
20Documents/ProtocolSummary.xsd"
xmlns:mstns="http://hostname/sites/sitename/Shared%
20Documents/ProtocolSummary.xsd"
xmlns="http://hostname/sites/sitename/Shared%
20Documents/ProtocolSummary.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema" target="_blank" rel="nofollow">http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="ProtocolSummary" msdata:IsDataSet="true"
msdata:EnforceConstraints="False">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Protocol">
<xs:complexType>
<xs:attribute name="ProtocolName" form="unqualified"
type="xs:string" />
<xs:attribute name="ProtocolGraph" form="unqualified"
type="xs:string" />
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

 
Answer #4    Answered By: Damon Garner     Answered On: Sep 15

I found an answer that worked in the mix of things I tried and
retried...

1) I added both xml  files as DVWPs.
2) In the protocol  selector, I added the child  record as a subview.
3) In code view for the protocol selector, Iadded the ProtocolName
as a DataField: <DataFields
xmlns="http://schemas.microsoft.com/WebPart/v2/DataView">@CompoundNam
e,Compound Name;@ProtocolName,Protocol Name;</DataFields>
4) In design view, I selected the protocol field and chose "web part
connections"
5) In the web  part connection  wizard, I paired up the "protocol
name" fields
6) In the web part  connection wizard, I chose the "[current select:
xsl:value-of]" as the "create hyperlink on"

FrontPage seems very touchy, and I find myself having to generally
redo some steps frequently. I am also wondering why I have to edit
the code in those places I hit.

 
Answer #5    Answered By: Karla Morrison     Answered On: Sep 15

Glad you got it working. When you setup the data  source catalog entry,
did you specify the CompoundName and ProtocolName as fields?

 
Answer #6    Answered By: Patricia Richardson     Answered On: Sep 15

I have the xml  files in the shared documents library, which I
dragged into a web  part zone. Then I started placing fields onto the
DVWP.

What do you mean specifying they are fields?

 
Answer #7    Answered By: Alexandra Patterson     Answered On: Sep 15

Well, it looks like you had to add
<DataFields
xmlns="http://schemas.microsoft.com/WebPart/v2/DataView">@CompoundName,C
ompound Name;@ProtocolName,Protocol Name;</DataFields>

which looks like the tag that you might need if the datafields were not
automatically found. If you add the xml  files into the data  Source
Catalog and then choose Show Data, do you see these two fields?

Can you then select them instead of typing them into the code behind?

See where I'm going?

 
Didn't find what you were looking for? Find more on DataView (w/subview) connection question Or get search suggestion and latest updates.




Tagged: