NameSpaces in Spry XmlDataSet

Hi all, I'm trying to consume an XML document that contains
tags that have a
custom namespace prefix.
Specifically I'm trying to make Spry work with Simple list
extensions (
http://msdn2.microsoft.com/en-us/xml/bb190612.aspx
Here's a snip from the XML File (plain rss + SLE)
<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0"
xmlns:cf="
http://www.microsoft.com/schemas/rss/core/2005">
<channel>
<cf:treatAs>list</cf:treatAs>
<cf:listinfo>
<cf:sort label="Title" default="true" />
<cf:sort element="item/title" label="Title"
data-type="string" />
<cf:sort element="item/pubDate" label="Date"
data-type="date" />
<cf:group element="item/category" label="Category" />
</cf:listinfo>
</channel>
</rss>
How should I tell spry there's a namespace to consider?
I've looked in the docs but couldn't find any reference to
namespaces other
than the spry namespace itself.
Joris

"Donald Booth" <[email protected]> wrote in
message
news:fbjsjm$i1c$[email protected]..
> Hi Joris,
> Just give it the full node name in the data references..
> {cf:sort}
> I just tested with that msdn sample and it seems to be
working ok for me.
Mkay must be somethin I'm doing wrong,
I'm now trying to the attributes of tags with namespaces
nested two levels
deep.
in
http://www.artronics.nl/dreamweaver/extensions/index.xml
I've got an rss
feed that contains extra markup with a namespace prefix.
<item>
<title>SpryObjectsMX-1_0_0</title>
<author>Joris van Lier</author>
<description>This extension lets you insert the
contents of Spry
reference pages in Dreamweaver MX.</description>
<mm:products>
<mm:product name="Dreamweaver" version="6" primary="true"
required="true"
/>
</mm:products>
<enclosure
url="
http://www.artronics.nl/dreamweaver/extensions/SpryObjectsMX-1_0_0.mxp"
length="55428" type="application/x-mmxp" />
</item>
now trying to display that I get emty columns for product
name and version
in
http://www.artronics.nl/dreamweaver/index.html
<div spry:region="dsExtensions">
<table border="1">
<tr>
<th scope="col"
onclick="dsExtensions.sort('title');">Title</th>
<th scope="col"
onclick="dsExtensions.sort('lastname');">Description</th>
<th scope="col"
onclick="dsExtensions.sort(products/product/@name);">Product
Name</th>
<th scope="col"
onclick="dsExtensions.sort('mm:products/mm:product/@name');">Product
Version</th>
</tr>
<tr spry:repeat="dsExtensions">
<td><a
href="{enclosure/@url}">{title}</a></td>
<td>{description}</td>
<td>{products/product/@name}</td>
<td>{mm:products/mm:product/@name}</td>
</tr>
</table>
</div>

Similar Messages

  • Adding a URL parameter to the path to spry XMLdataset

    anyone know an easy way to code this one.
    I can pull in xml and do what ever I want with it, but I want to pull in an XML page that is generated with the URL parameters of the current page
    so  instead of
    var ds1 = new Spry.Data.XMLDataSet("my_XML.php", "export/row",{useCache:false,loadInterval:2000});
    i'd like the url to include the params of the current page
    in php something like "my_XML.php?jobnumber=".$var1."&version=".$var2 ;
    where var1 and var2 are URL params of the current page URL
    I'm guessing I need to create the javascript equivalent to var ds1 = new Spry.Data.XMLDataSet("my_XML.php",  etc
    but I've got no idea what that might be
    anyone help??

    And Spry version where the URL is myfile.html?file=employees
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <script src="SpryAssets/xpath.js"></script>
    <script src="SpryAssets/SpryData.js"></script>
    <script src="SpryAssets/SpryURLUtils.js"></script>
    <link href="SpryAssets/SpryMasterDetail.css" rel="stylesheet">
    <script type="text/javascript">
    var params = Spry.Utils.getLocationParamsAsObject();
    var ds1 = new Spry.Data.XMLDataSet(params.file+".xml", "employees/employee");
    </script>
    <body>
    <div class="MasterDetail">
      <div spry:region="ds1" class="MasterContainer">
        <div class="MasterColumn" spry:repeat="ds1" spry:setrow="ds1" spry:hover="MasterColumnHover" spry:select="MasterColumnSelected">{firstname}<br />
        {lastname}</div>
      </div>
      <div spry:detailregion="ds1" class="DetailContainer">
        <div class="DetailColumn">{firstname}</div>
        <div class="DetailColumn">{lastname}</div>
        <div class="DetailColumn">{joinDate}</div>
      </div>
      <br style="clear:both" />
    </div>
    </body>
    </html>
    The URL parameters can be adjusted to suit.
    Gramps

  • Spry XmlDataSet: columns using XPath, subPaths with axis

    A couple of questions:
    I'm trying to add additional columns to a dataset whose value is not based a node or attribute but is derived using an XPath expression containing a function.
    Tried to define this using "subPaths" but it results in an error message
    var ds = new Spry.Data.XMLDataSet("my.xml", "//node]", {subPaths: ['position()', 'parent::local-name()']});
    The idea was to generate a flat table from a the xml tree in order to speed up filtering (filtering by ds.setXPath rebuilds the whole dataset)
    Is it possible to specify the columns and types when instantiating a dataset?
    var ds = new Spry.Data.XMLDataSet("my.xml", "//node]", {columns: [{'node': 'html'},{'@attr': 'text'}]);
    Spry seems to always decode entities in attributes, how do I prevent that?
    source XML:
    <outline text="attribute with entities &lt;a href=&quot;#&quot;&gt;link&lt;/a&gt;" />
    setting column type to text:
    ds.setColumnType('@text', 'text');
    has no effect, entities are still decoded
    Using setXPath('//node') results in an error message however using "//node" when calling the constructor does not.
    Any work-around?

    Hi Gramps, thank your for responding.
    From my post is might not have been obvious that i had studied that page in detail, i have also studied the Spry JavaScript files and the google AJAXSLT library used by Spry for parsing XPaths in JavaScript.
    However i can't find an answer to my questions in the documents you reference, could you be more specific in pointing out the secion you believe answers my question(s)?
    What i did find was a way to stop spry from throwing "Regular Expression is too complex" from inside the function
    Spry.Utils.setInnerHTML
    by wrapping the regex evaluation in a try/catch; this temporarily avoids the problems in MSIE but at the cost of not escaping scripts, so i would like to understand why sometimes that exception is thrown. I suspect it has to do with the string being evaluated instead of the regex-pattern.
    And i found a way to add static DataSet references, however in order to do that i had to replace the function
    Spry.Data.DataSet.prototype.getValue
    References i've added so far:
    Data reference
    Content provider
    {ds_XPath}
    Spry.Data.SpryXMLDataSet.getXPath()
    {ds_URL}
    Spry.Data.HTTPSourceDataSet.getURL()
    Feature request:
    I think it would be great to be able to register additional data references to a spry dataset
    ds.addDataReference('ds_XPath', function(dataset, rowContext, valueName){return dataset.getXPath()});
    Link to SpryDataMod.js
    http://feedfunnel.noagendareport.com/assets/spry/SpryDataMod.js

  • XMLDataSet works in FF and IE7, not IE6

    So on our website we've got a page with a Spry tabbed panel.
    Two of the four panels load a Spry XMLDataSet. Both datasets are
    being generated from a standard RSS feed. Everything works fine in
    IE7 and FireFox, but in IE6, we get the spry:state=error. An
    example of the code:
    var dsHeadlines_filter = function(dataSet, row, rowNumber) {
    row["link"] = Url.decode(row["link"]);
    return row;
    var dsPressReleases_filter = function(dataSet, row,
    rowNumber) {
    // row["link"] = Url.decode(row["link"]);
    row["link"] = "
    http://www.chaminade.edu/news/pr/rss.php?"
    + Url.decode(row["link"]);
    row["link"] =
    row["link"].replace(/CustomDispForm.aspx/,"rss_news.aspx");
    var item_date = new Date(row["pubDate"]);
    var today = new Date();
    var one_day=1000*60*60*24;
    if
    (Math.ceil((today.getTime()-item_date.getTime())/(one_day)) >
    60)
    return null;
    else
    return row;
    var dsHeadlines = new Spry.Data.XMLDataSet("
    http://www.chaminade.edu/includes/rss.php?http://news.google.com/news??svnum=10&as_scoring =n&hl=en&tab=wn&ie=UTF-8&ned=us&as_drrb=q&as_qdr=&as_mind=18&as_minm=1&as_maxd=17&as_maxm= 2&geo=&aq=f&q=%22chaminade+university%22&output=rss",
    "rss/channel/item",{sortOnLoad:"pubDate",sortOrderOnLoad:"descending",useCache:false});
    dsHeadlines.setColumnType("pubDate", "date");
    dsHeadlines.filterData(dsHeadlines_filter);
    var dsPressReleases = new Spry.Data.XMLDataSet("
    http://www.chaminade.edu/includes/rss.php?https://portal.chaminade.edu/_layouts/listfeed.a spx?List=%7B88741681%2D7558%2D4BF3%2DA377%2DBC59EB62B903%7D",
    "rss/channel/item",{sortOnLoad:"pubDate",sortOrderOnLoad:"descending",useCache:false});
    dsPressReleases.setColumnType("pubDate", "date");
    dsPressReleases.filterData(dsPressReleases_filter);
    Does anyone have an idea of why this isn't working in IE6?
    IE6 doesn't even report any error messages. It simply shows the
    HTML we setup upon a spry:state=error condition.

    Yep, it was definately a content-type issue. Thanks for the
    tip! My PHP/RSS parser was inadvertently setting the content type
    back to text/html. I was able to override the function and set it
    to text/xml, and it works great in all browsers including IE6.
    Thanks again!

  • Horizontal menu bar - dynamic xml submenus - how?

    hi everyone!
    i have an xml file which i want to turn into a spry horizontal menu bar:
    <?xml version="1.0" encoding="UTF-8"?>
    <menu>
    <menuitem heading="Kennel" url="">
         <submenu heading="Dogs" url="includes/html/dogs.html" />
         <submenu heading="*******" url="includes/html/*******.html" />
         <submenu heading="Puppies" url="includes/html/puppies.html" />
         <submenu heading="Champions" url="includes/html/champions.html" />
         <submenu heading="Hot Prospect" url="includes/html/hotprospects.html" />
         <submenu heading="Family" url="includes/html/family.html" />
         <submenu heading="Exports" url="includes/html/exports.html" />
    </menuitem>
    <menuitem heading="News" url="news/news.html">
        <submenu heading="News" url="news/news.html" />
        <submenu heading="Breeding Plans" url="includes/html/breeding.html" />
        <submenu heading="Available" url="includes/html/available.html" />
    </menuitem>
    <menuitem heading="Other" url="">
        <submenu heading="Gallery" url="includes/html/gallery.html" />
        <submenu heading="Tribute" url="includes/html/tribute.html" />
        <submenu heading="Links" url="includes/html/links.html" />
    </menuitem>
    <menuitem heading="Contact" url="includes/html/contact.html" />
    </menu>
    i managed to make each menuitem display but ther submenus can't/wont populate! you cant have nested spry regions, so how is it done???
    any help would be appreciated!
    thanks!
    a very confused delboy :-s

    actually you can have nested spry xmldataset so long as your spry is up to date ;-)

  • Resize question for gallery

    I need to run a slide show in "kiosk" mode where the image
    takes up as much of the screen as possible. The screen will be set
    to 1024 x 768, so basically I need to make sure the images either
    show at 100% because they fit, or reduced to about 85% because I
    know some of them are too big for kiosk mode.
    We are hoping to avoid having to create a sub-library of
    images that are resized down to 85%.
    Yes, I know resizing in the browser will cause degredation,
    but the max size of each image was decided on before we dreamed up
    the kiosk mode. So, new images going forward will be resized to the
    right size, but we can't resize the existing ones.
    QUESTION: Can Spry handle the task of resizing an image to a
    max height? Or can it only spit out what I put in?

    Hi dbonneville,
    If your XML has the image widths and heights embedded in it,
    you can use an onPostLoad observer on the data set to run through
    each row of the data set to constrain the image width/heights to
    the proper dimensions.
    Something like this:
    var dsPhotos = new Spry.XMLDataSet("photos.xml",
    "/gallery/photos/photo");
    dsPhotos.addObserver(ConstrainPhotoDimensions);
    function ConstrainPhotoDimensions(notificationType, notifier,
    data)
    if (notificationType != "onPostLoad")
    return;
    var maxWidth = 200; // Change this to whatever you want.
    var maxHeight = 200; // Change this to whatever you want.
    var rows = dsPhotos.getData(true);
    var numRows = rows.length;
    for (var i = 0; i < numRows; i++)
    var row = rows[ i ];
    var w = parseInt(row[ "@width" ]);
    var h = parseInt(row[ "@height" ]);
    var ratio = (w > h) ? ((w <= maxWidth) ? 1 :
    maxWidth/w) : ((h <= maxHeight) ? 1 : maxHeight/h);
    row[ "@width" ] = w*ratio;
    row[ "@height" ] = h*ratio;
    --== Kin ==--
    P.S.
    I just typed that in real-time, so I haven't actually tested
    it in a real browser.

  • Complex XML DataSet and Sorting

    Hello,
    Please consider the following XML data:
    <viewentries>
        <viewentry>
            <entrydata name="column1">
                <text>text1</text>
            </entrydata>
            <entrydata name="column2">
                <text/>
            </entrydata>
            <entrydata name="column3">
                <text/>
            </entrydata>
            <entrydata name="column4">
                <text>text4</text>
            </entrydata>
        </viewentry>
        <viewentry>
            <entrydata name="column1">
                <text>text5</text>
            </entrydata>
            <entrydata name="column2">
                <text>text6</text>
            </entrydata>
            <entrydata name="column3">
                <text/>
            </entrydata>
            <entrydata name="column4">
                <text>text8</text>
            </entrydata>
        </viewentry>
        etc...
    </viewentries>
    I was able to build a table like the following using Spry XMLDataSet and NestedXMLDataSet objects. However I am struggling trying to implement sorting...
    label for column1
    label for column2
    label for column3
    label for column4
    text1
    text4
    text5
    text6
    text8
    etc,,,
    Does anybody know how to do columns sorting using Spry in such scenario?
    Thanks.

    xtian71 wrote:
    This is how I generate the HTML table from the XML data source.
    var dsView = new Spry.Data.XMLDataSet(url, '/viewentries');
    var dsViewEntries = new Spry.Data.NestedXMLDataSet(dsView, 'viewentry');
    var dsEntryDatas = new Spry.Data.NestedXMLDataSet(dsViewEntries, 'entrydata');
    <div spry:region="dsViewEntries dsEntryDatas">
    <table>
        <thead>
        <tr><th>Column#1</th><th>Column#2</th><th>Column#3</th><th>Column#4</th></tr>
        </thead>
        <tbody spry:repeatchildren="dsViewEntries">
        <tr>
            <td spry:repeat="dsEntryDatas">{dsEntryDatas::text}</td>
        </tr>
        </tbody>
    </table>
    </div>
    Thanks.
    To the headings add  <th spry:sort="column1"> etc.

  • Using Spry.Data.XMLDataSet. Can xml file name be set to change on calendar date?

    I have a website that uses Spry Data XML DataSet to list common pests for the current month. http://www.shspestcontrol.com/
    Each month's list of pests is in a separate xml file (e.g. pests-august.xml)
    Rather than manually updating the file name each month, can it be setup to automatically change the name
    For instance on January 1st, file name changes to pests-january.xml, Feb 1st changes to pests-february.xml. etc.
    <script type="text/javascript">
    <!--
    var dsPests1 = new Spry.Data.XMLDataSet("xml_files/pests-august.xml", "gallery/pests/pest");
    //-->
    </script>
    Any advice if this can be done and if so how to go about doing it would be much appreciated
    Thanks, Toni

    <script>
    var dsPests1 = new Spry.Data.XMLDataSet("pests-september.xml", "gallery/pests/pest");
    function setPestsFile(){
        var months = new Array(13);
            months[0]  = "january";
            months[1]  = "february";
            months[2]  = "march";
            months[3]  = "april";
            months[4]  = "may";
            months[5]  = "june";
            months[6]  = "july";
            months[7]  = "august";
            months[8]  = "september";
            months[9]  = "october";
            months[10] = "november";
            months[11] = "december";
        var now = new Date();
        var monthnumber = now.getMonth();
        var monthname = months[monthnumber];
        dsPests1.setURL("pests-"+monthname+".xml");
        dsPests1.loadData();
    window.onload = setPestsFile();
    </script>

  • Var ds = new Spry.Data.XMLDataSet ...

    how many ( var ds = new Spry.Data.XMLDataSet ... ) can be
    used simultaneously in the same page? It has some
    recommendation?

    We have some pages that have 8-10 data sets. It seems to
    handle it quite well.
    Much depends on the amount of data coming into the data sets
    and the complexity of the page. You will have to test and see if it
    works for you. There is no set limit to the number of data sets.
    If your data sets have identical URLS, it will only make a
    single call for the data and then it will create the data sets from
    that one request.
    Does this help?
    Thanks,
    Don

  • Spry.Data.XMLDataSet

    Does anyone have resources that will allow
    Spry.Data.XMLDataSet to use a variable which has been formatted
    into XML.
    The getSites returns an XML Packet which is generated by
    cfquery.
    <cfset getSites =
    #Application.Component.HomeworkHotline.getSites()#>
    <script type="text/javascript">
    var myData = new Spry.Data.XMLDataSet(#Variables.GetSites#,
    "Sites/Site");
    </script>
    Everyytime I view the page I am getting spry:region or
    spry:detailregion attribute has no data set.
    Suggestions:

    Yes and I have looked at this example to try and duplicate
    it.. At the present time I have the following code:
    <cfset getSites =
    #Application.Component.HomeworkHotline.GetSites()#>
    <script type="text/javascript">
    var dsSites = new Spry.Data.XMLDataSet(null, "Sites/Site");
    var xmlDocument =
    Spry.Utils.stringToXMLDoc("#variables.getSites#");
    dsSites.SetDataFromDoc(xmlDocument);
    </script>
    The getSites produces output like:
    <?xml version="1.0"
    encoding="UTF-8"?><Sites><Site><ID>9570</ID><NAME>Northern
    Indiana Educational Services
    Center</NAME></Site></Sites>
    Now when I view the page I am getting an error message which
    states spry:region or spry:detailregion attribute has no data set.
    and then in my table I am getting {ID}{Name} instead of the value
    from the datasource.

  • Error Spry.Data.XMLDataSet is null or not an object

    Hi
    I try to use a dataset and a repeat list on a site
    But it wont show the list in top. There are two javascript
    errors. One of them says Spry.Data.XMLDataSet is null or not an
    object
    Whats wrong

    This one was solved. I copied the files in SpryAsset from a
    new one, into the folder on this site. Then the problem was
    solved

  • ERROR: Spry.Data.XMLDataSet.setDataFromDoc() failed to create dataSet

    Hi (sorry for my english in advance!!!)
    I´m trying to get some XML from a servlet but I get this
    error message:
    "Spry.Data.XMLDataSet.setDataFromDoc() failed to create
    dataSet ''for 'transacciones/tx' -
    http://170.14.46.119:8080/struts-ajax/xml.do"
    Here´s my code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!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>Prueba Spry</title>
    <script type="text/javascript"
    src="include/xpath.js"></script>
    <script type="text/javascript"
    src="include/SpryData.js"></script>
    <!-- Crear el dataset -->
    <script type="text/javascript">
    var dsTx = new Spry.Data.XMLDataSet("
    http://170.14.46.119:8080/struts-ajax/xml.do",
    "/transacciones/tx");
    dsTx.setColumnType("ingreso", "number");
    dsTx.setColumnType("egreso", "number");
    </script>
    </head>
    <body>
    <div id="Transacciones" spry:region="dsTx">
    <table id="tabla_tx" class="main">
    <tr>
    <th>Fecha</th>
    <th>Referencia</th>
    <th onclick="dsTx.sort('parade');">Para/De</th>
    <th
    onclick="dsTx.sort('categoria');">Categor&iacute;a</th>
    <th onclick="dsTx.sort('ingreso');">Ingreso</th>
    <th onclick="dsTx.sort('egreso');">Egreso</th>
    </tr>
    <tr spry:repeat="dsTx">
    <td>{fecha}</td>
    <td>{referencia}</td>
    <td>{parade}</td>
    <td>{categoria}</td>
    <td>{ingreso}</td>
    <td>{egreso}</td>
    </tr>
    </table>
    </div>
    </body>
    </html>
    And here´s the XML generated by the servlet:
    <?xml version="1.0" encoding="UTF-8"?>
    <transacciones>
    <tx id="1">
    <fecha>10/06/06</fecha>
    <referencia>A1-0023871</referencia>
    <parade>CTI S.A.</parade>
    <categoria>Telefonía celular</categoria>
    <ingreso></ingreso>
    <egreso>$350,50</egreso>
    </tx>
    <tx id="2">
    <fecha>10/06/06</fecha>
    <referencia>A1-0653782</referencia>
    <parade>Garbarino S.A.</parade>
    <categoria>Equipamiento</categoria>
    <ingreso></ingreso>
    <egreso>$1049,00</egreso>
    </tx>
    <tx id="3">
    <fecha>11/06/06</fecha>
    <referencia>CI0002</referencia>
    <parade>Gomez y Gomez S.A.</parade>
    <categoria>Ingresos por ventas</categoria>
    <ingreso>$1955,00</ingreso>
    <egreso></egreso>
    </tx>
    </transacciones>
    Thanks for your help!!!!!
    Pablo

    Hi Pablo,
    I can't load your url:
    http://170.14.46.119:8080/struts-ajax/xml.do
    But perhaps it was only meant behind your firewall. In any
    case, there are a couple of things to look for:
    1. Is your XML valid? You can find out if the browser is
    throwing an error because there was something in your XML that it
    didn't like. The firefox browser will print an error message in the
    JavaScript console if this is the case.
    2. Is your server returning the XML as content-type
    application/xml or text/xml? If not, then some browsers won't parse
    the XML.
    --== Kin ==--

  • What i want from Spry

    First let me say i was blowed away with Adobe developing open
    source software and using a wiki, I hope you guys continue doing
    this for many years to come...
    Now lets see a couple of things i would like to see in Spry,
    as mentioned the Accessibility and custom tags (validation) problem
    are a bit of a worry, you guys should probably take a look at the
    way backbase implemented their product, that actually looks like a
    very similar approach to what Spry is trying to do.
    example of backbase code:
    <b:accordeon style="width: 300px;">
    <b:accordeonhead>2001</b:accordeonhead>
    <b:accordeonbody>
    <s:include b:url="data/2001_short.xml" />
    </b:accordeonbody>
    <b:accordeonhead>Seven Samurai</b:accordeonhead>
    <b:accordeonbody>
    <s:include b:url="data/seven_short.xml" />
    </b:accordeonbody>
    <b:accordeonhead>Life is
    Beautiful</b:accordeonhead>
    <b:accordeonbody>
    <s:include b:url="data/bella_short.xml" />
    </b:accordeonbody>
    <b:accordeonhead>The Godfather</b:accordeonhead>
    <b:accordeonbody>
    <s:include b:url="data/godfather_short.xml" />
    </b:accordeonbody>
    </b:accordeon>
    from:
    http://www.backbase.com/demos/explorer/
    Now what i would like to see Spry bring to the Ajax framework
    panorama is not the same full blown RIA features of backbase or
    TIBCO General Interface, both are commercial, but more on the lines
    of an easier to use openrico or moo.fx frameworks.
    Stuff that i would like to do with Spry are create simple
    widgets that are backed by Ajax calls for instance accordion, tabs,
    and have the datasets easily updated with timers, something like
    this:
    dsObjects = new
    Spry.Data.XMLDataSet("/RapidWatcher/ManagedObject/getAll",
    "ManagedObjects /Object", { useCache: false }, { setRefresh:
    30000});
    Say that i have a tabbed RSS feed panel, i want to easily be
    able to update each tab independently, or if i have expandable
    tabs, i want to be able to easily make them drag able, change the
    expand icon, easily sort tables, and stuff like that... I really
    don't want a complex, large library i would use backbase for that
    or one of the other ajax javascript libraries Dojo, Prototype.
    PS: This FuseTalk forum REALLY sucks

    Hi again,
    So you seem to be pretty in tune with what we are thinking.
    Back is impressive. A very complete framework with probably
    the best set of demos in the Ajax world.
    In our Ajax paradigm, we want to try to stick with standard
    HTML and CSS as much as possible.
    We believe that this will make understanding and editing
    easier for everyone, since there is little new to learn.
    HTML, CSS and javascript provide all the functionality we
    need to implement our Ajax vision.
    In the product demo, our accordion code looks like:
    <div id="Acc1" class="Accordion">
    <div class="AccordionPanel">
    <div class="AccordionPanelLabel">
    <h3>Product Overview</h3>
    </div>
    <div sprydetailregion="dsProducts"
    class="AccordionPanelContent">
    <div>{desc}</div>
    </div>
    </div>
    <div class="AccordionPanel">
    <div class="AccordionPanelLabel">
    <h3>New Features </h3>
    </div>
    <div spryregion="dsProductFeatures"
    class="AccordionPanelContent">
    <div>
    <ul class="">
    <li
    spryrepeat="dsProductFeatures">{feature}</li>
    </ul>
    </div>
    </div>
    </div>
    </div>
    As I explained in another post, our choice to use custom
    attributes was a tough one, but there was little choice without
    limiting what we can do. We hope the tradeoff is worthwhile. We are
    looking into using XML namespaces, which will allow us to validate.
    Keyboard navigation is also on the list.
    Give the docs a good look for the abilities of the data
    stuff. Sorting and filtering are already there, among others.
    As for our use of wikis, well, we are getting pretty savvy
    over here. ;)
    Thanks for your interest.
    Donald Booth
    Adobe Spry Team

  • Passing a Spry XML Dataset to a function

    I am very much a noob at this.  How would I pass my XML dataset to a function so that the function would check a "date" field in the XML file and color the corresponding date cell in a YUI calendar?  I have looked through the YUI Forums, but couldn't find any good examples.  I am making a calendar of events that uses a calendar to filter the events in my XML file.  I want the calendar to highlight the dates that have an event scheduled, so the users get a visual pointer to when events are scheduled.  Here is my 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>Untitled Document</title>
    <script src="SpryAssets/xpath.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryDataExtensions.js" type="text/javascript"></script>
    <script src="yui/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js" type="text/javascript"></script>
    <script src="yui/2.6.0/build/calendar/calendar-min.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryDOMUtils.js" language="javascript" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    var dsMDEvents = new Spry.Data.XMLDataSet("schedule.xml", "events/event", {sortOnLoad: "date", sortOrderOnLoad: "ascending"});
    var dsEvents = new Spry.Data.XMLDataSet("schedule.xml", "events/event", {sortOnLoad: "date", sortOrderOnLoad: "ascending"}  );
    dsEvents.setColumnType("date", "date");
    dsEvents.setColumnType("@id", "number");var thisDate = new Date();
    var todaysDate = mydateFormat(thisDate);
    function pad(v)
      return (v<10?"0"+v:v);
    function mydateFormat(inDate)
      var myData = inDate;
      var gToday = new Date(myData);
      var tToday = pad(gToday.getMonth()+1).toString() + "/" + pad(gToday.getDate()).toString() + "/" + gToday.getFullYear().toString();
      return (tToday);
    }//-->
    </script>
    <link href="yui/2.6.0/build/fonts/fonts-min.css" rel="stylesheet" type="text/css" />
    <link href="yui/2.6.0/build/calendar/assets/skins/sam/calendar.css" rel="stylesheet" type="text/css" /><link href="SpryAssets/SpryMasterDetail.css" rel="stylesheet" type="text/css" />
    </head><body>
    <div id="Schedule">
      <div id="calendarDiv"></div>
      <script type="text/javascript">
    // BeginWebWidget YUI_Calendar: yuicalendar1
      YAHOO.namespace("calendar");  (function() {
        var cn = document.body.className.toString();
        if (cn.indexOf('yui-skin-sam') == -1) {
          document.body.className += " yui-skin-sam";
      YAHOO.calendar.init = function() {
    YAHOO.calendar.cal1 = new YAHOO.widget.CalendarGroup("cal1", "CalendarDiv", {PAGES:3});    // The following event subscribers demonstrate how to handle
        // YUI Calendar events, specifically when a date cell is
        // selected and when it is unselected.
        // See: http://developer.yahoo.com/yui/calendar/ for more
        // information on the YUI Calendar's configurations and
        // events.
        // The YUI Calendar API cheatsheet can be found at:
        // http://yuiblog.com/assets/pdf/cheatsheets/calendar.pdf
        //--- begin event subscribers ---//
        YAHOO.calendar.cal1.selectEvent.subscribe(selectHandler, YAHOO.calendar.cal1, true);
        YAHOO.calendar.cal1.deselectEvent.subscribe(deselectHandler, YAHOO.calendar.cal1, true);
        //--- end event subscribers ---//
    function dateHighlightRenderer(workingDate, cell) {
       var isHighlighted = false;
       var date = workingDate.getMonth()+1 + "/" + workingDate.getDate() + "/" + workingDate.getFullYear();
       /*if (rows["date"].search(date) != -1) {
      isHighlighted = true;
       if (date) {
      isHighlighted = true;
       if (isHighlighted) {
      YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT4);
    //YAHOO.calendar.cal1.addRenderer("11/14/2009, 11/1/2009, 11/29/2009, 11/30/2009", YAHOO.calendar.cal1.renderCellStyleHighlight1);
    for (var i = 1; i <= 7; i++) {
       // Attach to the Weekday, instead of individual dates/ranges, to improve performance.
       YAHOO.calendar.cal1.addWeekdayRenderer(i, dateHighlightRenderer);
    YAHOO.calendar.cal1.render();
    var todayFilterFunc = function(dsMDEvents, row, rowNumber)
       if (row["date"] >= todaysDate)
       return row; // Return the row to keep it in the data set.
    return null; // Return null to remove the row from the data set.
    dsMDEvents.filter(todayFilterFunc);
    }  function selectHandler(event, data) {
      // The JavaScript function subscribed to yuicalendar1.  It is called when
      // a date cell is selected.
      // alert(event) will show an event type of "Select".
      // alert(data) will show the selected date as [year, month, date]. 
      var formattedDate = pad(data[0][0][1]) + "/" + pad(data[0][0][2]) + "/" + data[0][0][0];
      var dateFilterFunc = function(dsMDEvents, row, rowNumber)
    if (row["date"].search(formattedDate) != -1)
       return row; // Return the row to keep it in the data set.
    return null; // Return null to remove the row from the data set.
      dsMDEvents.filter(dateFilterFunc); // Filter the rows in the data set.
      };  function deselectHandler(event, data) {
      // The JavaScript function subscribed to yuicalendar1.  It is called when
      // a selected date cell is unselected.
      };      // Create the YUI Calendar when the HTML document is usable.
      YAHOO.util.Event.onDOMReady(YAHOO.calendar.init);
    // EndWebWidget YUI_Calendar: yuicalendar1
      </script>
    <div class="MasterDetail">
      <div spry:region="dsMDEvents" class="MasterContainer">
        <div class="MasterColumn" spry:repeat="dsMDEvents" spry:setrow="dsMDEvents" spry:hover="MasterColumnHover" spry:select="MasterColumnSelected">{date}<br />
          {name}<br />
          {starttime} - {endtime}</div>
      </div>
      <div spry:detailregion="dsMDEvents" class="DetailContainer">
        <h2 class="DetailColumn">{name}</h2>
        <p class="DetailColumn"><strong>Date:</strong> {date}<br />
        <strong>Time:</strong> {starttime} - {endtime}</p>
        <p class="DetailColumn"><strong>Where:</strong> {location}<br />
        <strong>Type:</strong> {type}</p>
        <p class="DetailColumn"><strong>Contact:</strong> {contact}</p>
      </div>
      <br style="clear:both" />
    </div>
    </div>
    </body>
    </html>
    and here is a snipet of my xml file:
    <?xml version="1.0" encoding="utf-8"?>
    <events>
    <event id="1">
      <name>Dreamweaver CS4 Intermediate</name>
      <date>10/15/2009</date>
      <starttime>8:00 am</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 1</location>
      <type>Training</type>
      <contact>Contact 1</contact>
    </event>
    <event id="2">
      <name>InDesign CS4 Advanced</name>
      <date>11/14/2009</date>
      <starttime>8:00 am</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 2</location>
      <type>Training</type>
      <contact>Contact 1</contact>
    </event>
    <event id="3">
      <name>Flex CS4 Data Services</name>
      <date>10/15/2009</date>
      <starttime>1:00 pm</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 2</location>
      <type>Meeting</type>
      <contact>Contact 2</contact>
    </event>
    <event id="4">
      <name>Another Dreamweaver CS4 Intermediate</name>
      <date>11/30/2009</date>
      <starttime>8:00 am</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 1</location>
      <type>Training</type>
      <contact>Contact 1</contact>
    </event>
    <event id="5">
      <name>Another InDesign CS4 Advanced</name>
      <date>11/29/2009</date>
      <starttime>8:00 am</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 2</location>
      <type>Training</type>
      <contact>Contact 3</contact>
    </event>
    <event id="6">
      <name>Another Flex CS4 Data Services</name>
      <date>11/01/2009</date>
      <starttime>1:00 pm</starttime>
      <endtime>5:00 pm</endtime>
      <location>Room 2</location>
      <type>Meeting</type>
      <contact>Contact 2</contact>
    </event>
    <event id="7">
      <name>More Training</name>
      <date>11/02/2009</date>
      <starttime>8:00 am</starttime>
      <endtime>10:00 am</endtime>
      <location>Room 3</location>
      <type>Training</type>
      <contact>Contact 4</contact>
    </event>
    <event id="8">
      <name>Another Training</name>
      <date>10/25/2009</date>
      <starttime>9:00 am</starttime>
      <endtime>11:00 am</endtime>
      <location>Room 3</location>
      <type>Training</type>
      <contact>Contact 4</contact>
    </event>
    <event id="9">
      <name>Some More Training</name>
      <date>12/02/2009</date>
      <starttime>1:00 pm</starttime>
      <endtime>3:00 pm</endtime>
      <location>Room 3</location>
      <type>Training</type>
      <contact>Contact 4</contact>
    </event>
    </events>
    The function "dateHighlightRenderer" is where I am running into the problem.  How do I code this so that "dateHighlightRenderer" can read the "date" field in my XML file?

    I have tried the getData() function for this.  However, I am not sure if I am using it right:
    var d = dsMDEvents.getData();
    for (var i = 0; i < d.length(); i++) {
       var day = d[i]["date"];
       YAHOO.calendar.cal1.addRenderer(day, dateHighlightRenderer);
    When I run this for loop, my calendar will not appear on the page.  Any suggestions?

  • Unobtrusive spry help

    Trying to make some spry unobtrusive to w3c validation. Very
    little experience in java programming and can't figure out how to
    fix it.
    I got some testimonials displaying on our homepage, rotating
    randomly. The spry:region and spry:repeat both don't validate and
    can't 'extend' document type to include cause of the text appearing
    at the top of the page.
    Here is the <div> giving me problems. I just don't know
    how to break it out into a seperate .js
    <div spry:region="dsquotes" spry:repeat="dsquotes"
    id="QOTDRegion">
    <div class="quote">
    <div id="quotebox">
    <div
    id="testimonial"><em>{testimonial}</em></div><br
    />
    <div id="from"> - {from}</div></div>
    <a href="testimonials.php" title="Testimonial Page Link"
    target="_self" class="style18">To see all the testimonials click
    here</a><br /><br />
    <br />
    <h1 class="style11"> <!--#exec
    cmd="date"--></h1>
    <br />
    </div>
    </div>
    Any help would be appreciated. Thanks in advance.

    Yea. I have seen that and have tried several ways to piece it
    all together, but I am using borrowed code that I don't completely
    understand to start with and although I think I understand what is
    being done, it doesn't want to work when I try it.
    This is within the main page of the document which rotates
    the testimonials:
    <script language="javascript" type="text/javascript">
    <!--
    var dsquotes = new
    Spry.Data.XMLDataSet("/comments/comments.xml","/Quote_List/quote");
    rotateInterval = 7500;
    function rotateQOTD(){
    //don't go any further is there aren't any quotes
    if (!quotes|| quotes.length<1)
    return;
    //create a variable that will point to the current quote
    element
    var curEle;
    /*we are add a current index property to our quotes only
    once since the next time
    the function is called it will exist*/
    if (typeof quotes.curIndex == "undefined")
    quotes.curIndex = quotes.length - 1;
    else
    curEle = quotes[quotes.curIndex];
    //here we increment the current index by one using mod
    quotes.curIndex = (quotes.curIndex+1)%quotes.length;
    var nextEle = quotes[quotes.curIndex];
    //run the fade effect on the current and next element and
    prepare the timer to run on the next element.
    if (curEle)
    Spry.Effect.DoFade(curEle, { from: 100, to: 0 });
    Spry.Effect.DoFade(nextEle, { from:0, to: 100, finish:
    function(){ setTimeout(function(){ rotateQOTD(); },
    rotateInterval); } });
    function dateLoadedCallback(notificationType, notifier, data)
    //this observer function is called for every type of
    notification but we are only interested in the onPostUpdate
    if (notificationType =="onPostUpdate"){
    //we grab the number of quote div's (this is only available
    after the data is finished loading)
    quotes = Spry.$$(".quote");
    //call our rotate function
    quotes.curIndex = Math.floor(Math.random()*quotes.length);
    rotateQOTD();
    //set up an observer to run on the databound region
    Spry.Data.Region.addObserver("QOTDRegion",dateLoadedCallback);
    -->
    </script>
    And this is where its displayed on the page :
    <div spry:region="dsquotes" spry:repeat="dsquotes"
    id="QOTDRegion">
    <div class="quote">
    <div id="quotebox">
    <div
    id="testimonial"><em>{testimonial}</em></div><br
    />
    <div id="from"> - {from}</div></div>
    <a href="testimonials.php" title="Testimonial Page Link"
    target="_self" class="style18">To see all the testimonials click
    here</a><br /><br />
    <br />
    <h1 class="style11"> <!--#exec
    cmd="date"--></h1>
    <br />
    </div>
    What would seem obvious would be to remove :
    <div spry:region="dsquotes" spry:repeat="dsquotes"
    id="QOTDRegion">
    and replace with <div id="QOTDregion">
    and then put this inside .js file being loaded :
    Spry.Utils.addLoadListener(function()
    // Attach the spry namespaced attributes unobtrusively.
    Spry.$$("#QOTDregion").setAttribute("spry:region",
    "dsquotes");
    Spry.$$("#QOTDregion").setAttribute("spry:repeat",
    "dsquotes");
    Spry.Data.initRegions();
    However this does not work and I don't know why.
    I have also tried moveing all load of the data and all the
    functions for rotating it into the .js file as well, but this
    didn't work either, again, not sure why.
    </div>

Maybe you are looking for

  • How do I restrict PT60 Schema transaction to Personal Area?

    I have tried to restrict it throgh personal area but no luck. Same with PPOME transaction even though the users have only restricted PA access but they are able to change Org structure. I ran the trace and it shows that it checked P_ORGIN for specifi

  • FireFox home page does not always display correctly, hence I cannot do anything

    On my Dell laptop the FireFox home page does not always fully display. When this happens I cannot access several web sites and some that I can do not display correctly either. On some occasions everything works correctly. I have 2 Dell Inspiron lapto

  • Pending Messages Resulting in Application halt.

    We developed a JPD which subscribes to a JMS Event. While another application sends messages to this application, we saw the messages getting stuck in queue and we also saw that count of pending messages going high and then at one point the applicati

  • Using Random signatures

    I have several signature entries in the signature file of Mail>Preferences>Signatures. i want to apply each signature randomly to outgoing messages. However, when I open a new message form, the signature block indicates non-assigned with none in the

  • License problem in Adobe XI Pro

    Previously, I used Master Collection 6.0 group license without a problem. After follow the acrobat  auto update, my group license cannot be use with Adobe XI pro. The error said the serial number is not valid for Adobe XI pro. I dont need a new versi