Adobe Dreamweaver >> Spry select with xml data

by kosterloo » Wed, 06 Aug 2008 00:31:01 GMT

Can this be done with Spry and if so, how please?

I would like to have a dropdown select on my page that is populated by the
lastname field in my database. Once selected I would like to display a table of
the data I selected from the dropdown. I am to connect to an XML datasource and
able to connect the dropdown to that last name field. I just don't know how to
get the selected last name from the drop down to display. Any help is greatly
appreciated.

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:spry="http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="../../../SpryAssets/xpath.js" type="text/javascript"></script>
<script src="../../../SpryAssets/SpryData.js" type="text/javascript"></script>
<script type="text/javascript">
<!--

var ds1 = new Spry.Data.XMLDataSet("so.xml",
"RESULTS/ROW",{distinctOnLoad:true});

-->

</script>
</head>
<body>
<p></p>
<div spry:region="ds1">
<select name="selectLastName" spry:repeatchildren="ds1">
<option value="{GlobalSubjectLastName}";>{GlobalSubjectLastName}</option>
</select>
</div>
<p></p>
<p></p>

<p> </p>
<p></p>
<p></p>
<div spry:region="ds1">
<table>
<tr>
<th spry:sort="GlobalSubjectFirstName">First Name</th>
<th>Middle Name</th>
<th spry:sort="GlobalSubjectLastName">Last Name</th>
<th> Address</th>
<th> City</th>
<th> State</th>
<th> Age</th>
<th>Charge Description</th>
</tr>
<tr spry:repeat="ds1" spry:setrow="ds1">
<td>{GlobalSubjectFirstName}</td>
<td>{GlobalSubjectMiddleName}</td>
<td>{GlobalSubjectLastName}</td>
<td>{GlobalSubjectAddress}</td>
<td>{GlobalSubjectAddressCity}</td>
<td>{GlobalSubjectAddressState}</td>
<td>{GlobalSubjectAge}</td>
<td>{ChargeStatuteDescription}</td>
</tr>
</table>
</div>
</body>
</html>



Adobe Dreamweaver >> Spry select with xml data

by Mangler » Wed, 06 Aug 2008 22:42:45 GMT




You have invalid code:

<select name="selectLastName" spry:repeatchildren="ds1">
<option value="{GlobalSubjectLastName}";>{GlobalSubjectLastName}</
option>

there should not be a ";" in the select list value, it should be:

<select name="selectLastName" spry:repeatchildren="ds1">
<option value="{GlobalSubjectLastName}">{GlobalSubjectLastName}</
option>


not sure if this will fix your problem, just something I noticed.



Similar Threads

1. XSL - dynamically select XML data source - Dreamweaver

2. Spry: Using XML dataset to create tabs of a spry tabbed panel

I have created an xml file that contains the header names and the content I 
want to add to the site.

 Here is a snippet from that file:
 <transportation>
 	<heading>
 		<headingName> Meet Some of Our Drivers </headingName>
 		<image> # </image>
 		<desc> Phil is a driver for the company and he is good at his job </desc>	
 	</heading> 
 </transportation>

 Can I create a tabbed panel from this xml file, so that I can edit the file 
and have it displayed on the panel?
 Thanks

3. Spry Data set : validating a select master region - Dreamweaver

4. ASP XML Support - Generate XML string from FORM DATA based on XML schema

I have 2 ASP pages. page1.asp will generate a xml string from form data
based on the XML schema, and then submit to page2.asp. My question is if ASP
has XML support, so that given form data, it will generate a XML string
based on the XML schema?

The picture is like this:

Form Data, XML Schema -> ASP Function -> XML string

The problem is JavaScript doesn't have XML support.

Please advise. Thanks!!


5. Format URL for Spry XML Data Set - Adobe Dreamweaver

6. Passing spry xml data into javascript

I would like to pass on a spry data element into a javascript function to do 
some math.  An easy example would be if: 

 {price} and {sale-price} where the two data elements 

 <div>Price: {price}</div>
 <div>Sale Price: {sale-price}</div>
 <div>Discount Percentage</div><div id="savings">0.00%</div>
 <script>
 pctsaving('savings','{price}','{sale-price}');
 </script>

 pctsaving function will set the div value named 'savings' to (1-(a/b))*100. 

 This will work find and dandy with numbers, but DW CS3 seems not to like to 
pass on the spry elements to javascript, it replaces the {price} with: 
       	<script language="javascript">
 		pctsaving('saving',<MM:BeginLock translatorClass="MM_SPRY" 
type="MM_SPRY_DATA_REFERENCE" orig="<MM:BeginLock translatorClass="MM_SPRY" 
type="MM_SPRY_DATA_REFERENCE" orig="{price}" ><MM_DYNAMIC_CONTENT 
DYNAMICDATA=1><MM:DECORATION HILITECOLOR="Dyn Untranslated 
Color">{price}</MM:DECORATION></MM_DYNAMIC_CONTENT></script><MM:EndLock>" 
><MM_DYNAMIC_CONTENT DYNAMICDATA=1><MM:DECORATION HILITECOLOR="Dyn Untranslated 
Color">{price}</MM:DECORATION></MM_DYNAMIC_CONTENT></script><MM:EndLock>,{sale-p
rice});
 		</script>

 Any ideas?

7. Spry = Exception caught while loading data.xml [object Error] - Adobe Dreamweaver

8. spry accordion and XML data import not working together