Help using dynamic XML with Tree Menu

Can some one please help me? I don't know what I'm doing
wrong. I'd simply like to be able to load an XML file of data and
use this data to populate a Flex tree component.
The XML file needs to reside on the server and will change
from time to time, so I am loading it via an HTTPService call. The
part that I can't get to work is the way the
XML is displayed in the Tree component. It ends up blank or
sometimes I just get the result of "[object Object]". I know my
syntax must be screwed up somewhere, but because
AS3 and Flex are new territory for me, I can't get it to
work. I am feeling my IQ drop on a minute to minute basis. Please
help me if you can! Thanks!
In this example, I am expecting a list of the different
groceries/categories to show up in the tree menu. Instead, I get
nothing.
HERE IS THE XML FILE, CALLED "groceries.xml":
<catalog>
<category name="Meat">
<product name="Buffalo" cost="4" isOrganic="No"
isLowFat="Yes"/>
<product name="T Bone Steak" cost="6" isOrganic="No"
isLowFat="No"/>
<product name="Whole Chicken" cost="1.5" isOrganic="Yes"
isLowFat="No"/>
</category>
<category name="Vegetables">
<product name="Broccoli" cost="2.16" isOrganic="Yes"
isLowFat="Yes"/>
<product name="Vine Ripened Tomatoes" cost="1.69"
isOrganic="No" isLowFat="Yes"/>
<product name="Yellow Peppers" cost="1.25"
isOrganic="Yes" isLowFat="Yes"/>
</category>
<category name="Fruit">
<product name="Bananas" cost="0.95" isOrganic="Yes"
isLowFat="Yes"/>
<product name="Grapes" cost="1.34" isOrganic="No"
isLowFat="Yes" />
<product name="Strawberries" cost="2.5" isOrganic="Yes"
isLowFat="Yes"/>
</category>
</catalog>
HERE IS THE MXML FLEX FILE THAT ISN'T WORKING AS I'D LIKE IT
TO:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" initialize="initializeHandler(event)" width="240"
height="340">
<mx:Script>
<![CDATA[
import mx.collections.XMLListCollection;
import mx.collections.ICollectionView;
import mx.controls.List;
private function initializeHandler(event:Event):void {
textService.send();
private function resultHandler(event:Event):void {
myTree.dataProvider = textService.lastResult.catalog;
]]>
</mx:Script>
<mx:HTTPService id="textService" url="groceries.xml"
result="resultHandler(event)" />
<mx:Tree id="myTree" labelField="@name" showRoot="false"
x="20" y="20" width="200" height="300" />
</mx:Application>
Any help is deeply appreciated.

You must specify a resultformat of e4x. The default
resultFormat is object. Object only works when you have a very
simple xml structure that can be consistently represented as a set
of objects.

Similar Messages

  • Using Dynamic Visibility with Accordian Menu

    Hiya.  I am trying to use dynamic visibility with an accordian menu.  My menu categories are years, 2005 - 2010. My categories items are key performance indicators such as abandon percentage,  first call resolution, customer satisfaction percentage, call volume and average speed of answer. 
    Of my 6 KPIs, 4 display as percentages and 2 display as whole numbers.  When the percentage graphs are displayed the axis labels needs to be percentages.   When the whole number graphs are displayed the axis label needs to show whole numbers.
    I thought to achieve this I should use dynamic visibility with two different line charts where one line chart shows percentages and the other line chart shows whole numbers.   However I am strugging trying to make that happen.
    Is my concept correct, or is there an easier way to accomplish this?  If my concept is correct,can someone give me some advice on how to make dynamic visibility display the correct chart depending on which KPI I select from my accordian menu?
    Thanks!

    Hi
    You can achieveby doing following steps..
    Insert your categories into D3 and label bind to E3.
    take two charts and bind to the destination data of Accordion menu
    then write a formula in F3 like this =IF(OR(E3="abandon percentage",E3="customer satisfaction percentage"),1,0)
    and bind your two charts to the F3 and set DV for % charts as 1 and # charts as 0.
    I hope this will helps you
    Thanks,
    Srinivas Dandamudi.

  • Dynamic XML with Weblogic ?

    hello all !!
    May be this question is already answered, and sorry for that, but here again !
    I am trying to use Weblogic server, in order to process XML files, this files
    make a query to my Oracle Data Base, Before this I was using Cocoon (apache) to
    generate the dynamic XML with the query's result, is there a way to make the same
    thing with Weblogic ? anybody know how to do it ? do yu have a simple example
    ? here is a sample code that I use with cocoon.
    <?xml version="1.0" ?>
    <?cocoon-process type="xsp"?>
    <xsp:page language="java" xmlns:sql="http://www.apache.org/1999/SQL"
    xmlns:xsp="http://www.apache.org/1999/XSP/Core"
    xmlns:request="http://www.apache.org/1999/XSP/Request">
    <page title="SQL Search Results">
    <sql:execute-query>
    <sql:driver>oracle.jdbc.driver.OracleDriver</sql:driver>
    <sql:dburl>jdbc:oracle:thin:@IP_Address:1521:cta</sql:dburl>
    <sql:username>User</sql:username>
    <sql:password>Password</sql:password>
    <sql:doc-element>My_table</sql:doc-element>
    <sql:row-element>record</sql:row-element>
    <sql:query>select * from My_table</sql:query>
    </sql:execute-query>
    </page>
    </xsp:page>
    Thanks a lot for your help !
    Gustavo Mejia
    INFOTEC

    Since Cocoon is a servlet, just install it in Weblogic.
    "Gustavo Mejia" <[email protected]> wrote in message
    news:3b5ca3fa$[email protected]..
    >
    hello all !!
    May be this question is already answered, and sorry for that, but hereagain !
    >
    I am trying to use Weblogic server, in order to process XML files, thisfiles
    make a query to my Oracle Data Base, Before this I was using Cocoon(apache) to
    generate the dynamic XML with the query's result, is there a way to makethe same
    thing with Weblogic ? anybody know how to do it ? do yu have a simpleexample
    ? here is a sample code that I use with cocoon.
    <?xml version="1.0" ?>
    <?cocoon-process type="xsp"?>
    <xsp:page language="java" xmlns:sql="http://www.apache.org/1999/SQL"
    xmlns:xsp="http://www.apache.org/1999/XSP/Core"
    xmlns:request="http://www.apache.org/1999/XSP/Request">
    <page title="SQL Search Results">
    <sql:execute-query>
    <sql:driver>oracle.jdbc.driver.OracleDriver</sql:driver>
    <sql:dburl>jdbc:oracle:thin:@IP_Address:1521:cta</sql:dburl>
    <sql:username>User</sql:username>
    <sql:password>Password</sql:password>
    <sql:doc-element>My_table</sql:doc-element>
    <sql:row-element>record</sql:row-element>
    <sql:query>select * from My_table</sql:query>
    </sql:execute-query>
    </page>
    </xsp:page>
    Thanks a lot for your help !
    Gustavo Mejia
    INFOTEC

  • Help using file sharing with different users accounts on same Macbook

    Hi, I just wanted a little help using the file sharing option. My wife and I had different users accounts on the same MacBook, but when I am trying to share my baby's picture from my documents folder for my wife to have the same picture, I can't find the way to do that; I am not been able to find my pictures on my wife's account. Is there any way that I could share a folder from my account and my wife to have the same files at the same time on her account?
    I mean, something like the smart play list on the itunes?
    Thank you

    You can't do that directly unless you change permissions on your whole Documents folder which is not a good idea. Your wife can see your Documents folder from her account by going to Users/yourusername/Documents. However, this folder has no read privileges for others except yourself by default so she won't be able to open it.
    rather than changing permissions on your Documents folder, you can place the pictures you want to share in Public folder in your home directory or in Users/Shared folder.

  • Trying to figure out how to use my xml with a tree component

    Hi All,
    I am trying to use a tree control for the first time and
    having a bit of difficulty. I have a Domino server that will
    generate XML for a specific view of information. The view looks
    just like what a tree control would look like. I wish I could paste
    a screen print . . .
    It looks like this:
    +/- ...01/31/2007
    ..+/- Steven Rieger
    ..........Company
    Name...Project-Number...Task-Name.....Total-Hours...Sat...Sun...Mon...Tue...Wed...Thu...F ri
    The Date and Name are collapsible .
    When I get the generated xml it's got a lot of crazy
    information in there that I don't need. I'm hoping someone can look
    at the xml below and provide some insight into how to parse it to
    achieve the look above.
    Thanks for your help!!!!
    - <viewentry position="1.1" noteid="80000008" children="2"
    descendants="6" siblings="30">
    - <entrydata columnnumber="1" name="$16"
    category="true">
    <datetime>20071026</datetime>
    </entrydata>
    - <entrydata columnnumber="7" name="TSTotHours">
    <number>53.5</number>
    </entrydata>
    - <entrydata columnnumber="8" name="TSHours_1">
    <number>6</number>
    </entrydata>
    - <entrydata columnnumber="9" name="TSHours_2">
    <number>9</number>
    </entrydata>
    - <entrydata columnnumber="10" name="TSHours_3">
    <number>6.5</number>
    </entrydata>
    - <entrydata columnnumber="11" name="TSHours_4">
    <number>8</number>
    </entrydata>
    - <entrydata columnnumber="12" name="TSHours_5">
    <number>8</number>
    </entrydata>
    - <entrydata columnnumber="13" name="TSHours_6">
    <number>8</number>
    </entrydata>
    - <entrydata columnnumber="14" name="TSHours_7">
    <number>8</number>
    </entrydata>
    </viewentry>
    - <viewentry position="1.1.1" noteid="8000000C"
    children="2" descendants="2" siblings="2">
    - <entrydata columnnumber="2" name="$15"
    category="true">
    <text>Steven Rieger</text>
    </entrydata>
    - <entrydata columnnumber="7" name="TSTotHours">
    <number>40</number>
    </entrydata>
    - <entrydata columnnumber="8" name="TSHours_1">
    <number>0</number>
    </entrydata>
    - <entrydata columnnumber="9" name="TSHours_2">
    <number>4</number>
    </entrydata>
    - <entrydata columnnumber="10" name="TSHours_3">
    <number>4</number>
    </entrydata>
    - <entrydata columnnumber="11" name="TSHours_4">
    <number>8</number>
    </entrydata>
    - <entrydata columnnumber="12" name="TSHours_5">
    <number>8</number>
    </entrydata>
    - <entrydata columnnumber="13" name="TSHours_6">
    <number>8</number>
    </entrydata>
    - <entrydata columnnumber="14" name="TSHours_7">
    <number>8</number>
    </entrydata>
    </viewentry>
    - <viewentry position="1.1.1.1"
    unid="8625721300797D8686257383001826AE" noteid="B4E"
    siblings="2">
    - <entrydata columnnumber="3" name="$178">
    <number>0</number>
    </entrydata>
    - <entrydata columnnumber="4" name="TSPCompany">
    <text>101955 - Acme Company, Inc.</text>
    </entrydata>
    - <entrydata columnnumber="5" name="TSPProject">
    <text>P03036 - CAC 07/08</text>
    </entrydata>
    - <entrydata columnnumber="6" name="TSPTask">
    <text>10134 - Import from Access to Notes</text>
    </entrydata>
    - <entrydata columnnumber="7" name="TSTotHours">
    <number>24</number>
    </entrydata>
    - <entrydata columnnumber="8" name="TSHours_1">
    <text />
    </entrydata>
    - <entrydata columnnumber="9" name="TSHours_2">
    <text />
    </entrydata>
    - <entrydata columnnumber="10" name="TSHours_3">
    <text />
    </entrydata>
    - <entrydata columnnumber="11" name="TSHours_4">
    <text />
    </entrydata>
    - <entrydata columnnumber="12" name="TSHours_5">
    <number>8</number>
    </entrydata>
    - <entrydata columnnumber="13" name="TSHours_6">
    <number>8</number>
    </entrydata>
    - <entrydata columnnumber="14" name="TSHours_7">
    <number>8</number>
    </entrydata>
    </viewentry>

    If the depth of the structure is constant, you can do it in a
    single function call. If you need to go down an unknown number of
    nesting levels, your function will need to be recursive.
    XML.children() gives you an XMLList of the child nodes. You
    can for-loop over this XMLList. Inside the for loop, add thexml you
    want to the new XML object.
    Tracy

  • Using external xml for spry menu help

    Just started playing with DW CS3, I would like to know how to
    insert a spry menu and get the xml data from an external file. Can
    anyone point me at a suitable example or tutorial please?

    The video workshop has some great tutorials with spry.
    http://www.adobe.com/designcenter/video_workshop/
    Aram

  • How to bind dynamic xml with Java objects without xsd

    have a question, and hope someone here can help me.
    In my current project, I will get a xml file, containing some information of each user, and map them into a set of user objects.
    For each user, there are some fixed attributes, such as name, phone#, age, position, etc. The problem is, client can customize, and add new attibutes, such as address, favorite color, so there will be no xsd for the xml.
    What I want to do, is map fixed attributes to user object attributes, for example, name attribute to User.name, and they will have corresponding getters, and setters, but for custom attributes, I want to add them to a HashMap in User object, for example, use string "ADDRESS" as the key, and address as the value.
    Is there any way I can do this? Thank you very much for any help you can provide.

    It would not be too hard to do in regular code.
    First, make a HashSet with the Strings for the names of the known attributes that will be processed with setters.
    Then, get the NamedNodeMap via getAttributes(). That will give you all attributes -- both the ones you will handle with your setters and the ones you will handle via a HashMap.
    Then, loop through the NamedNodeMap. For each attribute, get the name and value. If the name is in the HashSet of known values, process it with a list of
    if ( attName.equals( "name" ))
        whatever.setName( value );
       continue;
    }If it is not in the HashSet, then set the value into your HashMap with the name and value.
    There is no standard way to do this.
    Dave Patterson

  • Trying to use Dynamic Action with button - no #BUTTON_ID#

    I saw this post: Issue with apex  dynamic action
    and I'm having exactly the same issue. I'm using the Blue and Tan Theme and the button's "normal template" looks like the following:
    <table class="t2Button" cellspacing="0" cellpadding="0" border="0"  summary="">
    <tr>
    <td class="t2L"><a href="#LINK#"><img src="#IMAGE_PREFIX#themes/theme_2/button_left.gif" alt="" /></a></td>
    <td class="t2C"><a href="#LINK#">#LABEL#</a></td>
    <td class="t2R"><a href="#LINK#"><img src="#IMAGE_PREFIX#themes/theme_2/button_right.gif" alt="" /></a></td>
    </tr>
    </table>Can someone help me get the #BUTTON_ID# tag in the correct spot?
    (PS. This application was originally built using APEX 3.2 and upgraded to 4.1. Don't know if that matters or not.)

    The button calls a procedure which can take several minutes to complete. It calculates and stores values for display. I'd like to open up a modal window so that the user has more concrete feedback that the calculation process is underway. I'd also like to tie it to the refresh of a particular region on the page that shows a list of the stored calculations.

  • Need help using XWS-Security with EJB service endpoint

    I am trying to use XWS-Security along the lines of the JWSDP 1.6 examples, but with an EJB endpoint deployed in an ejb-jar file rather than a typical service endpoint deployed in a WAR.
    Any information on how to do this would be appreciated. I believe I'm close to getting an example working- the details on the problem I've encountered are below.
    I use WSCompile to generate stubs and ties for my WS, and XDoclet to generate the ejb-jar.xml. I deploy the ejb-jar on JBoss 4.0.2.
    The problem I'm having is that the security features are handled in the Stubs and Ties generated by WSCompile, and my server-side refuses to use the WSCompile generated Tie. Previously the web service had used the WSCompile argument 'import="true"', which generated no tie, and the web service worked (this was before I tried to add security features). Whatever mechanism had been used to direct messages to my EJB then is still being used now (JNDI, I believe, facilitated by the ejb-jar.xml and webservices.xml files), and bypassing the Tie class that I now generate using 'server="true"'.
    There must be some way I can reconfigure my webservice so that the WSCompile generated Tie is used, but I can't find any help on the topic.
    Can anyone tell me how to make sure my webservice will use the Tie class on the server side? Is it even possible when using EJBs instead of servlets?

    Burn your CD using iTunes. Then rip the music off of the CD using any "ripping" program. Just make sure the program you use has the "save as .wav" option available. Im not familiar with MusicMatch but I'm sure you would be able to use it.

  • Error Using OPENFILE Action with Process Menu

    Hi, all
    I want to open a perticular .xls file from custom menu using "openfile" keyword.
    It works from BPC for Excel working on server machine (same machine of which I install BPC server), but it doesn't work from client machine separated from BPC server.
    It seems that "openfile" is available, only when I specify a full path and open it from the BPC for Excel on the server machine.
    It does not work with relative path even on the server machine.
    I know that there was a problem on openfile in OutlookSoft v4.2, called "verified bug # 1444 in CPM 4.2 SP3 (4.2.406)".
    Is the case above means that the bug is still in v5.1?

    Sorry to my poor English, Nic.
    I guess I couldn't tell you what I want to do enough.
    /edit from here
    I want to open a Excel file in A TEAM FOLDER from custom menu.
    The TEAM FOLDER is in a server, one of the TEAM folders which path are like this:
    (ServerDriveName):\bpc\data\webfolders\appsetname\appname\TEAM1\
    The level of depth of its path is as same as the folder called COMPANY, I believe that's real path is :(ServerDriveName):\bpc\data\webfolders\appsetname\appname\eExcel\
    I want to open the files in the TEAM folders of server, not under the COMPANY eExcel folder, from custom menu.
    e.g.)
    C:\bpc\data\webfolders\appsetname\appname\TEAM1\testexcel1.xls
    I don't want to locate the files on servers, which I want to open from custom menu, under COMPANY eExcel folder.
    edit end/
    I'd like to show precise messages for perticular team to each users who is in the team. The messages are in the testexcel1.xls, but I have to hide them from users who belong to other team. So, as an first thought, I try to set up the each message files in each TEAM folders to hide from other users and show them to only appropriate users via custom menu.
    Please let me know if I'm trying in a wrong way.
    Thanks again.
    Edited by: Hiroki Kugimoto on Aug 8, 2008 2:35 AM

  • Using dynamic ViewLinks with JDeveloper 10g

    Hello.
    I'm displaing a list of data from tab1 with a sublist of data from tab2, which has a n:m cardinality relationship.
    Attributes:
    k1 - primary key of tab1
    k2 - primary key of tab2
    fk1 - foreign key of tab1 in rel
    fk2 - foreign key of tab2 in rel
    Before data iteration I create dynamic link using createViewLinkBetweenViewObjects(...) method of my ApplicationModule. I use assocClause parameter to define the way of the data association, e.g.:
    select <attrs> from tab2 where k2 in (select fk2 from rel where fk1=:1)Parameter :1 is replaced with k1 from tab1.
    This works fine, but whern I use parameter :1 more times in query, the JBO-27122 (SQL error during statement preparation. Statement: ...) is reported. I have used it with JDeveloper 9i and it worked properly.
    Thanks for any help

    Did you read my reply here:
    Jdeveloper with PVCS

  • Problems using Dynamic parameters with Crystal Reports and SBO 8.8

    Has anyone been able to successfully use a dynamic parameter in Crystal Reports with 8.8 using the Business One connector? When we try we get an additional logon to the database that pops up and the logon fails.
    We need this because we want to return live lists of PO documents from the server for selection. We are also trying to use nested dynamic parameters, because we want to first return the PO document based on the PO number, and then chose specific rows based on a field value in POR1.
    It works if we don't use the Business One connector, but then the report doesn't function properly inside of SAP.
    Any ideas would be appreciated.

    I have tried using tokens but they are too simple. I need something like a subselect where you first select one value and then another that is a subset of those values. Apparently the tokens can't even use a "where" clause.
    SAP dances around Dynamic parameters, but won't come out and say that they can't be used with the B1 connector. If that is the case then they should just say so and stop wasting our time. Apparently Crystal is not truely interfaced with B1, just sort of hanging out with it.
    I don't really care other than I have to do this select, subselect. If someone has a way to do that with tokens I would love to hear it.
    Thanks,
    Roy

  • Crashing while using dynamic linking with aftereffects

    I've been using premier for a while now but i believe i've fond a huge flaw in the dynamic link system. I own a multi-million dollar corporation that specializes in researching the answer for X divided by Zero and this bug is setting us back thousands everyday.
    The problem is when you import a Premier project into aftereffects and then import the same comp back into premier, the result is 8GB of ram wasted in a few seconds with both applications crashing. As you may have guess from our R&D type this sort of multiplication is unaceptable. Please fix.
    Regards, Tom Tomson @ Banana Systems Ltd.

    u mad bro?

  • Need help using 'visited' class with Colorbox

    Hi guys,
    I'm creating a site for a client that uses the Colorbox script for the store. When you click on a thumbnail of a product in the store, the browser uses Colorbox to display the external PHP page with the product information.
    This all works fine but what I would like to do is...
    When you click on a product thumbnail and it brings up the page (using Colorbox), when you close the Colorbox window and return to the thumbnails, I would like the padded background of the image to be a different color and not grey like the rest of them - so you can see which products you have looked at and which products you haven't.
    I've tried using...
    #productContainer img:visited {background-color:#0973ba;}
    ...but it didn't work.
    Click here for the link to the test site if that helps.
    Does anyone have any suggestions as to how I can achieve what I need to do?
    Thank you very much and I look forward to hearing from you.
    SM

    Did you try adding the pseudoclasses here?
    #content a {
        color: #0973BA; 
        text-decoration: none;

  • Using dynamic captions with checkboxes

    Hello.
    I want to create a list of checkboxes, according to a table I get from the context, meaning there would be as much checkboxes as the lines in the table, and their caption would be one of the table's fields.
    I turned on Show Dynamic Properties.
    First I tried it with one checkbox, with it's caption related directly to the table's field, and it worked - but with only one checkbox displaying the first line's value, of course.
    Next I put the checkbox in a subform. The subform is related to the table line, and is repeated for every row, and now the caption is only bound to the field's name, relatively.
    So the subform is repeated, but the caption doesn't change at all.
    How can it be done?
    And can I set the checkbox's caption by code? I tried, but it didn't work.
    Best regards,
    Udi.

    Hi,
    try using table control (supported in ALC 8.0) and add the checkboxe in the row.
    You can then map your data node (structure) with the table.
    Ashutosh

Maybe you are looking for

  • Voluntary dissolution of writ of garnishment

    Hi, I'd appreciate any insight into my situation.  I had a Chase credit card go bad.  They sued me and won a default judgement.  Froze my bank account.  I hired an attorney who filed a claim of exemption because I was the head of family supporting 3

  • Your favorite resources about effective learning in Captivate?

    Hi, I'm just getting started with Captivate, though I've been working in instructional design in digital publishing for education for a while. Now I'm going for my master's, and I'm planning on doing some hands-on action research about effective ways

  • Java Checker needs JRE to install??

    Hi Everyone, I have just downloaded the Java Checker for Personal Java and am having big trouble installing it. Could someone please advise. This is what it says in the install file: The JavaCheck installation file is a zip archive that contains a se

  • Roles Creation

    Hi All, I am trying to retrieve the roles of A User programatically. I have used userInfoControl.getAvailableUserRoles(req) and also tried using the P13nResource resource = new HierarchyRoleResource(entAppName,webAppName,EntitlementConstants.P13N_ROL

  • Using CSS class together with CSS Rule

    Hi, I design my web site in Dreamweaver and then use Web Developer 2005 Express for the dynamic stuff. I amalgamate all the work I have done in Dreamweaver into 2005 Express. However with the new server side controls I do not know how to add a CSS cl