PDA

View Full Version : Failed to retrieve dataset for spry:repeat


asha
10-07-2011, 07:55 AM
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>

<script type="text/javascript" src="spry/xpath.js"></script>
<script type="text/javascript" src="spry/SpryData.js"></script>
<script type="text/javascript" src="spry/SpryEffects.js"></script>
<!--Create a data set object-->
<script type="text/javascript">
var dsSpecials = new Spry.Data.XMLDataSet("spry/cafe.xml", "specials/menu_item");
obj1=new Object();
obj1.onPostLoad=function(dataSet,data)
{
var dd=dsSpecials.getData();
document.write("Hello");
alert("Data Loaded");
for(i=0;i<dd.length;i++)
{

document.write("Item="+dd[i].item);
}

 
 
}
dsSpecials.addObserver(obj1);

 
</script>
</head>
<body>
<!--Create the Spry dynamic region-->
<div id="Specials_DIV" spry:region="dsSpecials">
<!--Display the data in a table-->
<table id="Specials_Table" border="2">
<tr>
<th>Item</th>
<th>Description</th>
<th>Price</th>
</tr>
<tr spry:repeat="dsSpecials">
<td>{item}</td>
<td>{description}</td>
<td>{price}</td>
</tr>
</table>
 
 
</div>

 
</body>
</html>



*************************************************
M getting error like failed to retrieve dataset??
Could u plz help me out>>>What does it mean

dbepp
10-28-2011, 03:55 PM
<!--Create a data set object-->
<
scripttype="text/javascript">

var
dsSpecials = new Spry.Data.XMLDataSet("spry/cafe.xml", "specials/menu_item");
obj1=new Object();
obj1.onPostLoad=function(dataSet,data)
{

M getting error like failed to retrieve dataset??
Could u plz help me out>>>What does it mean



I'm kinda lost in regards to the rest of the code.. but I'd initially check your extentions.. "spry/cafe.xml" and "specials/menu_item"... are they there? Is that the right path? Just a thought