Nested DataSets?
Howdy!
I'd like to start by saying that the Spry Framework provides
a fantastic and fun way to create dynamic web pages. I've been
having a blast toying around with it. But I've run into a situation
I haven't been able to figure out yet. The Gallery demo is amazing,
but as a photographer, I need my galleries to do a bit more,
including online ordering.
Here is the link to my
Testing
Site
Click on Package Builder in the accordian, and you'll see
that you can select different packages and the form automatically
updates to reflect the contents of the selected package. What I
need to do though, is for each product in the package, I need to
display a drop down select for the image and the tone. I started
with the tone (which admittedly probably ought to be static text,
but the problem would be the same whether it is the tone or image
select), and it just doesn't work. Well, it doesn't work when it is
nested as part of a spry:repeatchildren tbody tag.
And just as a sanity check, I copied and pasted the code to
create the tone select box at the bottom of the page, Scroll down
all the way, and you'll see it down there. But, on the Package
Builder AccordionPane, it just gives me a blank select box.
Is this type of nesting too complicated for Spry at this
point, or have I missed something extremely obvious?
Thanks in advance for your advice!
Peace,
Matt
Hi Matt,
I think your problem come from those line
<div spry:region="dsPackageProducts"
id="packageProducts">
<table>
<div spry:region="dsTones" id="toneSelector">
It seems that spry can't handle nested spry:region.
So the solution is to declare your region into the previous
one like this :
<div spry:region="dsPackageProducts dsTones"
id="packageProducts">
<table>
<div id="toneSelector">
<select spry:repeatchildren="dsTones"
name="toneSelect">
</table>
</div>
Hope this helps you
Miguel
Similar Messages
-
Looping through nested datasets
My apologies in advance if this has been asked before, but the search function on these forums doesn't appear to be working at the moment...
Using: Spry 1.6.1
Dreamweaver CS5
IE 7 and 8, Firefox 4, and Chrome 10
The question:
I have a parent xml dataset, with two nested datasets, like this:
var dsCourse = new Spry.Data.XMLDataSet("menu2.xml", "menu");
var dsTopic = new Spry.Data.NestedXMLDataSet(dsCourse, "topic");
var dsLessons = new Spry.Data.NestedXMLDataSet(dsTopic, "lesson");
The data displays properly in the html, using regions, etc. However, when I try looping through them using javascript:
topics = dsTopic.getData();
for (var t = 0; t < topics.length; t++) { //loop through the topics dataset
dsTopic.setCurrentRowNumber(t);
var top = dsTopic.getCurrentRow();
alert('current topic row name: ' + top["@name"]); //for debug purposes, display the topic name
var rows = dsLessons.getData();
for (var i = 0; i < rows.length; i++) { //loop through the lessons dataset
dsLessons.setCurrentRowNumber(i);
alert("lesson name is: " + rows[i]['name']);//display the lesson name
It will perform both loops properly, displaying the correct information for each dataset in Firefox 4, but in IE 7 and 8, and in Chrome it will list each of the Topics correctly, but only displays the first set of lessons.
The xml looks like:
<topic name="Claims" default="true" complete="false">
<lesson>
<name>Getting Started</name>
<score>0</score>
</lesson>
<lesson>
<name>Adding a Claim</name>
<score>0</score>
</lesson>
<lesson>
<name>Adding a Claimant</name>
<score>0</score>
</lesson>
<topic name="Bills" default="false" complete="false">
<lesson>
<name>Bill Components</name>
<score>0</score>
</lesson>
etc.
For what it's worth, all of the topics and lessons display properly in the html using spry regions, etc. It only appears to have an issue in javascript. And then only in IE. Is there, perhaps, a better way to do this that I'm not aware of?
Thanks in advance!
JonathanThis might help http://labs.adobe.com/technologies/spry/samples/data_region/NestedXMLDataSample.html
Gramps -
Problem w/ Nested Datasets and Master/Detail regions
Hi, I'm being using spry for a couple of applications and
really love it. This is the first time I've tried to utilize a
nested dataset and I'm having some difficulty loading the nested
data. I'm getting a js 'Object does not support this property or
method' error in IE and a 'Failed to retrieve data set (dsCreds)
for spry:repeat' in FF.
I've tried to map examples to my application but of course
it's slightly different. I have a master/detail region dynamically
generated from a .php file and part of the detail region has the
nested dataset. Maybe (hopefully) it's something obvious. I've
broken out a test case that demonstrates what's happing - If anyone
could take a look I would be extremely grateful!
The .htm file is on:
htm
file
The .PHP file that generates the dynamic XML is on:
PHP
file
A sample .XML (generated from the .PHP file is
Sample XML
file
Even without the Nested set getting generated the
Master/Detail section works fine.
Thanks so much for any help!
Edit - Apologies for all the inline css - still developing
:)Hi,
The dataset name in the NestedDataSet constructor does not go
in quotes.
Try var dsCreds = new Spry.Data.NestedXMLDataSet(dsAgents,
"credentials/cred");
and see if that helps.
Don -
SetColumnType on nested Dataset with delayed loading
Hi all,
I have a master dataset which is set to null in the header,
with a nested data set that follows. I then load the dataset via a
javascript function from an onclick method, which is all working
fine. The problem I have is one of the columns contains some HTML,
which I need to set the column type for, but I'm stuffed if I can
get it working!
<head>
..snip
<script type="text/javascript">
<!--
var schedData = new Spry.Data.XMLDataSet(null, "schedule",
{useCache:false});
var schedHeader = new Spry.Data.NestedXMLDataSet(schedData,
"header/history", {useCache:true});
schedHeader.setColumnType("issue", "html");
//-->
</script>
</head>
The onclick function is then loading the XML thus:
dataSet.setURL(url);
dataSet.loadData();
And it is displayed via:
<td>{schedHeader::issue}</td>
All the other data is displayed ok, and if I remove the HTML
from the issue column then it is also displayed ok. I have verified
that the browser is receiving the data correctly, which it is:
<issue><b>F4</b></issue>
Yet when the page is shown, according to Firebug its just
rendering <td/> (ie. an empty cell).
I have checked I am using SPRY 1.5, which I am so its not
that either.
I'm sure I am missing something obvious, any ideas ?Hi,
I have a code similar to your's.
<script type="text/javascript">
<!--
var shoutbox = new Spry.Data.XMLDataSet("the url to a xml
file", "all/itm",{distinctOnLoad:true,useCache:false});
var shoutboxreply = new Spry.Data.NestedXMLDataSet(shoutbox,
"Rall/Ritm",{distinctOnLoad:true,useCache:false});
shoutbox.setColumnType("msg","html");
shoutboxreply.setColumnType("msg","html");
//-->
</script>
When I view the msg column: {shoutboxreply::msg}
The content doesn't show as html, instead as a string.
I typed the following in the address bar of my Firefox
browser:
javascript:alert(shoutboxreply.getColumnType('msg'))
Then the alert shows: string
Indicating that the shoutboxreply's msg column is a string,
not a html.
I don't know why this happens. The codes arround the
shoutboxreply.setColumnType("msg","html"); all worked. There should
be no reason for this statement not to work.
Any ideas any one? -
Nesting datasets from same xml?
I have an xml file that has multiple nodes (this is an
example of the repeating node, the location attribute will repeat
and has multiple values Antiqua, Aruba, etc. - I need to loop
through locations then show list of names within that):
<row region="Caribbean" location="Antigua">
<name>Hotel 1000</name>
<location>Antigua - St. John's</location>
<description>Blah blah blah...</description>
<image>image.jpg</image>
</row>
So result would be:
Antiqua
---Hotel 1000
---Hotel 1001
---Hotel 1002
Aruba
---Hotel 2000
---Hotel 2001
I thought the nestedXMLDataSet would work, but the nodes are
nested. Any help would be appreciated.
Thanks,
VictorHi Victor,
Take a look at the source for the RSS Reader Demo:
http://labs.adobe.com/technologies/spry/demos/rssreader/index.html
The left column is an example of what you are trying to do.
Basically what we did was we created a data set that had unique
category names. In your case that would be unique @location values.
The 2nd data set had all of the feed information, which in your
case would be a row. We then used 2 nested loops, the outer to
write out each category, and the inner wone to write out all feeds
that matched the current category.
We have an enhancement request open internally to make
"grouping" easier.
--== Kin ==-- -
Spry Menu Using Nested XML Dataset (Spry 1.6)
I have a vertical menu with a few items. One of which is
labeled Products which has submenus. I want to have that submenu
read from a Nested XML dataset. Using a single dataset for one
level in a menu is easy enough, but the subenu will have submenus.
Example Menu:
Home
Company
Products
|-- Product 1
|-- Item 1
|-- Item 2
|-- Item 3
|-- Product 2
|-- Item 1
|-- Item 2
|-- Product 3
|-- Item 1
|-- Item 2
|-- Item 3
|-- Item 4
|-- Product 4
|-- Item 1
|-- Item 2
|-- Product 5
I have been looking for an easy way to use the Spry Nested
XML Dataset to create the Product/Item menu. The number of Products
may vary as well as the number of Items in each Product submenu
(also, some Products may not have Items).
I already have an ASP page that creates the XML data from a
database.
Schema follows (XSD ):
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="
http://www.w3.org/2001/XMLSchema">
<xsd:element name="products">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="product_type"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="type_name" maxOccurs="1"
type="xsd:string"/>
<xsd:element name="type_url" maxOccurs="1"
type="xsd:anyURI"/>
<xsd:element name="product_name"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item_name" maxOccurs="1"
type="xsd:string"/>
<xsd:element name="item_url" maxOccurs="1"
type="xsd:anyURI"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
I have been programming for 17 years but am new to Spry. If
this cannot be done easily with the Spry framework, I'll probably
wind up splitting the XML data into 2 files (Products and Items)
then writing a nested loop and call each by row, but then I have to
find out how Spry Datasets reference XML data. Figuring out how to
call rows from the XML data shouldn't be so bad, but this method
just seems like such a hassle for something that should be easy.
Pseudocode follows:
j=1
i=1 to TotalNumberProducts
display Product i from Products
ItemsExist=true
While ItemsExist
if j > TotalNumberItems | Item j is not for Product then
ItemsExist=false
else
display Item j from Items
j++
Wend
Next
Thanks in advance for any help or direction!That's exactly what I'm trying to do. However, I implemented
that code and the submenus won't appear. I suspect the submenus
aren't finding the field names from the Nested XML Dataset. The
first level of Product menus work great (this is a submenu of the
overall menu) and correctly identify products that do not have
submenus, so I know it's picking up the number of records in the
Nested Dataset correctly - it just won't display the data in the
next level of menu.
variable and script declarations:
<script src="SpryAssets/SpryMenuBar.js"
type="text/javascript"></script>
<script src="SpryAssets/xpath.js"
type="text/javascript"></script>
<script src="SpryAssets/SpryData.js"
type="text/javascript"></script>
<script src="SpryAssets/SpryNestedXMLDataSet.js"
type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarVertical.css"
rel="stylesheet" type="text/css">
<script type="text/javascript">
<!--
var productMenuData = new
Spry.Data.XMLDataSet("products.asp", "products/product_type");
var productMenuDataItems = new
Spry.Data.NestedXMLDataSet(productMenuData, "product_name");
//-->
</script>
Code for menus:
<ul id="NavMenu" class="MenuBarVertical">
<li><a
href="index.html">Home</a></li>
<li><a
href="company.html">Company</a></li>
<li><a href="franco_giberti.html">Franco
Giberti</a></li>
<li><a class="MenuBarItemSubmenu"
href="products.asp">Products</a>
<ul spry:region="productMenuData
productMenuDataItems">
<li spry:repeat="productMenuData"><a
class="MenuBarItemSubmenu" href="{type_url}"
spry:if="{productMenuDataItems::ds_RowCount} !=
0">{type_name}</a> <a href="{type_url}"
spry:if="{productMenuDataItems::ds_RowCount} ==
0">{type_name}</a>
<ul spry:if="{productMenuDataItems::ds_RowCount} !=
0">
<li spry:repeat="productMenuDataItems"><a
href="{productMenuDataItems::item_url}">{productMenuDataItems::item_name}</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="contact.html">Contact Us</a>
<!-- end #sidebar1 -->
</li>
</ul>
XML:
<products
xsi:noNameSpaceSchemaLocation="products.xsd">
−
<product_type>
<type_name>Pasta Sauce</type_name>
<type_url>pt_2.asp</type_url>
−
<product_name>
<item_name>Putenesca</item_name>
<item_url>pn_3.asp</item_url>
</product_name>
−
<product_name>
<item_name>Arrabiata</item_name>
<item_url>pn_4.asp</item_url>
</product_name>
−
<product_name>
<item_name>Pesto</item_name>
<item_url>pn_5.asp</item_url>
</product_name>
−
<product_name>
<item_name>Basil and Tomato</item_name>
<item_url>pn_6.asp</item_url>
</product_name>
−
<product_name>
<item_name>Bolognese</item_name>
<item_url>pn_7.asp</item_url>
</product_name>
−
<product_name>
<item_name>Carboniera</item_name>
<item_url>pn_8.asp</item_url>
</product_name>
</product_type>
+
<product_type>
<type_name>Organic Olive Oil</type_name>
<type_url>pt_3.asp</type_url>
−
<product_name>
<item_name>Original</item_name>
<item_url>pn_9.asp</item_url>
</product_name>
−
<product_name>
<item_name>Basil</item_name>
<item_url>pn_10.asp</item_url>
</product_name>
−
<product_name>
<item_name>Herbs</item_name>
<item_url>pn_11.asp</item_url>
</product_name>
−
<product_name>
<item_name>Sun Dried Tomato</item_name>
<item_url>pn_12.asp</item_url>
</product_name>
</product_type>
+
<product_type>
<type_name>Organic Spreads</type_name>
<type_url>pt_4.asp</type_url>
−
<product_name>
<item_name>Putenesca</item_name>
<item_url>pn_13.asp</item_url>
</product_name>
−
<product_name>
<item_name>Arrabiata</item_name>
<item_url>pn_14.asp</item_url>
</product_name>
−
<product_name>
<item_name>Pesto</item_name>
<item_url>pn_15.asp</item_url>
</product_name>
−
<product_name>
<item_name>Basil and Tomato</item_name>
<item_url>pn_16.asp</item_url>
</product_name>
−
<product_name>
<item_name>Bolognese</item_name>
<item_url>pn_17.asp</item_url>
</product_name>
−
<product_name>
<item_name>Carboniera</item_name>
<item_url>pn_18.asp</item_url>
</product_name>
</product_type>
+
<product_type>
<type_name>Organic Grilled Vegetables</type_name>
<type_url>pt_5.asp</type_url>
−
<product_name>
<item_name>Putenesca</item_name>
<item_url>pn_19.asp</item_url>
</product_name>
−
<product_name>
<item_name>Arrabiata</item_name>
<item_url>pn_20.asp</item_url>
</product_name>
−
<product_name>
<item_name>Pesto</item_name>
<item_url>pn_21.asp</item_url>
</product_name>
−
<product_name>
<item_name>Basil and Tomato</item_name>
<item_url>pn_22.asp</item_url>
</product_name>
−
<product_name>
<item_name>Bolognese</item_name>
<item_url>pn_23.asp</item_url>
</product_name>
−
<product_name>
<item_name>Carboniera</item_name>
<item_url>pn_24.asp</item_url>
</product_name>
</product_type>
−
<product_type>
<type_name>Truffle Products</type_name>
<type_url>pt_6.asp</type_url>
</product_type>
</products>
Any further guidance would be very much appreciated! -
Flex: Nested tables as parameter
Hi,
is it possible to use nested tables as parameter when transfering data from WD ABAB to Flex?
In ABAP I have the following context:
Node Level0 (cardinality 0..n)
-Node Level1 (cardinality 0..n)
--Attribute att1.1
--Attribute att1.2
-Attribute att1
-Attribute att2
In Flex I have this:
[Bindable]
public var level0:ArrayCollection;
[Bindable]
public var att1:String;
[Bindable]
public var att2:String;
[Bindable]
public var ..:String;
[Bindable]
public var level1:ArrayCollection;
[Bindable]
public var att1.2:String;
[Bindable]
public var att1.2:String;
[Bindable]
public var ...:String;
It works not as it should be. Any ideas?
Thanks and redards,
RomanYes you can do nested datasets. Here are some instructions from the developer on this topic:
There are two ways to access the child data source. The first is to just use the normal data source declaration, if you do that you will get the lead selected (or default selected) child data source. Lets say your context looks like this:
context root
+-A (context node)
+-a1 (context attr)
+-a2 (context attr)
+-B (context node)
|
+-b1 (context attr)
+-b2 (context attr)
And lets say you create your Flash Island with a GACDataSource name="A" and a child GACDataSource name="B"
In your Flex code you would declare:
public var A:Object;
public var B:Object;
"A" would be set to the lead selected node for context node "A" and "B" would be set to the lead selected node for context node "B".
If, however, you would like to iterate through the all of the child context nodes you can use the getDataSourceFieldName FlashIsland function to get the correct child's field name. Given the previous example the following should work:
public function set A(val:Object) : void {
if(!(val is IList))
return;
var mainDS = val as IList;
var childDSField:String = FlashIsland.getDataSourceFieldName(this, B);
for(var i:int=0; i<mainDS.length; i++) {
var mainDSRowObject = mainDS<i>;
var thisRowsChildDS:Object = mainDSRow[childDSField];
Alert.show('Child ' + i +
': attr1: ' + thisRowsChildDS[BAttr1Field] +
' attr2: ' + thisRowsChildDS[BAttr2Field]);
public var B:Object;
public var BAttr1Field:String;
public var BAttr2Field:String; -
I have an XML DS defined in an object on a frameset page.
(shell.myDS)
I can pull data from this dataset by using
parent.shell.myDS.getData().
However, if in a child frame I try to create a Nested
DataSet, it fails. If I try to create a Spry Region in the child
frame that references the parent DataSet, it fails as well.
Can this be done at all, or is it a limitation?My own dumb fault.
1.) I didn't add the spry namespace to the page being used in
the child frame. Doh!
2.) In order for a region to use a DataSet from another frame
(or defined in another object, it needs a reference to it that
doesn't have a . in th name.
e.g.
This won't work:
<spry:region="parent.shell.myDataSet">
but this will:
var ds = parent.shell.myDataSet;
<spry region="ds"> -
Using Multiple Subpaths - question about nested XML data
Hello.
I am in the process of getting my head around the nested XML data that is one layer deeper than I know how to handle - ultimately I would like to populate a Spry MenuBar from the static XML file.
Updates & revisions to the menu would be done by simply uploading a new XML file to the server whenever something needs changed.
The problem I am having is in regard to more than one subpath.
I can successfully get the "Menuheading" and the "items" to show but the "subitems" that should attach to the "items" are nowhere to be found. Once this is figured out, I will begin building my menu.
I'm not getting an XML error when testing in Safari (Mac OS 10.5.8)
I thing my problem lies here in the head section of the page - obviously somewhere in the subPaths area:
<script type="text/javascript">var dsItems1 = new Spry.Data.XMLDataSet("MenuXML.xml", "/menu/menuitem", { subPaths: [ "items/item", "subitem" ] });
and here in the body section at subitem:
<tr spry:repeat="dsItems1">
<td>{@id}</td>
<td>{menuheading}</td>
<td>{items/item}</td>
<td>{subitem}</td>
</tr>
==================================================
The end result I would like rendered in the menu is:
==================================================
Menuheading
---- Item (hyperlink)
---- Item (hyperlink)
---- Item (hyperlink)
---- Item
------- sub submenu item (hyperlink)
Menuheading
---- Item
------- sub submenu item (hyperlink)
------- sub submenu item (hyperlink)
------- sub submenu item (hyperlink)
---- Item (hyperlink)
---- Item (hyperlink)
---- Item (hyperlink)
...and so on.
I have attached both files in their entirety at the bottom of the post in hopes someone can help.
==================================================
Here is the relevant HTML
==================================================
<head>
<script language="JavaScript" type="text/javascript" src="includes/xpath.js"></script>
<script language="JavaScript" type="text/javascript" src="includes/SpryData.js"></script>
<script language="JavaScript" type="text/javascript" src="includes/SpryNestedXMLDataSet.js"></script>
<script type="text/javascript">var dsItems1 = new Spry.Data.XMLDataSet("MenuXML.xml", "/menu/menuitem", { subPaths: [ "items/item", "subitem" ] });</script>
</head>
<body>
<div spry:region="dsItems1">
<table class="dataTable">
<tr>
<th width="62">Menu ID</th>
<th width="171">Menu Heading</th>
<th width="257">Menu Items</th>
<th width="257">Submenu Items</th>
</tr>
<tr spry:repeat="dsItems1">
<td>{@id}</td>
<td>{menuheading}</td>
<td>{items/item}</td>
<td>{subitem}</td>
</tr>
</table>
</div>
</body>
==================================================
A representative snippet of the XML is shown here:
==================================================
<?xml version="1.0" encoding="UTF-8"?>
<menu>
<menuitem id="0001" type="Aboutus">
<menuheading>About Us</menuheading>
<items>
<item id="0011">Welcome to MHBS</item>
<item id="0021">History</item>
<item id="0031">Mission</item>
<item id="0041">Accreditation</item>
<item id="0051">Directions</item>
<item id="0061">Calendar</item>
<item id="0071">Board of Directors</item>
<subitem id="0111">Meet the Board</subitem>
<item id="0081">FAQs</item>
</items>
</menuitem>
<menuitem id="0002" type="Academics">
<menuheading>Academics</menuheading>
<items>
<item id="0012">Meet the Faculty</item>
<item id="0022">Elementary</item>
<item id="0032">Middle School</item>
<item id="0042">High School</item>
<item id="0052">Academic Achievements</item>
<subitem id="0251">Test Scores</subitem>
<subitem id="0252">College Acceptance</subitem>
<item id="0062">Accelerated Reading</item>
<item id="0072">Summer Reading</item>
<item id="0082">Guidance and Counseling</item>
</items>
</menuitem>
... and on and on ...
</menu>
Should I be doing something with the Spry.Data.NestedXMLDataSet instead?
If so, how do I implement that?
many thanks in advanceYes, you should be using the nested dataset instead.
Did you read: http://labs.adobe.com/technologies/spry/samples/data_region/NestedXMLDataSample.html ? -
Nested XML filter / freezing
Hi Spry,
I'm currently working on a nested DataSet filter, but it
freezes up the browser and keeps eating memory.
I cannot give / grant any1 access to our test servers,
because they run on a secure router. So i can only provide the
filter and the current on line page.
The filter function:
function filter_rooms(){
var els =
document.forms['searchpannel'].getElementsByTagName('input');
var filter = '';
for (var j=0; j < els.length; j++){
var input = els[j];
if (input.type == 'checkbox' &&
input.id.match(/^p[0-9]$/) && input.checked){
filter += input.id.replace(/^p/, '');
if (typeof myRoom == 'function')dsRooms.removeFilter(myRoom,
true);
if (filter !== ''){
filter = new RegExp('^['+filter + ']');
document.getElementById('allrooms').checked = false;
myRoom = function(dataSet, row, rowNumber) {
return filter.exec(row["numpersons"])? row : null;
}else{
document.getElementById('allrooms').checked = true;
myFilter = false;
}if (typeof myRoom == 'function')dsRooms.addFilter(myRoom,
true);
this is just the basic of the filter, when this is working i
still have to figure out how im gonna check if a hotel has any
rooms left after filtering, if none i have to remove the hotel for
the result page. (but this is something to do later :P )
Page of problems + instructions of getting there:
Url:
http://www.hotels.nl/indexen.html
Press the button: Find best deals!
(because u need the correct param's to view the page).
I cant give the link to the xml feed, but u all know to view
it in firebug so i highly doubt this will be a problem
Here u will see the current search environment. The filter is
activated in the same way as the Star Rating filter. (same amount
of check boxes, and values send etc).
I wonder why it crashes. Is it because i linked dsRooms to as
nested xml set to the paging? Or am i just doing something wrong
here.
Note: I am aware that the current core file that we are using
still contains the old filter error (the if statement) But on our
test server we are working with the fixed version, so this is not
the issue.
The core file is a bunch of spry scripts packed together so
we have less HTTP requests.
If u require information on what is packed in it, feel free
to ask. But i highly doubt its needed.
Nutshell version: help :)
V1Hello Kin, your solution worked okay, but i seem to found a
little problem using nested filters.
When u apply a filter to a nested xml, it will be deleted
when u apply or postload the parent dataset.
U could ofcourse use a observ for that, for some that would
be a solution, but for me, not really. <-- i tryed to use that.
But in my case i have a problem with that, becouse when there
are no rooms left in the Nested list. i have to filter out the
hotel. So i call a filter on the parent hotel, wich will delete the
rooms filter, wich will be called again on postload, and create a
loop.
I tryed using Spry:if statement, it does hide the hotel, but
it doesnt update the paged view ( it only "hides" the rows, but
doesnt update the amount of items per page, so u could have 10
results on a page instead of the set 30).
I dont know if spry:if would work like that. Or if its a
small error. If it all works like it supposed to work, than maby i
should try to use flattend nested xml using xpath(subpath).
If u got any idea's or suggestions, feel free to post
;) -
If I have two datasets that are related in the same way as
their corresponding tables in the database, how can I replace the
foreign key with the actual value?
For instance, if I have a Employee which has a Company, how
can I represent that data in a repeat region given two datasets
dsEmployees and dsCompanies?
I understand that I could just initially have the backend
simply create a single nested dataset, but I was wondering if I
could do this approach first. It seems like I would, I'm just not
sure how.Ok, I tried what you suggested but get the following error:
Failed to retrieve data set (dsTeachersdsChurches) for
spry:repeat
Here is the code for that section:
<div spry:region="dsTeachers dsChurches">
<table id="teacherList">
<tr>
<th class="name" align="left">Name</th>
<th class="church" align="left">Church</th>
</tr>
<tr spry:repeat="dsTeachers dsChurches" Spry:If="
'dsTeachers::church' == 'dsChurches::id' ">
<td class="teacher"><a
href="TeacherForm.php?id={id}">{firstName}
{lastName}</a></td>
<td class="church"><a
href="ChurchForm.php?id={church}">{dsChurches::name}</a></td>
</tr>
</table>
</div>
I'm not quite sure what I am doing wrong. dsTeachers::church
refers to the church FK in the Teachers table, and dsChurches::id
is the PK in the churches table. -
Problem with nested data not displaying
I have created a dataset with a filter as follows:
var dsCustomer = new
Spry.Data.XMLDataSet("../xml/orderstatus111307.xml",
"company/customers/custid",{useCache:false,loadInterval:9000});
dsCustomer.setColumnType("daterun", "date");
var myFilterFunc = function(dataSet, row, rowNumber)
if (row['ds_RowID'] == 1)
return row;
return null;
dsCustomer.filterData(myFilterFunc);
and then created a nested dataset as follows:
var dsOrderList = new Spry.Data.NestedXMLDataSet(dsCustomer,
"orders");
dsOrderList.setColumnType("duedate", "date");
My repeat is set in a table as follows:
<div id="OrderTable" spry:region="dsOrderList
dsCustomer">
<table cellspacing="0">
<tr>
<th spry:sort="orderno">Orderno</th>
<th spry:sort="purchaseorder">Purchaseorder</th>
<th spry:sort="duedate">Duedate</th>
</tr>
<tr spry:repeat="dsOrderList" spry:setrow="dsOrderList"
spry:even="tdAlt" spry:hover="tdOver" spry:select="tdSelect">
<td class="tdLeft">{orderno}</td>
<td>{purchaseorder}</td>
<td>{duedate}</td>
</tr>
</table>
</div>
For some reason I get the following error when I view it in a
browser:
Failed to retrieve data set (dsOrderList) for spry:repeat
You can see the page here:
http://apps.esc-online.com/mickelectric2/249000/index.html
I am using Spry 1.6quote:
Originally posted by:
mokean
Hi V1 Fusion...
I am having the same problem. (Failed to retrieve data set
(dsOrphans) for spry:repeat)
What do you mean by; include SpryNestedXMLDataSet.js and u
would be ready to go ;)
I am creating a website for an orphanage in Africa.
Thanks.
He forgot to include the SpryNestedXMLDataSet.js in the
header of the page, thats why it wasn't working.
Do you have url where i can see your issue? -
What I am trying to accomplish is fairly simple, but I'm not seeing what the problem is. I have a nested accordion spry that, for all intents and purposes, is working fairly well. There's a weird problem with some of them not collapsing, but I can live with that. What I'm trying to do is put a checkmark beside any pages in the index that the student has viewed.
I'm setting up an array called yesPages here:
var yesPages = Spry.$$("yesPages");
What I want to happen is that it will hold an array of all the pages in my XML file that the student has already viewed. A bookmark, basically. To start it out, I place the first page in the array like so:
yesPages="10000";
That way, when the student starts the lesson, they've already seen the first page. As they progress through the course, I have a function called clickNext that will add to the yesPages array in this for loop:
for (var w=0;w<lessonStatus.length;w++)
if (lessonStatus[w]=="Yes")
yesPages=yesPages + "," + rowsPage[w]["@pageNo"];
alert(yesPages);
I put the alert in there to ensure that the yesPages array is building properly--it does. When the student clicks on next, I get an alert that says "1000,1001" and so on and so forth, each time adding whatever page they're on to the end of the array. Oh, and it also will sort them appropriately, too. That way, if the student jumps around in the index, the array is still sorted numerically like so: "1000, 1001, 2020, 3001, 3002, 4000."
Here's my accordion code:
<div spry:region="courseData topicList pageLister topicData">
<div id="Accordion1" class="Accordion" tabindex="0">
<div spry:repeat="courseData" class="AccordionPanel">
<div class="AccordionPanelTab">{lessonTitle}</div>
<div class="AccordionPanelContent">
<div spry:repeat="topicList">
<div id="{lessonTitle}" class="Accordion" tabindex="0">
<div class="AccordionPanel">
<div class="AccordionPanelTab"> {topicList::topicTitle}</div>
<div class="AccordionPanelContent">
<div spry:repeat="pageLister">
<div spry:choose="spry:choose">
<div spry:when="'yesPages.search({@pageNo})' != '-1'">√ {pageLister::pageTitler}</div>
<div spry:when="'yesPages.search({@pageNo})' == '-1'"> {pageLister::pageTitler}</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var Accordion2 = new Spry.Widget.Accordion("{lessonTitle}",{ useFixedPanelHeights: false });
</script>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var Accordion1 = new Spry.Widget.Accordion("Accordion1",{ useFixedPanelHeights: false });
</script>
</div>
Not sure if I copied all the </div>s to here or not, but they're all there in my code. Anyway, courseData, topicList, pageData, and topicData are all datasets. topicList and pageLister are nested datasets within courseData and topicData respectively. {@pageNo} is the page number in my XML. What I'm trying to do with the .search of the pageNo is to ensure that that page number exists within the yesPages array. If it does, put the checkmark beside it. Otherwise, leave it unchecked.
What I'm getting instead is a full list of all the pages, and they are all checkmarked. If I put a quick alert in there of yesPages, I get only the pages that they've seen. So, this doesn't make sense as to why it's not behaving correctly.
Anyone have an idea?Well, we're on the right track. By changing Accordion2 to {lessonTitle}, it now allows me to accordion the first topic of each lesson. However, the subsequent topics of each lesson still won't accordion. This is so weird. You would think that if one would do it, all of them would.
-
Hi guys!
I'm stuck at something I thought would be pretty basic... I'm
trying to make a repeat of a Nested XML DS within the repeat of its
parent DS, yet the Nested one only displays the repeat of the first
row, and doesn't change according to the row of the partent one
(The second row should actually display "Category 1, Category 2,
etc.").
Here's the page:
http://www.cosmicollective.org/projects/pumpkin/performance/v080/index.html
Here's the XML:
http://www.cosmicollective.org/projects/pumpkin/performance/v080/data/atom.xml
Spry is unobtrusive on this one, but something tells me this
has to do with my HTML structure...
Thanks in advance,
TomasNevermind, I got it. The problem was within the JS after all:
this is how I declared the Nested Dataset:
var dsLabels=new
Spry.Data.NestedXMLDataSet(dsBase,"category/@term");
But since I was using a Paged View dataset to display the
data, that must have confused the Nested one... changing the above
code to from dsBase to pvBase (the name of my Paged View Dataset)
sorted out the whole thing.
Sorry about that!
Thanks,
Tomas -
RPC errors when provisioning schedule with many datasets
When adding a dataset to a large schedule, we experience RPC errors as described below.
The target schedule is not changed.
The error appears when the dataset list gets to be around 10KB, e.g.
crbkpadm-sca[root]# wc CR-SCHED-BKP-INCR.lst
255 255 10652 CR-SCHED-BKP-INCR.lst
[ CR-SCHED-INCR.lst contains the dataset list for the schedule ]
They following illustrates the error:
/usr/bin/obtool chsched -A /HOSTS/sorrento-b/export/pool-1/cor-tools CR-SCHED-BKP-INCR
Error: couldn't update "CR-SCHED-BKP-INCR" - too many bytes supplied by RPC partner
where the schedule looks like
/usr/bin/obtool lssched -l CR-SCHED-BKP-INCR
CR-SCHED-BKP-INCR:
Type: backup
State: disabled
Dataset: /HOSTS/sorrento-a/export/pool-0/cdms_tools
/HOSTS/sorrento-b/export/pool-1/tahoe-lib-work2
/HOSTS/sorrento-a/export/pool-0/cr-db
/HOSTS/sorrento-a/export/pool-0/das-tools
/HOSTS/sorrento-a/export/pool-0/datools
/HOSTS/sorrento-a/export/pool-0/datools-rw
[ stuff deleted ]
/HOSTS/siena-b/export/pool-1/vt40-lib-ref
/HOSTS/siena-b/export/pool-1/vt40-lib-work1
Encryption: no
Comment: Incremental backup schedule CR-SCHED-BKP-INCR
UUID: b5732154-2be9-102e-9839-bb8b5939e4b0
Our setup is
o administration master - obtool version 10.3.0.3.0 (Solaris) -- Thu Aug 19 11:42:22 PDT 2010
o media server - obtool version 10.3.0.3.0 (linux) -- Thu Aug 19 06:33:20 PDT 2010
o SL8500 library - managed by ACSLS 8.0.2
Any ideas on how we can resolve this?
Thanks,
-pcYou need to file that with Oracle Support as it does sound like a bug.
However, splitting out your backups into individual datasets isn't the usual model. It's better to combine all similar items into a single dataset. I have some very large deployments with no more than 5 datasets per schedule. Typically I combine all similar clients into one dataset file, for example called LINUX and that contains many lines of Linux hosts.
You could also use nested datasets, so your schedule could call a single dataset called sorrento-a and that would "include dataset" to build up the rest of the entries you want. That way your schedule only has to have a few datasets, and you don't have to modify the schedule when you make changes, you just change your datasets.
So I would do this :
schedule calls datasets sorrento-a,sorrento-b,siena-a, siena-b
Dataset sorrento-a :
include dataset /HOSTS/sorrento-a/export/pool-0/cdms_tools
include dataset /HOSTS/sorrento-a/export/pool-0/cr-db
include dataset /HOSTS/sorrento-a/export/pool-0/datools
include dataset /HOSTS/sorrento-a/export/pool-0/datools-rw
Dataset sorrento-b :
include dataset /HOSTS/sorrento-b/export/pool-1/tahoe-lib-work2
Dataset sienna-b :
include dataset /HOSTS/siena-b/export/pool-1/vt40-lib-ref
include dataset /HOSTS/siena-b/export/pool-1/vt40-lib-work1
Thanks
Rich
Maybe you are looking for
-
How can I sort "Album by Artist / Year" in new iTunes 11?
Hi all! I just can't find such option in new iTunes! Can I sort my music like in old iTunes by Artist/Year?
-
Advice on updating to Lion (from Leopard)
Hi everyone, I have an early 2008 MacBook, version 4,1. Specs: 2.4 GhZ Intel Core 2 Duo 2 GB 667 MHz DDR2 SDRAM 160 GB I'm currently running Leopard, which means I would have to buy Snow Leopard and then buy Lion through the Mac App Store. Has anyone
-
GOT THE NEW 5S. IT TRASFERRED ALL MY PHOTOS.THEY ARE STORED IN MY ICLOUD. DIDNT WANT THEM IN NEW PHONE. ALL FACEBOOK CONTACTS TOO. DIDTNT WANT THAT EITHER. I HAVAE 4000 EMAILS DO I HAVE TO ERASE MANUALLY. I WANT TO TAKE THE PASSCODE OFF THAT I INSTAL
-
Hi, I'd like to employ 5-6 end point routers with embedded IPS. I do not have the opportunity to employ VMS o CSIMS. To configure these, then, I'll use the SDM. Instead, for the alarm reporting: - If I configure the communication with the old post-of
-
I can't find my friends playlist by using there username it doesn't show up. But there account is active. And I want to follow them