Dynamically loading xml content

I’m creating a menu bar in which the links have to be
dynamically created based on the values in the xml, and the number
of links(buttons) may even exceed 100.
The menu bar will be displayed in the horizontal manner. I
have the following questions, can any one help me ?
1. How to create the buttons dynamically based on the number
of entries in the xml..?
2. How to have a on (release) action common to all even
though they have to perform different action.(such as loading a
movie based on the button clicked)
3. When the number of links becomes more how to have a
horizontal scrolling effect for this.
4. I even want to change the colors of some dynamic buttons
to be changed based on some values in the xml. Can this be done?

Hi
Most of what you want is here -
www.gotoandlearn.com
Check out the 3 Carousel Tutorials, although its not a
horizontal navbar is does everything else you want
Hope it helps

Similar Messages

  • Spry Tabbed panels + Progressive Enhancement and Dynamic Loading of Content With Spry

    Is there any way to combine tabbed panels together with "Progressive Enhancement and Dynamic Loading of Content With Spry"?
    Visit: http://labs.adobe.com/technologies/spry/articles/best_practices/progressive_enhancement.ht ml#updatecontent
    And click on the "Using Spry.Utils.updateContent()"
    The 3rd example shows how to use a fade transition whenever the content changes.
    I already have tabbed panels. My menu contains buttons (on tabs) and my Content div contains the panels.
    Tabs code;
    <ul class="TabbedPanelsTabGroup">
              <li class="TabbedPanelsTab">
                   <table class="Button"  >
                        <tr>
                        <td style="padding-right:0px" title ="Home">
                        <a href="javascript:TabbedPanels1.showPanel(1);" title="Home" style="background-image:url(/Buttons/Home.png);width:172px;height:75px;display:block;"><br/></a>
                        </td>
                        </tr>
                   </table>
              </li>
    etc
    etc
    etc
    and the panel code:
    <div class="TabbedPanelsContent" id="Home">
         CONTENT
    </div>
    I hoped i can use the example code from the link into my tabbed panels.
    I thought this code:
    onclick="FadeAndUpdateContent('event', 'data/AquoThonFrag.html'); return false;"
    could be added to the tab code like this:
    <a href="javascript:TabbedPanels1.showPanel(1);" onclick="FadeAndUpdateContent('event', 'data/AquoThonFrag.html'); return false;" title="Home" style="background-image:url(/Buttons/Home.png);width:172px;height:75px;display:block;"><br/></a>
    But the content doesnt fade...
    I know i need to change the header etc.
    The following is from the link:
    <!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>Aquo Events</title>
    <script src="../../../includes/SpryEffects.js" type="text/javascript"></script>
    <script src="../../../includes/SpryData.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    function FadeAndUpdateContent(ele, url)
    try {
         Spry.Effect.DoFade(ele,{ duration: 500, from: 100, to: 0, finish: function() {
              Spry.Utils.updateContent(ele, url, function() {
                        Spry.Effect.DoFade(ele,{ duration: 500, from: 0, to: 100 });
    }catch(e){ alert(e); }
    -->
    </script>
    <style type="text/css">
    /* IE HACK to prevent bad rendering when fading. */
    #event { background-color: white; }
    </style>
    </head>
    So i changed my header etc, put the SpryEffects.js and SpryData.js into position and nothing changed...
    Is there a way to keep my tabbed panel (or change as less as possible) and let
    A. The fade work
    B. The loading work.
    The problem now is that it loads all pages instead of only the home. Therefore i wanted this Progressive Enhancement.
    And the fading part is just because its nice...

    It doesnt show in the post but off course i changed this link;
    "data/AquoThonFrag.html"
    into;
    "javascript:TabbedPanels1.showPanel(1);"
    I must say i dont know if this even works...

  • Load XML content into HTML enabled TextField

    I'm trying to figure out how to use html such as <br />
    loaded from an XML element into a TextField.. if I use something
    like
    <desc>my description<br />line 2</desc> I
    get 3 nodes instead of one when loading the XML file. If I use
    something like <desc>my description&lt;br /&gt;line
    2</desc> then I get <br /> in the actual text.
    Can anyone clue me in as to how to store HTML in an XML
    element so I can load the content into a Dynamic TextField with
    HTML enabled?
    Thanks much!

    use the latter in your xml and use the htmlText property of
    your html-enabled textfield to display your text.

  • Dynamically load xml into TextArea

    How can I include text from an xml file (loaded using URLLoader) into a TextArea. Flex is stripping the brackets <, >, and mangling the text output.
    thx

    Try the toXMLString() method.

  • Dynamically Loading xml in tree  control

    Hi I am new to flex i need to load the following xml into tree
    <?xml  version="1.0" encoding="utf-8" ?>
    - <catalog>
    - <product>
    <name>laptop3</name>
    <price>"1256"</price>
    <qty>"45"</qty>
    </product>
    - <product>
    <name>"CAR"</name>
    <price>"45000"</price>
    <qty>"7"</qty>
    </product>
    - <product>
    <name>"Laptop2"</name>
    <price>"450011"</price>
    <qty>"7022888"</qty>
    </product>
    - <product>
    <name>"Laptop"</name>
    <price>"45000"</price>
    <qty>"70"</qty>
    </product>
    - <product>
    <name>"Laptop2"</name>
    <price>"45000"</price>
    <qty>"7022"</qty>
    </product>
    - <product>
    <name>"Laptop2"</name>
    <price>"45000"</price>
    <qty>"7022888"</qty>
    </product>
    </catalog>
    I am unable to load the exact xml structure ...
    Please help me
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
        <mx:HTTPService id="srv" url="http://localhost:8080/SampleWebApp/test.jsp"/>
        <mx:DataGrid dataProvider="{srv.lastResult.catalog.product}" width="100%" height="100%"/>
        <mx:Tree labelField="@val" width="201" height="100%" showRoot="true"
        showInAutomationHierarchy="true" id="machineTree" dataProvider="{srv.lastResult.catalog.product}"></mx:Tree> 
        <mx:Button label="Get Data" click="srv.send()"/>
    </mx:Application>
    I am able to load into data grid , but not in tree help me

    The same as you have but with embeded XML.
    <mx:XML id="tstData">
    <catalog>
    <product>
    <name>laptop3</name>
    <price>"1256"</price>
    <qty>"45"</qty>
    </product>
    <product>
    <name>"CAR"</name>
    <price>"45000"</price>
    <qty>"7"</qty>
    </product>
    <product>
    <name>"Laptop2"</name>
    <price>"450011"</price>
    <qty>"7022888"</qty>
    </product>
    <product>
    <name>"Laptop"</name>
    <price>"45000"</price>
    <qty>"70"</qty>
    </product>
    <product>
    <name>"Laptop2"</name>
    <price>"45000"</price>
    <qty>"7022"</qty>
    </product>
    <product>
    <name>"Laptop2"</name>
    <price>"45000"</price>
    <qty>"7022888"</qty>
    </product>
    </catalog>
    </mx:XML>
    <mx:Tree labelFunction="treeLabel" width="201" height="100%" showRoot="true"
        showInAutomationHierarchy="true" id="machineTree" dataProvider="{tstData.product}">
    But it doesn't matter.
    try to debug. Add this
                   [Bindable]
                private var treeData:XMLListCollection;
                public function onResult(event:ResultEvent):void
                treeData = new XMLListCollection(XML(event.result).product); // debug here to see what you get and what is a type for this data
              <mx:HTTPService id="srv"  url="http://localhost:8080/SampleWebApp/test.jsp" result="onResult(event)"/>
    And treeData as a dataSource for Tree.

  • Dynamically loading more content

    If you use Google Reader, notice how the item list (in List View) in the right hand pane loads an initial set of items (60 or so) and if there are more, it says "more than 60 items" in the bottom right corner. If you use the mouse scrollwheell to scroll down, it dynamically adds to the list showing loading/loaded messages as appropriate. Even if you drag the scrollbar, it does the same thing.
    While this UI technique is a tad unconventional (not unusual for Google apps!), I can think of a few instances where it would be useful.
    Any idea how to implement this sort of thing using APEX?
    Thanks
    Discussion threads for reference:
    http://www.humanized.com/weblog/2006/04/25/no_more_more_pages/
    http://www.humanized.com/weblog/2006/05/04/no_more_more_pages_part_2/
    http://www.humanized.com/weblog/2006/04/28/reading_humanized/

    http://unspace.ca/discover/pageless/ has a sample implementation using the Prototype JS library. Should be pretty straightforward to migrate it to APEX Javascript.

  • Error loading XML content, returned by PHP script

    JavaScript
    function loadXMLDoc(fname)
    var xmlDoc;
    // code for IE
    if (window.ActiveXObject)
    xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    // code for Mozilla, Firefox, Opera, etc.
    else if (document.implementation && document.implementation.createDocument)
    xmlDoc=document.implementation.createDocument("","doc",null);
    else
    alert('Ваш броузер не может обработать необходимые скрипты. Воспользуйтесь браузерами IE 8, FireFox 3.х, Opera 9.х');
    xmlDoc.async=false;
    xmlDoc.load(fname);
    return(xmlDoc);
    PHP Script in XMLsrc.phtml
    error: loadXMLDoc("XMLsrc.phtml").documentElement is null
    It works in Opera 10.x (checked)

    JavaScript
    function loadXMLDoc(fname)
    var xmlDoc;
    // code for IE
    if (window.ActiveXObject)
    xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    // code for Mozilla, Firefox, Opera, etc.
    else if (document.implementation && document.implementation.createDocument)
    xmlDoc=document.implementation.createDocument("","doc",null);
    else
    alert('Ваш броузер не может обработать необходимые скрипты. Воспользуйтесь браузерами IE 8, FireFox 3.х, Opera 9.х');
    xmlDoc.async=false;
    xmlDoc.load(fname);
    return(xmlDoc);
    PHP Script in XMLsrc.phtml
    error: loadXMLDoc("XMLsrc.phtml").documentElement is null
    It works in Opera 10.x (checked)

  • Dynamically load the content without re-starting the server

    Let me explain the scenario.........
    I have a JSP in which I call a method written in a different class( java file).
    Now, when I change the content of the method in the class and compile it, how can I get the updated stuff in the JSP without re-starting the server.
    Even though I have to re-deploy the changed class, I need to re-start the server to get the updates effective.
    The env set up is on Tomcat
    fun_one

    FUN_ONE, I am using Tomcat 5.0 (though not 5.5), and have a Test application that I do not use WARs to deply. The Context is set with reloadable="true".
    I have this simple bean:
    package jsp.beans;
    public class ItemBean implements java.io.Serializable
         public String getjunk() { return "Hello"; }
    } And this JSP
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <html>
      <head>
      </head>
      <body>
        <!-- Display the session ID for this user -->
        <p><c:out value="${pageContext.session.id}"/></p>
        <!-- Get the junk string from the ItemBean -->
        <p><jsp:useBean id="it" class="jsp.beans.ItemBean"/>
        <c:out value="${it.junk}"/></p>
      </body>
    </html> I run the JSP, then change the text returned by the bean, recompile it, then reload the JSP (force reload). The session id remains the same, and the text changes. Does this work on your system? (note, you do have to restart your server once after you set the Context to be reloadable="true")

  • Dynamically loaded .swf missing it's mark

    I have had a website that has been up and successfully running for about a year now. Admittedly, it's a little buggy here and there, however - I have not had too many issues with it to date.
    Recently, however, I updated the main / root .swf slightly - just changed some copy, and added a slide or two throughout. When visiting the site, this main .swf dynamically loads any content .swfs required - the html, and these .swfs were not touched.
    Upon uploading the new main .swf only - everything works fun, until it loads one of the content .swfs - this always loads in the top left of the browser, rather than the center top of the browser.
    Does anyone have an idea what could be causing this - it just seems odd as I touched no code at all.
    Thanks in advance!

    Nope - the main .fla / .swf is in the correct position. The html calls it to be top / centered.
    When "that" file dynamically loads an additional .swf - they are all going up and left - off center from the site entirely. Seems odd, I've checked the placement as3 - everything seems to be in order. Any ideas? Could this just be a small bug somewhere changing something enough to do this?

  • Print Specific Frames and Dynamic XML content

    Hello, I am trying to print specific frames of my Flash movie
    with the dynamic text loaded from an XML file. The code below only
    prints the current frame I am on and does not print the XML text.
    The dataOK that is commented out is a function I have before that
    loads the XML content. The XML content is loaded to dynamic text
    boxes. Any help on this would be greatly appreciated.

    I am still having difficulty loading the XML data and the
    frameNum parameter does not seem to work. Argghhhh....
    function printTut(myevent:MouseEvent):void{
    var myPrintJob:PrintJob = new PrintJob();
    var mySprite:Sprite = new Sprite();
    var printArea:Rectangle = null;
    var options:PrintJobOptions = null;
    var frameNum:int = 2;
    mySprite.addChild(stage);
    mySprite.rotation=90;
    mySprite.scaleY=.80;
    mySprite.scaleX=.80;
    myPrintJob.start();
    myPrintJob.addPage(mySprite,printArea,options,frameNum);
    myPrintJob.send();
    print_btn.addEventListener(MouseEvent.CLICK,printTut);

  • Failed to load XML file with Content ID 'XYZ'

    Hello,
    We are using UCM Version:11.1.1.8.1DEV-2014-01-06 04:18:30Z-r114490 (Build:7.3.5.185) with site studio for creating templates and web sites.
    While switching to contribution mode, we find 'Failed to load XML file with Content ID 'XYZ' error.[Here XYZ is the local checkin content]
    In region we are using dynamic converter to convert the style of native document here below are region and its element details.
    <region  id="region3" name="Add_Content_Here" flags="1111111100100" metadata="xIdcProfile%3AisHidden%3Dtrue%26xTemplateType%3AisHidden%3Dtrue%26xShowInStaff%3AisHidden%3Dtrue%26xShowInVisitors%3AisHidden%3Dtrue%26xShowInFaculty%3AisHidden%3Dtrue%26xDiscussionCount%3AisHidden%3Dtrue%26xDiscussionType%3AisHidden%3Dtrue" dccommand="ssIncDynamicConversionByRule(SS_DATAFILE, 'Colleges_Template_Rule')">
          <!--$region3_ACTIONS="EIMPRS",region3_DCCOMMAND="ssIncDynamicConversionByRule(SS_DATAFILE, 'Colleges_Template_Rule')" -->
          <element  id="region3_element1" name="Editor" label="Editor" type="1" flags="111111111111111111111100000111100000000000001111001110111010001111101000000000000000000000000000">
            <!--$region3_element1="Add_Content_Here/Editor" -->
            <linktoregioncontent  createnewxml="true" createnewnative="false" choosemanaged="true" chooselocal="false" choosenone="false">
              <choosemanagedquerytext  corecontentonly="FALSE">
                <![CDATA[xWebsiteObjectType <Matches> `Data File` <OR> xWebsiteObjectType <Matches> `Native Document`]]>
              </choosemanagedquerytext>
            </linktoregioncontent>
          </element>
          <switchregioncontent  createnewxml="true" createnewnative="true" choosemanaged="true" chooselocal="false" choosenone="false">
            <createnewnativedoctypes >
              <![CDATA[.doc,.docx,.txt,.rtf]]>
            </createnewnativedoctypes>
            <choosemanagedquerytext  corecontentonly="FALSE">
              <![CDATA[xWebsiteObjectType <Matches> `Data File` <OR> xWebsiteObjectType <Matches> `Native Document`]]>
            </choosemanagedquerytext>
            <defaultmetadata >
              <![CDATA[xIdcProfile%3AisHidden%3Dtrue%26xTemplateType%3AisHidden%3Dtrue%26xCollegesList%3AisHidden%3Dtrue%26xShowInStudents%3AisHidden%3Dtrue%26xShowInStaff%3AisHidden%3Dtrue%26xShowInVisitors%3AisHidden%3Dtrue%26xShowInFaculty%3AisHidden%3Dtrue%26xArticleSection%3AisHidden%3Dtrue%26xDiscussionCount%3AisHidden%3Dtrue%26xDiscussionType%3AisHidden%3Dtrue%26dpTriggerValue%3DCSE]]>
            </defaultmetadata>
          </switchregioncontent>
        </region>
    <!--SS_BEGIN_OPENREGIONMARKER(region3)--><!--$SS_REGIONID="region3"--><!--$include ss_open_region_definition --><!--SS_END_OPENREGIONMARKER(region3)-->
    <!--SS_BEGIN_ELEMENT(region3_element1)--><!--$ssIncludeXml(SS_DATAFILE,region3_element1 & "/node()")--><!--SS_END_ELEMENT(region3_element1)-->
    <!--SS_BEGIN_CLOSEREGIONMARKER(region3)--><!--$include ss_close_region_definition --><!--SS_END_CLOSEREGIONMARKER(region3)-->
    Regardrs,
    Syed

    Hi Syed ,
    Add the following trace sections :
    requestaudit,sitestudio*,system + Full verbose tracing
    Clear the server output .
    Replicate the same steps and once error shows up , refresh server output and copy the logs to a text file and upload here .
    Thanks,
    Srinath

  • Get content of dynamically loaded movieclip

    Hey,
    After trying to no avail to get the totalframes of a dynamically loaded .swf in AS3 I've regressed to AS2.
    Now I can add the clip and get the totalframes of the content, no problem.
    THe problem is I cannot resize the content at all.
    I have no idea how to target the loaded content.
    Here's the code I'm using:
    var myXML:XML = new XML();
    var path:String;
    var mcl:MovieClipLoader = new MovieClipLoader();
    var mclm:MovieClipLoader = new MovieClipLoader();
    var mclL:Object = new Object();
    var frames:Number;
    var i:Number = 0;
    var mc:MovieClip = new MovieClip
    myXML.ignoreWhite=true;
    myXML.load("content.xml");
    holder_mc._alpha = 0;
    myXML.onLoad = function(xmlLoaded){
    menu();
    load();
    mclL.onLoadComplete = function() {
              frames = (MovieClip(holder_mc)._totalframes);
              if (frames == 1) {
                   image();
              else if (frames > 1) {
                   clip();
    load = function(){
         clearInterval(timer);
         path = myXML.firstChild.childNodes[i].childNodes[1].childNodes[0].nodeValue;
         mcl.loadClip(path, holder_mc);
         var tFiles:Number = myXML.firstChild.childNodes.length;
         if (i < tFiles){
              i++;
         else if (i == (tFiles)){
              i=0;
              load();
         mcl.addListener(mclL);     
    image = function() {     
         seconds=1000;
         holder_mc._alpha = 100;
         timer = setInterval(load, seconds);
    clip = function() {     
         holder_mc._alpha = 100;
         ftimer = setInterval(checkFrames, 100);
    checkFrames = function() {
              frame = (MovieClip(holder_mc)._currentframe);
              if (frame==(frames-1)){
                   clearInterval(ftimer);
                   load();
    menu = function(){
         var tFiles:Number = myXML.firstChild.childNodes.length;
         for (me=0; me < tFiles; me++){
         path = myXML.firstChild.childNodes[i].childNodes[1].childNodes[0].nodeValue;
         i++;
         _root.attachMovie("circle", "circle"+me, me, {_x:(me*30), _y:330});
         mclm.loadClip(path, ("circle"+me));     
    I need to resize the content both for the main holder_mc as well as for the menu elements.

    Thank you for the response.
    Unfortunately that didn't work.
    Even if I try to trace either target._width or holder_mc._width where you suggested I get 0 values.
    The only values I did manage to get was when I put the trace in the load() function but they were out of sync with the images being loaded.
    I even tried it on a simpler model:
    var myXML:XML = new XML();
    var path:String;
    var mcl:MovieClipLoader = new MovieClipLoader();
    var mclL:Object = new Object();
    var frames:Number;
    var i:Number = 0;
    var tFiles:Number;
    myXML.ignoreWhite=true;
    myXML.load("content.xml");
    myXML.onLoad = function(xmlLoaded){
    path = myXML.firstChild.childNodes[i].childNodes[1].childNodes[0].nodeValue;
    tFiles = myXML.firstChild.childNodes.length;
    loader();
    loader = function() {
         mcl.loadClip(path, holder_mc);
         mcl.addListener(mclL);
    mclL.onLoadComplete = function(target:MovieClip) {
         trace(target._width);
         trace(holder_mc._height);
    ..and I still get 0 values.

  • Load XML with dynamic filename

    Hi,
    I am trying to create a load xml function where I can send
    the filname to load to the function, however I get a syntax error
    with the following function, can anyone see what is wrong here?
    function loadXML(file){
    myXML:XML = new XML();
    myXML.ignoreWhite = true;
    myXML.onLoad = function(success) {
    if (success) {
    // Success
    } else {
    // fail
    myXML.load(path+file);
    Thanks for your advice

    I was trying to do the same thing and came across this great
    tutorial. I think your syntax is just a little off.
    myXML=new XML();
    myXML.ignoreWhite=true;
    myXML.onLoad=function(ok){
    if(ok){
    //trace('data loaded');
    allData=this.firstChild.childNodes;
    for(i=0;i<allData.length;i++){
    trace(allData
    .attributes.text);
    }else{
    trace('error');
    myXML.load('gridTest.xml');
    <?xml version="1.0" encoding="iso-8859-1"?>
    <nav>
    <but text="home">
    <heading>You are at Home</heading>
    <content>This is the text that is displayed when click
    on home</content>
    </but>
    <but text="About Us">
    <heading>You are at the about us
    section</heading>
    <content>This is the text that is displayed when click
    on about us</content>
    </but>
    <but text="Contact"></but>
    <heading>You are at Contact</heading>
    <content>This is the text that is displayed when click
    on Contact</content>
    </nav>

  • Loading XML file with missing elements dynamically through ODI

    Hi Guys ,
    I have the below xml file with two nodes Employee and Address. On a daily basis , sometimes the address element might not come in from the source xml file , but my interface has columns mapped to address elements, and hence it can fail due to the source element not being found in the file or data might not get loaded due to the 'and' condition in the sql query generated between the employee and address elements.  Is there a way where i can load the data dynamically where i can search in the file only for the elements (Employee) present and load data only for those elements dynamically?
    XML File:
    <?xml version="1.0" encoding="UTF-8" ?>
    <EMP>
    <Empsch>
    <Employee>
    <EmployeeID>12345</EmployeeID>
    <Initials>t</Initials>
    <LastName>john</LastName>
    <FirstName>doe</FirstName>
    </Employee>
    <Address>
    <WorkPhone>12345</WorkPhone>
    <WorkAddress>Test 234</WorkAddress>
    </Address>
    </Empsch>
    </EMP>
    Thanks ,
    Revanth Tambisetty

    I was able to resolve it by using left outer joins and referring the table structure from the XSD

  • Xml publisher enterprise!!! create rtf file dynamically with load xml data

    i am new to xml publisher enterprise , i want a solution for this question ...
    i want create rtf file dynamically with loading xml data....means i wrote a program in jsp where the the output in xml file simultaneously create rtf file..but i enable load the xml data in rtf file but when i goto rtf file from where data in that load xml then it genrate the columns..but i want in dynamiclly to load the data will you please guide me ......

    Hi Atiq
    Im not quite clear on the requirement here:
    1. Do you just want to be able to extract the data and apply a template to the XML data from your jdp and render output?
    If so then you can use the XMLP APIs ... the are in the user guide. Particularly:
    RTFProcessor - converts RTF template to XSLFO stylesheet
    FOProcessor - takes, XML data, XSLFO stylesheet and output format and generates the required output.
    2. Do you want a template that will accept any data and just format it into rows and columns ? This can be written but your XML structure is going to have to be static, the data of course can be dynamic.
    Regards, Tim

Maybe you are looking for