Spry Repeat Question
Hello,
In DW I can use Repeat Region and assign how many records it will display in the repeat and then have navigation to move forwards or backwards.
Is there a way to do that with a Spry Region/Repeat ?
Thanks in advance of any help.
Regards
Ray
Hi,
I looked over you code and I noticed that you have the image
src added on the left side.
You have this <img
src="galleries/{dsGalleries::@base}{dsGallery::thumbnail/@base}{@thumbpath}"
alt="{@thumbpath}" name="tn{ds_RowID}" width="89" height="15"
id="tn{ds_RowID}" style="left: -77px; right: 0px;" />
You don't need to have the image added on the left side,
because you want there only the title (Adobe, SF Symphony...)
So you should replace the img with a div for example:
<div style="width:89px; height:15px;left: -77px; right:
0px;" id="tn{ds_RowID}" >{@thumbpath}</div>
The reason why you have an empty space after Adobe item is
that on you xml you have an empty alt attribute.
To display only the thumbpaths that are not empty you can add
an spry:if condition.
So the above div becomes:
<div style="width:89px; height:15px;left: -77px; right:
0px;" id="tn{ds_RowID}" spry:if="{@thumbpath}" != ""
>{@thumbpath}</div>
This says if thumbpath is not empty display it.
I aslo load you page in IE and I noticed that the left menu
is not displayed.
Diana
Similar Messages
-
Help with Spry Rating Widget within a Spry Repeating Region
My link http://www.youthinkyougotitbad.com
This is a long question, but it seems to me if answered somewhere it could help alot of people in the spry community creating comment boards as it uses three important spry widgets: rating, repeating, and tabbed panels. I am trying to use spry rating widget within a spry repeating region within a spry tabbed panel with xml. I was trying to go with the pulse light script (http://forums.adobe.com/message/3831721#3831721) but Gramps told me about the spry rating widget. But I have ran into a couple more problems. First, I couldnt find that much information on the forums or online about how to do the php page with the spry rating widget. None of these have any information on how to do it:
http://labs.adobe.com/technologies/spry/articles/rating_overview/index .html
http://labs.adobe.com/technologies/spry/articles/data_api/apis/rating. html
http://labs.adobe.com/technologies/spry/samples/rating/RatingSample.ht ml
And it seems that the official examples are so poor (or I am just ignorant, which def could be a possiblity) it shows
to set the initial rating value from the server, but uses a static value of 4
http://labs.adobe.com/technologies/spry/samples/rating/RatingSample.html
<span id="initialValue_dynamic" class="ratingContainer">
<span class="ratingButton"></span>
<span class="ratingButton"></span>
<span class="ratingButton"></span>
<span class="ratingButton"></span>
<span class="ratingButton"></span>
<input id="spryrating1_val" type="text" name="spryrating1" value="4" readonly="readonly" />
<span class="ratingRatedMsg sample">Thanks for your rating!</span>
</span>
<script>
var initialValue_dynamic = new Spry.Widget.Rating("initialValue_dynamic", {ratingValueElement:'spryrating1_val'});
</script>
I finally found a site that has the php and mysql setup.
http://www.pixelplant.ro/en/articles/article-detail/article/adobe-widgets-for-download.htm l
But its not perfect. It has the same problem that I ran into with Pulse light, that you had to use php echo within the spry repeating region to set the initial value from the server:
<span id="spryrating1" class="ratingContainer">
<span class="ratingButton"></span>
<input type="text" id="ratingValue" name="dynamic_rate" value="<?php echo $row['average']?>"/>
</span>
<script type="text/javascript"
var rating1 = new Spry.Widget.Rating("spryrating1", {ratingValueElement:'ratingValue', afterRating:'serverValue', saveUrl: 'save.php?id=spryrating1&val=@@ratingValue@@'});
</script>
So instead, I tried with three of my panels (www.youthinkyougotitbad.com) to get the average rating from xml by using the following queries:
Recent
Returns the blurts in most recent order along with average rating
SELECT Blurt.Id_blurt, Blurt.Name, Blurt.Location, Blurt.Blurt,Blurt.`Date`,DATE_FORMAT(Blurt.`Date`, '%l:%i %p on %M %D, %Y') as Date, ratings.rating_id, Avg(ratings.rating_value) as average_r FROM ratings Left Join Blurt On ratings.rating_id = Blurt.Id_blurt Group By Id_blurt ORDER BY Blurt.`Date` DESC
Wet Eyed
Returns the blurts in highest ratings order along with the average rating
SELECT Blurt.Id_blurt, Blurt.Name, Blurt.Location, Blurt.Blurt, DATE_FORMAT(Blurt.`Date`, '%l:%i %p on %M %D, %Y') as Date, ratings.rating_id, Avg(ratings.rating_value) as average_r FROM ratings Left Join Blurt On ratings.rating_id = Blurt.Id_blurt AND ratings.rating_value > 0.1 Group By Id_blurt ORDER BY average_r Desc
Dry Eyed
Returns the blurts in lowest rating order along with the average rating
SELECT Blurt.Id_blurt, Blurt.Name, Blurt.Location, Blurt.Blurt, DATE_FORMAT(Blurt.`Date`, '%l:%i %p on %M %D, %Y') as Date, ratings.rating_id, Avg(ratings.rating_value) as average_r FROM ratings Left Join Blurt On ratings.rating_id = Blurt.Id_blurt AND ratings.rating_value > 0.1 Group By Id_blurt ORDER BY average_r
These all return the correct xml in the correct order.And they return the average rating of each blurt which I can send to my page with xml.
My first question is that I dont know how to configure the query on my fourth panel Empathized & Advised the same way because it already has a Group By for the Comment Id.
SELECT `Comment`.id_Blurt, COUNT(*) as frequency, Blurt.Id_blurt, Blurt.Name, Blurt.Location, Blurt.Blurt, DATE_FORMAT(Blurt.`Date`, '%l:%i %p on %M %D, %Y') as Date FROM Blurt, `Comment` WHERE Blurt.Id_blurt = `Comment`.id_Blurt GROUP BY `Comment`.id_Blurt ORDER BY COUNT(*) DESC";
Not sure if you guys need more information to understand that all, if so just ask.
So after I get my average value through xml to the first three panels, I set my spry repeating region up like this:
(Blurt panel)
<div spry:region="pv1" spry:repeatchildren="pv1">
<div class="blurtbox">
<!-- most recent blurt tab-->
<h3> "{pv1::Blurt}"</h3>
<p> Blurted from {pv1::Location} at {pv1::Date}</p>
<p>Empathize or Advise about {pv1::Name}'s Blurt #<a href="detailblurt.php?blurtid={pv1::Id_blurt}"> {pv1::Id_blurt}</a></a></p>
<span id="{pv1::Id_blurt}" class="ratingContainer">
<span class="ratingButton"></span>
<span class="ratingButton"></span>
<span class="ratingButton"></span>
<span class="ratingButton"></span>
<span class="ratingButton"></span>
<span class="ratingRatedMsg">Thank You! Your tears have been tallied.</span>
<input type="text" id="ratingValue" name="dynamic_rate" value="{pv1::average_r}"/>
</span>
<script type="text/javascript">
// overview of available options and their values:
// http://labs.adobe.com/technologies/spry/articles/rating_overview/index.html
var rating1 = new Spry.Widget.Rating("{pv1::Id_blurt}", {ratingValueElement:'ratingValue', afterRating:'serverValue', saveUrl: 'save.php?id={pv1::Id_blurt}&val=@@ratingValue@@'});
</script>
<br/>
</div>
</div>
Ok, it registers the right vote in the database with the right blurt id each time. But I am having two problems so far:
One, even though {pv1::average_r} returns the correct average through xml, it doesn't show the initial rating value for each of the repeating blurts. It seems to show the first one correct, and then just repeat that same value to the other ones that follow. I just dont understand since it can get the correct server value right after you vote (afterRating:'serverValue), that I can't manipulate spryrating.js in some way that I could just replace 'ratingValue' in ratingValueElement:'ratingValue' with something to give me the initial server value.
Two: Is even more mysterious to me, if you play around with voting on the site, sometimes you are unable to vote on different blurts. Its weird. It seems like that the javascript is completely off just on those blurts. And sometimes its a whole row, sometimes none. But so far its never a problem on the first tabbed panel (Recent), only on the other three. As far as I know, the coding is exactly the same in each tab's repeating region except for the different xml input.
And, now on the live server, sometimes the pics of tears used to voting dont show up until you click.
Any help on those three questions (how to query the fourth panel, how to show the initial server value, and the glitches with voting) would be greatly appreciated!! I looked pretty hard on adobe forums and other sites, and didnt see much on how to really use the spry rating widget with php and xml.
Thanks!!Update:
Ok, the first query on the Recent tab doesnt work for me because it wont show unless its already voted, and since these are supposed to be new blurts, that kind of breaks the whole site:
"SELECT Blurt.Id_blurt, Blurt.Name, Blurt.Location, Blurt.Blurt,Blurt.`Date`,DATE_FORMAT(Blurt.`Date`, '%l:%i %p on %M %D, %Y') as Date, ratings.rating_id, Avg(ratings.rating_value) as average_r FROM ratings Left Join Blurt On ratings.rating_id = Blurt.Id_blurt Group By Id_blurt ORDER BY Blurt.`Date` DESC";
So I replaced it with what I originally had.
"SELECT Blurt.Id_blurt, Blurt.Name, Blurt.Location, Blurt.Blurt,Blurt.`Date`,DATE_FORMAT(Blurt.`Date`, '%l:%i %p on %M %D, %Y') as Date FROM Blurt ORDER BY Blurt.`Date` DESC";
But this doesn't provide me with the initial average rating:( -
Work around for spry:repeat="ds1 ds2" limitation
I need to have both data sets repeat when using a Spry repeating region:
<div id="apDiv4" spry:region="ds1 ds2">
<table class="sprytable" border="1">
<tr>
<th spry:sort="Q#">Q#</th>
<th spry:sort="Category">Category</th>
<th spry:sort="Question">Question</th>
<th spry:sort="You">You</th>
</tr>
<tr spry:repeat="ds1 ds2">
<td>{ds1::Q#}</td>
<td>{ds1::Category}</td>
<td>{ds1::Question}</td>
<td>{ds2::You}</td>
</tr>
</table>
</div>
If I use ds1 in the spry:repeat, ds1 data will repeat (but ds2 will use the first value); or if I specify ds2, ds1 will use the first value.
I need them both to repeat.
I have spent so much time in forums, etc. and can't seem to find a workaround.
My only work around is to combine ds1 and ds2 and reload them together from the server - yuk!
ds1 is fixed and large. ds2 is small and dynamic so reloading really sucks.
Following are the ds Vars - probably irrelevent:
var ds1 = new Spry.Data.HTMLDataSet(null, "rsfamily", {sortOnLoad: "Q#", sortOrderOnLoad: "ascending" }); ds1.setColumnType("Q#", "number"); var ds2 = new Spry.Data.HTMLDataSet("youranswersIRtab.php", "youranswerstab", {}); I will worship the person who gives me an idea.
ThanksThanks V1, timkho and coolsanwa for your thoughts. Since you've been so patient (and understanding) let me briefly tell you what I'm trying to do.
I'm considered good at multi-dimensional databases and have recently fallen in love with DreamWeaver to build a pretty complex site so I don't have to be a real expert at PHP, Spry, Ajax, JavaScript, DOM, HTML, CSS etc (I suck, but most everything is working).
I wish I could point you to a site but I need to keep it secret for a bit - its strictly on my PC for now.
Let me explain the snippit, which I still don't have working .
ds1 has three columns and ds2 has one.
ds1 ds1 ds1 ds2 ds3
Q# Category Question You Compare1
1 Boats How big? 24 36
2 Boats What color? Blue Red
3 House Number rooms? 3 6
4 House Sq feet? 1000 3000
5 House Have garage? No Yes
etc to 200+
ds1 doesn't change and I don't want to reload it
ds2 are your saved answers (I will have a form to fill in and a Submit- different subject)
ds3 is user selected comparisons, retrieved from a MD database (academic because ds2 has me stopped).
Category has table row classes (to whole row), which will drive Tabbed Panels.
ds1, ds2, ds3 data have the class assigned to each row (setRowSelector) classes for columns(setColumnSelector).
I want a Spry Table with its many neat features (eg. sorting) that combines the 3 ds's (lets worry about 2 for now).
Incredibly simple but I'm stuck.
Timko suggestion results in syntax error- removing single quotes.
Collsanwa suggestion creates new columns so repeat is done for each row after You column:
24,Blue,3,1000,No
24,Blue,3,1000,No
24,Blue,3,1000,No
24,Blue,3,1000,No
24,Blue,3,1000,No
24,Blue,3,1000,No
200+ times
(I'll repeat the snippit) . Could you point me to an explanation for the spry:if id/mmid
Thanks so much.
<div id="apDiv4" spry:region="ds1 ds2">
<table class="sprytable" border="1">
<tr>
<th spry:sort="Q#">Q#</th>
<th spry:sort="Category">Category</th>
<th spry:sort="Question">Question</th>
<th spry:sort="You">You</th>
</tr>
<tr spry:repeat="ds1">
<td>{ds1::Q#}</td>
<td>{ds1::Category}</td>
<td>{ds1::Question}</td>
<td spry:repeat="ds2" spry:if="'{ds1::id}' == '{ds2::mmid}'">{ds2::You}</td>
<!-- <td spry:repeat="ds2" spry:if="{ds1::id} == {ds2::mmid}">{ds2::You}</td> Syntax error w/o quote-->
</tr>
</table>
</div> -
Spry Repeat List does not appear in Google Chrome 28
Spry repeat list works in IE8 and Firefox 22. However in Google Chrome 28 no data appears (data is blank). This is the code:
<div>
<p><span class="headline">events</span></p>
<div spry:region="Events">
<dl spry:repeatchildren="Events">
<dt>{date}</dt>
<dd>{title}</dd>
</dl>
</div>
<p> </p>
<p><span class="headline"><br />
</span></p>
</div>
This is what appears in IE8 and Firefox:
events
May 10,2012
Pre-Memorial Day Sale
May 28, 2012
Big Memorial Day Sale
May 31, 2012
Big After-Memorial Day SaleThis is the code:
<!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>OrganicUtopia Home Page</title>
<style type="text/css">
</style>
<link href="styles.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.headline { color: #88B036;
font-weight: bold;
font-size: 18px;
margin-bottom: -2px;
</style>
<link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryCollapsiblePanel.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
<script src="SpryAssets/SpryCollapsiblePanel.js" type="text/javascript"></script>
<script src="SpryAssets/xpath.js" type="text/javascript"></script>
<script src="SpryAssets/SpryData.js" type="text/javascript"></script>
<script type="text/javascript">
var Events = new Spry.Data.XMLDataSet("data/events.xml", "calendar/event");
</script>
</head>
<body>
<div id="container">
<div id="GlobalNav">Site Map | Login</div>
<div id="header"><img src="images/ou_logo.gif" width="210" height="41" /></div>
<div id="nav">{Menu Bar Here}</div>
<div id="main">
<p class="headline">welcome to organic utopia </p>
<p> </p>
<div id="TabbedPanels1" class="TabbedPanels">
<ul class="TabbedPanelsTabGroup">
<li class="TabbedPanelsTab" tabindex="0">What's New</li>
<li class="TabbedPanelsTab" tabindex="0">Features</li>
<li class="TabbedPanelsTab" tabindex="0">Customer Testimonials</li>
</ul>
<div class="TabbedPanelsContentGroup">
<div class="TabbedPanelsContent">
<p><span class="headline">Shop in the green! </span></p>
<p><img src="images/recycle_bag.gif" alt="Recycle Bag" width="81" height="101" hspace="10" vspace="5" align="left" />We have added recyclable shopping bags, which eliminate the need for the age-old question "paper or plastic?". These bags are tough, stylish, and eco-friendly! Pick from 2 sizes with the OU logo!</p>
<p></p>
</div>
<div class="TabbedPanelsContent">
<p><span class="headline">Featured stuff! </span></p>
<p><img src="images/couch.gif" alt="Couch" width="107" height="73" hspace="5" vspace="5" align="left" />A whole new line of green living products has just hit the shelves! Try our new recyclable office furniture - imagine a couch that dissolves on its own back into Mother Earth! We also have a whole new line of natural cosmetics made from the finest ingredients that are gentle on your skin!</p>
</div>
<div class="TabbedPanelsContent">
<p><span class="headline">Our loyal customers...</span></p>
<p>"organic Utopia is the place to shop - i wouldn't buy my stuff anywhere else...EVER!" <br />
- Jeff A., Boston, MA</p>
<p>"The best place for healthy, organic and green living..everything from food to furniture, all in one place!" - Fred G., Long Beach, NY </p>
</div>
</div>
</div>
<p> </p>
<p> </p>
<p> </p>
<h1 > </h1>
</div>
<div id="sidebar">
<div>
<div id="Accordion1" class="Accordion" tabindex="0">
<div class="AccordionPanel">
<div class="AccordionPanelTab">Food Products</div>
<div class="AccordionPanelContent">Dried Fruits & Vegetables<br />
Snacks<br />
Beverages<br />
Heat and Serve<br />
Cereals</div>
</div>
<div class="AccordionPanel">
<div class="AccordionPanelTab">Clothing</div>
<div class="AccordionPanelContent">Bags<br />
Accessories<br />
Shoes<br />
Fake Leather Goods</div>
</div>
<div class="AccordionPanel">
<div class="AccordionPanelTab">Home Products</div>
<div class="AccordionPanelContent">Candles<br />
Pillows<br />
Storage<br />
Knick Knacks</div>
</div>
<div class="AccordionPanel">
<div class="AccordionPanelTab">Lifestyle</div>
<div class="AccordionPanelContent">Music & DVDs<br />
Decorations & Wall Hangings</div>
</div>
</div>
</div>
<div>
<p><span class="headline">events</span></p>
<div spry:region="Events">
<dl spry:repeatchildren="Events">
<dt>{date}</dt>
<dd>{title}</dd>
</dl>
</div>
<p> </p>
<p><span class="headline"><br />
</span></p>
</div>
<div>
<div id="CollapsiblePanel1" class="CollapsiblePanel">
<div class="CollapsiblePanelTab" tabindex="0">Contact Us</div>
<div class="CollapsiblePanelContent">Enter your email address to receive specials, event notifications and more!<br />
<label>
<input name="emailaddr" type="text" id="emailaddr" size="20" />
<br />
<input type="submit" name="button" id="button" value="Submit" />
</label>
</span></div>
</div>
</div>
<div></div>
</div>
<div id="footer">All content copyright of OrganicUtopia</div>
</div>
<script type="text/javascript">
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
var Accordion1 = new Spry.Widget.Accordion("Accordion1");
var CollapsiblePanel1 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel1", {contentIsOpen:false});
</script>
</body>
</html> -
Improving Efficiency of Spry Repeat Region
Hi,
I'm using the haversine formula (to calculate distance
between two points on a sphere). Ultimately I'm using the output to
limit the number of results displayed per the code below. My
question is why I have to run OPTION 1 instead of just running the
code in OPTION 2...
Thanks.OK one more question. I have this code in a spry:repeat="ds1"
region:
if (ds1.getDataWasLoaded()) {
alert('{ds1::ds_RowNumber}');
Why does the first alert literally say "{ds1::ds_RowNumber}"
before it proceeds to give me the expected "0", "1", etc .. ? I
thought checking for ds1.getDataWasLoaded() would avoid this.
Best,
Dylan Oliver -
Problem with Spry:Repeat and Slide Effect on IE6
I run the website for my kids' hockey association and I'm not
a web programmer. I am trying to display events in a Spry region
using spry:repeat. The data is coming from a Google Calendar . I
display the event date and title on the main page. I have the
onclick set to call a javascript function that exposes the details
using the spry slide effect. It works ok except in IE6.
The following creates my dataset from a method call to a
Coldfusion component that returns the XML I need:
<script type="text/javascript">
var ds1 = new Spry.Data.XMLDataSet("
http://tornadoyouthhockey.org/Events.cfc?method=EventXML",
"events/event",{distinctOnLoad:false});
</script>
The following function slides open the detail:
<script type="text/javascript">
function startBlind(rid) {
var contentdiv = document.getElementById('panel'+ rid
+'Content');
var panel_height = contentdiv.clientHeight;
if (panel_height<100){
var bd = new Spry.Effect.Blind('panel'+ rid +'Content',
{duration: 800, to: '100px', toggle: true});
else {
var bd = new Spry.Effect.Blind('panel'+ rid +'Content',
{duration: 800, to: '0px', toggle: true});
bd.start();
</script>
Within the repeat I have:
<div class="EventPanelLabel"
onclick="startBlind({ds_RowID});">{startDate} —
{title}</div>
I think the XML looks OK but for some reason when the page
loads, IE6 returns:
Exception caught while loading
http://tornadoyouthhockey.org/Events.cfc?method=EventXML:
[object Error]
The page seems to work fine in Safari and Firefox on the Mac
and IE7 as well as Firefox on Windows. Just IE6 seems to be having
the problem. Could you please take a look at
http://tornadoyouthhockey.org
and provide any suggestions you may have?
Also, is there a way to hide the {startDate} - {title} I'm
seeing while the page loads?
Thanks,
KevinKin:
Thanks for your reply. I made the changes you suggested but,
unfortunately, IE6 is still giving me the same error when the page
loads:
Exception caught while loading
http://tornadoyouthhockey.org/Events.cfc?method=EventXML:
[object Error]
Could this be part of the problem an need to be changed as
well? :
<div id="panel{ds_RowID}Content"
Any other ideas? The page is live if you'd care to look...
http://tornadoyouthhockey.org
Kevin -
Spry:repeat works in Mozilla and not IE 6
I made this little test in Spry.
It happens to work in Mozilla but not in Internet Explorer 6
which is quite weird since I almost copy/pasted from one of the
included examples (the example worked fine everywhere).
Can anyone point me in the right direction please?
Thanks...
<!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>
<title>Club voleibol bargas</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<script language="JavaScript" type="text/javascript"
src="scripts/spry/xpath.js"></script>
<script language="JavaScript" type="text/javascript"
src="scripts/spry/SpryData.js"></script>
<script language="JavaScript" type="text/javascript">
var dsNews = new
Spry.Data.XMLDataSet("scripts/xml_noticias.php", "/allnews/news");
</script>
</head>
<body>
<div spry:region="dsNews">
<div spry:repeat="dsNews">{header}</div>
</div>
</body>
</html>
The XML needed for this looks like this:
<allnews>
<news>
<id>26</id>
<header>Morbi mauris.</header>
</news>
<news>
<id>23</id>
<header>Lorem ipsum dolor sit amet</header>
</news>
<news>
<id>8</id>
<header>Proin convallis. Duis sed est ut ligula
ullamcorper bibendum.</header>
</news>
</allnews>I spent days trying to figure it out and the minute I post it
here the solution comes to me!
The problem was that the XML file was being generated by a
PHP script which was not outputting the appropriate headers.
You can use:
header('Content-Type: text/xml');
Or use this other one if your charset is NOT US-ASCII:
header('Content-Type: application/xml'); -
Hello everyone,
I've recently started using Spry for a project I've been
asked to work on and I've run in to a few issues since my spec
changed on me today. So any help or advice anyone has is very much
welcome as I'm very much out my comfort zone at the moment.
Original Spec
The idea originally was to have a drop down of roles which
was created from the role tag within a xml file which I was able to
do as you can see below in the attached code. Once the user had
picked a role it would then
ds2.setCurrentRowNumber(this.selectedIndex) and this would trigger
the spry detail region I have to populate the fields I setup to get
out of the xml the role, process and info.
At the time I was told a role would only appear once in the
file but this is now not the case :(
My problem / New Spec
Unfortunately with the xml now having a role more then once
I've been asked to include a dynamic region which will display the
process and info fields from other records which have this role
name. Which is the bit I'm having problems with. I've been playing
with creating a spry:repeat for each field and then using
Spry:if="'{Role}'.search(^/myVar/) != -1; but I've had no luck
getting a value into a variable and I'm lack of experience is
running out of ideas.
Hope I've made sense this is my first time using spry and
JavaScript, so any help is greatly welcome.
Thanks Nick.
Example of the XML file - Please note this is very much a cut
down version.tried changing the Region HTML table cell attributes to width:75pct, but this has no effect.Unsurprisingly. Use a valid CSS length specification.
-
Diferent spry:repeat over a accordion widget
Hello, I am trying to populate a accordion with a xml.
my xml schema is:
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<canal nom="Últimos vídeos visitados">
<item id="968">
<title>Barredora Inalambrica</title>
<text>Pensando en usted y su comodidad le ofrecemos
...</text>
<video>videos/Hogar-3-BarredoraInalambrica.flv</video>
<thumb>videos/thumbs/hogar3_thumb.jpg</thumb>
<img>videos/thumbs/hogar3.jpg</img>
</item>
<item id="1000">
<title>Wonder Max</title>
<text>Preparar una fantástica comida, nunca
había sido ...</text>
<video>videos/Hogar-4-WonderMax.flv</video>
<thumb>videos/thumbs/hogar4_thumb.jpg</thumb>
<img>videos/thumbs/hogar4.jpg</img>
</item>
<item id="1001">
<title>Chef-O-Matic</title>
<text>¿No tienes tiempo para cocinar?
</text>
<video>videos/Hogar-5-Chef-O-Matic.flv</video>
<thumb>videos/thumbs/hogar5_thumb.jpg</thumb>
<img>videos/thumbs/hogar5.jpg</img>
</item>
</canal>
<canal nom="Viajes">
<item id="968">
<title>Barredora Inalambrica</title>
<text>Pensando en usted y su comodidad le ofrecemos
...</text>
<video>videos/Hogar-3-BarredoraInalambrica.flv</video>
<thumb>videos/thumbs/hogar3_thumb.jpg</thumb>
<img>videos/thumbs/hogar3.jpg</img>
</item>
<item id="1000">
my code is:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitled Document</title>
<script src="includes/SpryAccordion.js"
type="text/javascript"></script>
<script src="includes/xpath.js"
type="text/javascript"></script>
<script src="includes/SpryData.js"
type="text/javascript"></script>
<link href="css/SpryAccordion.css" rel="stylesheet"
type="text/css" />
</head>
<body>
<div spry:region="channels items">
<div class="Accordion" id="sampleAccordion"
tabindex="0">
<div class="AccordionPanel" spry:repeat="channels">
<div class="AccordionPanelTab" >{@nom}</div>
<div class="AccordionPanelContent">
<div spry:repeat="items">
<li>{title}</li>
<li>{text}</li>
</div>
</div>
</div>
</div>
<script language="JavaScript" type="text/javascript">
var channels = new Spry.Data.XMLDataSet("data/channels.xml",
"root/canal", {distinctOnLoad: true});
var items = new Spry.Data.XMLDataSet("data/channels.xml",
"root/canal/item", {distinctOnLoad: true});
var sampleAccordion = new
Spry.Widget.Accordion("sampleAccordion");
</script>
</body>
</html>
I don't know how I can insert the item tags inside de
AccordionTabContent. I want to insert in the AccordionTabContent
each item tag of each channel, but If I do a repeat over channels
dataSet I can't extract the item information and If I try to repeat
over items dataset, I can't extract the canal tag information to
make the AccordionPanelTab.
Do you know how can I do it?
Thanks in advanceI solve this problem today,,..is very vell documented...
When you repeat acordion or tab or other wiget, you need have
in repeat div also constructor of that object..
Try this code...look at last div..
change your include paths.
my work code :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>test</title>
<script src="SpryAssets/SpryAccordion.js"
type="text/javascript"></script>
<script src="SpryAssets/xpath.js"
type="text/javascript"></script>
<script src="SpryAssets/SpryData.js"
type="text/javascript"></script>
<script type="text/javascript">
var channels = new Spry.Data.XMLDataSet("xml.xml",
"root/canal", {distinctOnLoad: true});
var items = new Spry.Data.XMLDataSet("xml.xml",
"root/canal/item", {distinctOnLoad: true});
</script>
<link href="SpryAssets/SpryAccordion.css" rel="stylesheet"
type="text/css" />
</head>
<body>
<div spry:region="channels items">
<div class="Accordion" id="sampleAccordion"
tabindex="0">
<div class="AccordionPanel" spry:repeat="channels">
<div
class="AccordionPanelTab">{channels::@nom}</div>
<div class="AccordionPanelContent">
<div spry:repeat="items">
<li>{items::title}</li>
<li>{items::text}</li>
</div>
</div>
</div>
</div>
<script language="JavaScript" type="text/javascript">
var sampleAccordion = new
Spry.Widget.Accordion("sampleAccordion");
</script>
</div>
</body>
</html>
My xml
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<canal nom="Últimos vídeos visitados">
<item id="968">
<title>Barredora Inalambrica</title>
<text>Pensando en usted y su comodidad le ofrecemos
...</text>
<video>videos/Hogar-3-BarredoraInalambrica.flv</video>
<thumb>videos/thumbs/hogar3_thumb.jpg</thumb>
<img>videos/thumbs/hogar3.jpg</img>
</item>
<item id="1000">
<title>Wonder Max</title>
<text>Preparar una fantástica comida, nunca
había sido ...</text>
<video>videos/Hogar-4-WonderMax.flv</video>
<thumb>videos/thumbs/hogar4_thumb.jpg</thumb>
<img>videos/thumbs/hogar4.jpg</img>
</item>
<item id="1001">
<title>Chef-O-Matic</title>
<text>¿No tienes tiempo para cocinar?
</text>
<video>videos/Hogar-5-Chef-O-Matic.flv</video>
<thumb>videos/thumbs/hogar5_thumb.jpg</thumb>
<img>videos/thumbs/hogar5.jpg</img>
</item>
</canal>
<canal nom="Viajes">
<item id="968">
<title>Barredora Inalambrica</title>
<text>Pensando en usted y su comodidad le ofrecemos
...</text>
<video>videos/Hogar-3-BarredoraInalambrica.flv</video>
<thumb>videos/thumbs/hogar3_thumb.jpg</thumb>
<img>videos/thumbs/hogar3.jpg</img>
</item>
</canal>
</root>
Dont remember repeat constructor using last </div> :)
bye
Spry V.1.6 -
Limiting Number of Rows in spry:repeat Region
With the code...
<tr spry:repeat="dsTitles">
<td width="60%">{title}</td>
<td width="14%">{author}</td>
<td width="9%">{date}</td>
</tr>
... How do I limit the number of rows that will be displayed
in this repeat region
to just 5, instead of displaying all 25 rows stored in the
XMLDataSet (dsTitles)?
Thanks!
OscarHey Oscar,
Glad that works for you.
Kin and I were thinking that {ds_RowNumber} might be better
for that particular looping, but you get the idea.
http://labs.adobe.com/technologies/spry/articles/data_set_overview/index.html
That was our first overview doc and it was definitive at the
time. We no longer update it but it's a good intro to Spry.
You can find the built in data references in that doc,
granted almost at the very bottom.
The API doc
http://labs.adobe.com/technologies/spry/articles/data_api/index.html
is a good start but we still have a lot to add to it. I have
plans for it for sure.
We are doing a big push for 1.6 towards progressive
enhancement, unobtrusive js and things like that.
Expect docs and samples and some cool utilities to come out
this summer and for 1.6.
And we won't charge for it, but we also won't return any
cash-laden envelopes... ;)
Let us know how to improve any part of Spry.
Thanks,
Don -
Passing values to a function from spry:repeat
Is this a viable solution?
<div spry:repeat="dsData">
<script
type="text/javascript">addPin("{ds_RowNumberPlus1}","{site}&q uot;,"{latitude}","{longitude}");</script>
</div>quote:
Originally posted by:
victor.corey
Hello V1 Fusion,
Yes this did work. Thank you.
For clarification, why add this to a spry:if in a hidden span
versus just adding a javascript script block inside the
spry:repeat. Both seem to work so far, but it seems your solution
may help with error handling???
Thanks,
Victor Corey
I know u could use functions in Spry if, im
using them my self i should show a row based on cookie values ( the
function checks if certain data is in a cookie, and if its there it
shows the row).
I was about to use the same technique for my own project my
self to, so i thought it would be a good way to gather certain
data, based on what u get returned from your own data set.
And if u add a javascript block, each time u repeat it, it
has to be created. its allot smaller size wise to create a little
span (or u can even add it to the repeat self). That was basicly
the reason why i suggested using a spry:if ^_^ -
Error "failed to retrieve data set (ds1) for spry:repeat" in IE when using filters
Everything works fine in Firefox, but in IE7 I get an error
message saying "Failed to retrieve data set (ds1) for spry:repeat."
It seems to be my filter set that's causing this. Once I commented
out the chunk of code that handles filtering, the page finally
loaded. How can I get it to work in IE?
Here's the page:
http://a44.awardspace.com/testing/mbc/portfolio/This usually means the dataset (ds4) can not be found / is not created.
So double check that you have created the dataset.
If this is the case.. please provide us with a online url. -
Limiting Items Displayed in Spry Repeat Lists, Tables, Etc.
Is it possible to limit the items shown in Spry repeat
region? For example say I have 20 items in a list and only want to
display the first three items, not the entire list. If so how is
that done?Hey Oscar,
Glad that works for you.
Kin and I were thinking that {ds_RowNumber} might be better
for that particular looping, but you get the idea.
http://labs.adobe.com/technologies/spry/articles/data_set_overview/index.html
That was our first overview doc and it was definitive at the
time. We no longer update it but it's a good intro to Spry.
You can find the built in data references in that doc,
granted almost at the very bottom.
The API doc
http://labs.adobe.com/technologies/spry/articles/data_api/index.html
is a good start but we still have a lot to add to it. I have
plans for it for sure.
We are doing a big push for 1.6 towards progressive
enhancement, unobtrusive js and things like that.
Expect docs and samples and some cool utilities to come out
this summer and for 1.6.
And we won't charge for it, but we also won't return any
cash-laden envelopes... ;)
Let us know how to improve any part of Spry.
Thanks,
Don -
Help. I am new to Spry (although been doing JS for years) and
am attempting to get a handle on it. Here is my issue. I am
attempting a simple spry:repeat and all I am getting is my last
node.
Here is the XML chunk:
<?xml version="1.0" encoding="iso-8859-1"?>
<newHire>
<quickStart>
<quickLink linkUrl="#">Accessing Activant systems and
launching the VPN</quickLink>
<quickLink linkUrl="#">Navigating the Employee
Intranet</quickLink>
<quickLink linkUrl="#">Using the Employee Training
Portal</quickLink>
<quickLink linkUrl="#">Using CEP</quickLink>
</quickStart>
</newHire>
HTML...
<html xmlns="
http://www.w3.org/1999/xhtml"
xmlns:spry="
http://ns.adobe.com/spry">
<head>
<title>Spry Test</title>
<script src="includes/xpath.js"
type="text/javascript"></script>
<script src="includes/SpryData.js"
type="text/javascript"></script>
<script type="text/javascript">
<!--
// STEP 1: Create a data set.
var dsNewHireQuickStart = new
Spry.Data.XMLDataSet("newHire.xml", "newHire/quickStart");
//-->
</script>
</head>
<body>
<div id="quickLinks" spry:region="dsNewHireQuickStart">
<ul>
<li
spry:repeat="dsNewHireQuickStart">{quickLink}</li>
</ul>
</div>
</body>
</html>
Thoughts?
~ClayHi,
change your xml structure so that each quickLink tag is
wrapped in a quickStart tag, like this:
====================== new xml =================
<?xml version="1.0" encoding="iso-8859-1"?>
<newHire>
<quickStart>
<quickLink linkUrl="#">Accessing Activant systems and
launching the VPN</quickLink>
</quickStart>
<quickStart>
<quickLink linkUrl="#">Navigating the Employee
Intranet</quickLink>
</quickStart>
<quickStart>
<quickLink linkUrl="#">Using the Employee Training
Portal</quickLink>
</quickStart>
<quickStart>
<quickLink linkUrl="#">Using CEP</quickLink>
</quickStart>
</newHire> -
This code here repeats the accordeons panel but all opened
and innactive.
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Products Demo</title>
<link href="css/accordion.css" rel="stylesheet"
type="text/css" />
<script type="text/javascript"
src="../../includes/xpath.js"></script>
<script type="text/javascript"
src="../../includes/SpryData.js"></script>
<script type="text/javascript"
src="../includes/SpryEffects.js"></script>
<script type="text/javascript"
src="../includes/SpryAccordion.js"></script>
<script type="text/javascript"
src="../../includes/gallery.js"></script>
<script type="text/javascript">
var dsProducts = new Spry.Data.XMLDataSet("products.xml",
"products/product")
var dsProductFeatures = new
Spry.Data.XMLDataSet("products.xml",
"products/product/features/feature")
</script>
<link href="../css/screen.css" rel="stylesheet"
type="text/css" />
</head>
<body>
<div id="wrap">
<div id="sidebar">
<table spryregion="dsProductFeatures" id="products">
<caption>
{@Departure}
</caption>
</table>
<div spryregion="dsProductFeatures" id="content">
tetette
<p>
<img src="
http://staticcontent.exitravel.com/StaticContent/EN/DBImages/Common/Image/Hotel/{@OrgID}/{ @HotelID}_1.jpg"
id="mainImage" alt="main image" width="120" height="120" />
</div>
<div id="Acc1" class="Accordion">
<div spryregion="dsProductFeatures"
class="AccordionPanel">
<div spryrepeat="dsProductFeatures">
<div class="AccordionPanelLabel">
{@Destination}
</div>
<div class="AccordionPanelContent">
{@Price}
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
<!--
var Acc1 = new Spry.Widget.Accordion("Acc1");
-->
</script>
</body>
</html>
Does that mean that Spry accordeons cant be duplicated that
way?Actually, you can generate the panels dynamically, but there
are a couple of things you have to keep in mind. There is an
expected markup structure for the accordion. The divs that make up
the accordion follow a pattern that looks like this:
Accordion
Accordion Panel
Accordion Panel Label
Accordion Panel Content
Accordion Panel
Accordion Panel Label
Accordion Panel Content
Inserting extra divs between and around some of these
structures will only confuse the Accordion behavior code.
Since you are trying to repeat accordion panels, you want to
put the spryregion attribute on the Accordion itself, and then put
a spryrepeat on the actual div that is the panel.
The next thing to consider, is that anytime Spry regenerates
the markup for a widget, you have to re-attach all of the widget
behaviors to the widget. To accomplish this, we have to place a
listener on the data set. The idea is that every time the data set
notifies listeners that its data has changed, we know the widget
markup will be re-generated, so we have to call the constructor for
the Accordion.
Here's some actual markup that I whipped up that works:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Dynamic Accordion</title>
<link href="../../css/accordion.css" rel="stylesheet"
type="text/css" />
<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/SpryEffects.js"></script>
<script language="JavaScript" type="text/javascript"
src="../../includes/SpryAccordion.js"></script>
<script language="JavaScript" type="text/javascript">
// Step 1: Define the data set:
var dsAirports = new
Spry.Data.XMLDataSet("../../data/airports.xml",
"/airports/airport");
// Step 2: Register a listener on dsAirports so that we can
auto-attach the
// Accordion behaviors.
dsAirports.addDataChangedObserver("accordionObserver", {
onDataChanged: function(ds, dcType) { setTimeout(function() { var
acc = new Spry.Widget.Accordion("Acc1"); }, 0); } });
</script>
</head>
<body>
<div id="Acc1" class="Accordion"
spry:region="dsAirports">
<div class="AccordionPanel" spry:repeat="dsAirports">
<div class="AccordionPanelLabel">
<h3>{code}</h3>
</div>
<div class="AccordionPanelContent">
<div>{name}</div>
</div>
</div>
</div>
</body>
</html>
Note the use of a timer in the listener callback. This is
necessary to force the Accordion call to be triggered *after* the
dynamic region has been re-generated. This won't be necessary once
we implement the dynamic region observers mechanism.
--== Kin ==--
Maybe you are looking for
-
OBIEE Report Export from Dashboard to Excel doesn't suppress the columns as
OBIEE Report Export from Dashboard to Excel doesn't suppress the columns as expected even after the properties are set to Suppress in the report. In Dashboard it is suppressed Properly but in the excel export it is not suppressed and values for the c
-
i have american account but i just now have 0.61$ and i have another gift card from uk.i want to use it but itunes said i have to change my country and its not possible before i spend all my money.my question is how i can spend a 0.61$ ?
-
Hello, In our XI production system, some times there many messages in sxmb_moni fails with the error "HTTP_RESP_STATUS_CODE_NOT_OK", when we restart the message it getting processed . I am not sure what is the cause for this. however there is job RSX
-
When will external table field_list in access parameters support varchar2?
Hello all, Currently I'm working on a CSV error check/upload/download utility (in pl/sql) using external tables. However, within the access parameters section, when I tried to use varchar2 in the field list to map to data fields in csv, oracle (10g)
-
Working with PowerPoint objects in 7
I'm evaluating Captivate 7, comparing it with Articulate Storyline. One of the adverstised features of 7 is the ablity to import PowerPoint including, explicitly, all object and animations. I have tried this and so far it only looks like it creates