Getting Tree data with a twist

I just started playing around in flex and am excited about
the possibilities. I read the previous question and answers on
Getting Tree data by an HTTPService, but cannot get it to work with
my xml data. I have an xml file which doesn't have the regular node
tags for a tree's dataprovider. I was wondering if there was a way
to get a tree to populate with data while using multiple tag names
and descriptions encased within those tags. Here is an example of
my xml data to show you what I mean:
<?xml version="1.0" encoding="utf-8"?>
<catalog>
<product product="Nokia">
<name>Nokia 6010</name>
<description>Easy to use without sacrificing style,
the Nokia 6010 phone offers functional voice communication
supported by text messaging, multimedia messaging, mobile internet,
games and more</description>
<price>99.99</price>
</product>
<product product="Nokia">
<name>Nokia 3100 Blue</name>
<description>Light up the night with a
glow-in-the-dark cover - when it's charged with light you can
easily find your phone in the dark. When you get a call, the Nokia
3100 phone flashes in tune with your ringing tone. And when you
snap on a Nokia Xpress-on™ gaming cover*, you'll get
luminescent light effects in time to the gaming
action.</description>
<price>139</price>
</product>
</catalog>
Using this data, I would expect to have one folder called
"Nokia" which has two files called "Nokia 6010" and "Nokia 3100
Blue".
So I have been searching the internet to see if I could get
this xml format to work with a tree and this is the code I have so
far:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="horizontal"
creationComplete="treeXML.send();">
<mx:Script>
<![CDATA[
public function fixLabel(item:Object):String {
var node:XML = XML(item);
if( node.localName() == "product" )
return unescape(node.@product);
else if( node.localName() == "name" )
return unescape(node.@name);
else
return '';
]]>
</mx:Script>
<mx:HTTPService id="treeXML" url="data/catalog.xml"
resultFormat="e4x"/>
<mx:Panel width="30%" height="100%"
layout="horizontal">
<mx:Tree width="100%" showRoot="true"
horizontalScrollPolicy="auto"
height="100%" id="mytree"
dataProvider="{treeXML.lastResult.node}"
labelField="@name" labelFunction="fixLabel" />
</mx:Panel>
<mx:Panel width="70%" height="100%" id="panel1"
layout="horizontal">
</mx:Panel>
</mx:Application>
However, nothing is being populated in the tree. Can somebody
please help me with this. I would think that this problem has been
solved before but I don't know where to look.
Thank you for your help.

Thanks for the reply. I definitely couldn't come up with that
on my own at this stage of the game. I wonder if you could answer
two more questions. How do I tell the node.@name to be a leaf
instead of a folder? I changed a small piece in your code to handle
the data inside the XML tags. Now I am getting two levels of
folders with labels on them. Thats fine but how would I get rid of
the the rest of the folders that I don't give a label?
Say you have the following xml data:
<?xml version="1.0" encoding="utf-8"?>
<program name="someprogram">
<system name="Mechanical 1">
<docs name="other Systems">
<schematic name="Schematic" description="" url=""/>
<guide name="Familiarization" url=""/>
</docs>
<docs name="Block Systems">
<schematic name="Schematic" description="" url=""/>
<guide name="Familiarization" url=""/>
</docs>
<docs name="Block 2">
<schematic name="Schematic" description="" url=""/>
<guide name="Familiarization" url=""/>
</docs>
<docs name="Suppressor">
<schematic name="Schematic" description="" url=""/>
<guide name="Familiarization" url=""/>
</docs>
</system>
<system name="Mechanical 2">
<docs name="Pneumatics">
<schematic name="Schematic" description="" url=""/>
<guide name="Familiarization" url=""/>
</docs>
<docs name="Block 1">
<schematic name="Schematic" description="" url=""/>
<guide name="Familiarization" url=""/>
</docs>
<docs name="Block 2">
<schematic name="Schematic" description="" url=""/>
<guide name="Familiarization" url=""/>
</docs>
</system>
<system name="Electrical"/>
</program>
How would I bind the selected item in the tree to some text
boxes so that the relevant descriptions and url's would show up
depending the selection? I know how to bind data when I don't use
the "e4x" xml data format but I can't get around it by using a
tree.
I would love to hear any advice you could give me.
Thanks again.

Similar Messages

  • How can I  get System dates  with time scheduler using threads

    how can I get System dates with time scheduler using threads.is there any idea to update Date in my application along with system Date automatic updation...

    What the heck are you talking about and whatr has it to do with threads?
    Current time: System.currentTimeMillis. Date instances are not supposed to be updated.

  • How to get max(date) with BI Answers?

    Hi,
    I have a fact table with costs of projects and several dimension tables. The data in the fact table is stored day-based and is related to a time dimension. Additionally there is a relation between the fact table and the project dimension. A project has several dimension attributes like "current"
    Now I want to create the following query in BI Answers:
    Get the costs to a project where the "current" attribute was set to Y and show the related date.
    My thoughts were, that I'm looking in the project dimension where the "current" attribute is set to Y and do a join on the fact table. Therefore I get several dates, because there are more than one day where the project status was set to Y. How can I get the last, highest date?
    Greetings

    Hi,
    Maybe you could order by date descending and show the Top N (=1).
    Good Luck,
    Daan Bakboord

  • Cannot get wanted data with MAX and GROUP BY function

    Hi
    All
    I have a table like below:
    COLUMN     TYPE
    USER_ID     VARCHAR2 (10 Byte)
    PROCESS_ID     VARCHAR2 (30 Byte)
    END_TIME     DATE(STAMP)
    TO_LOC     VARCHAR2 (12 Byte)
    TO_LOC_TYPE     VARCHAR2 (15 Byte)
    FROM_LOC      VARCHAR2 (12 Byte)
    ITEM_ID     VARCHAR2 (25 Byte)
    CASES     NUMBER (12,4)
    LMS_UDA1      VARCHAR2 (250 Byte)
    ZONE     VARCHAR2 (2 Byte)
    I only want get one record with all columns, only have one clause MAX(END_TIME)
    But the other column have difference value.
    when i use MAX(END_TIME) and GROUP BY USER_ID,PROCESS_ID,CASES,....
    the sql didnot give one record,
    It give many records
    Please help me on this
    Regards
    Saven

    Hi, Saven,
    Sorry, it's unclear what you want.
    Whenever you have a question, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    If you can show your proiblem using commonly available tables, like those in the scott or hr schamas, then you don't have to post any sample data: just the results and the explanation.
    Always say what version of Oracle you're using.
    See the forum FAQ {message:id=9360002}
    Are you trying to see all data related to the highest (that is, latest) end_time?
    I think you want something like this, that finds all the ionformation about the employee with the latest hiredate:
    WITH     got_r_num     AS
         SELECT     emp.*
         ,     ROW_NUMBER () OVER (ORDER BY  hiredate  DESC  NULLS LAST)
                   AS r_num
         FROM     scott.emp
    SELECT     *     -- Or list all columns except r_num
    FROM     got_r_num
    WHERE     r_num     = 1
    ;What do you want in case of a tie, that is, if 2 or more rows have the same latest end_time? You may need to add tie-breaking expressions to the analytic ORDER BY clause, and/or use RANK instead of ROW_NUMEBR

  • Get Additional Data with BAPI_DOCUMENT_GETDETAIL2

    Hello,
    I´m using BAPIs with VBA (MS Office). I´m able to get Detail Data for a document with the Function Module BAPI_DOCUMENT_GETDETAIL2. But trying to get Additional Data for a document with this BAPI doesn´t work because the required (?) table CHARACTERISTICVALUES is not active.
    Is there any chance to get the Additional Data for a document with using VBA? Thanks for help!
    Best regards
    Robert

    Karlo,
          Inorder to find answers to your questions I reccommend that you do the following.
    1. Go to transaction SE 37 ( If you do not have authorization obtain one, normally an ABAP auth).
    2. Type the name of the FM as BAPI_DOCUMENT_CREATE
    3. Press F8
    4. Goto --> Documentation
    5. SAP has given a sample program, there.
    6. You  can copy the code, create a test ABAP program and test with different values for the class and characterestics and try to post the document.
    7. Also in the documentation, you will find an explanation from SAP on the use of the BAPI.
    If you have further questions, let me know,
    Sojan

  • Get the data with more than one of the desired value

    Hi,
    I need to pull the records with more than one value of 'Other' on the delivery days fields.
    The delivery fields are mon,tue,wed,thu,fri and sat that tells the where the item will be delivered. The value can be Home, Work, or Other.
    Here is the Sample data:
    cust_id: 123
    item: newspaper
    mon: Home
    tue:Work
    wed: Other
    thu: Home
    fri: Other
    sat: Other
    And here is my query so far.
    select
    cust_id,
    item,
    mon,
    tue,
    wed,
    thu,
    fri,
    sat,
    sum(case when (del_mon = 'O' or del_tue ='O' or del_wed ='O' or del_thu ='O' or del_fri ='O' or del_sat='O') then 1
    else 0 end) as day_ctr
    from customer
    Could you please help me with the right formula I need to get this?
    Thank you in advance..

    First
    DESC customer
    Second
    Can you explain what you are trying with
    sum(case when (del_mon = 'O' or del_tue ='O' or del_wed ='O' or del_thu ='O' or del_fri ='O' or del_sat='O') then 1 else 0 end) as day_ctr
    Third
    Usually it's helpful a example of the result you want...
    Perhaps you want this
    select DECODE(mon,1,(select distinct mon from customer), 'OTHER') mon,
            DECODE(tue,1,(select distinct tue from customer), 'OTHER') tue,
            DECODE(wed,1,(select distinct wed from customer), 'OTHER') wed,
            DECODE(thu,1,(select distinct thu from customer), 'OTHER') thu,
            DECODE(fri,1,(select distinct fri from customer), 'OTHER') fri,
            DECODE(sat,1,(select distinct sat from customer), 'OTHER') sat from
    select
    COUNT(DISTINCT mon) mon,
    COUNT(DISTINCT tue) tue,
    COUNT(DISTINCT wed) wed,
    COUNT(DISTINCT thu) thu,
    COUNT(DISTINCT fri) fri,
    COUNT(DISTINCT sat ) sat
    from customer
    )

  • Get html data with java

    Ok say I want to get some kind of data from a html page? How could it be done? Is this possible with java, or do I have to use some kind of scripting language?

    It looks like what you might be looking for is a method of getting HTTP, not HTML, data. HTML is simply text and can therefore be retrieved any way that a File could be retrieved (using a FileReader/FileWriter). HTTP, on the other hand, is the protocol that we use the most when viewing websites.
    If you're looking to make HTTP request, you may want to look into something like java.net.HttpURLConnection. Try searching these forums for HTTP, not html.

  • Custom Exit - Get System Date with user input

    I am using a BW query to connect to a BOBJ universe.  Some reports from the universe must be scheduled to run for today's date and emailed to a user.  Unfortunately, we cannot determine "today" dynamically when scheduling in BOBJ.  There will be other reports filtered with a range.
    I want to create a BW custom exit variable to allow user input.  My idea is to take the user input, like "01/01/1904", and replace the value with today's date.
    Is this possible?
    Here's example code for what I am trying to achieve.
    IF user input = "01/01/1904" then get today's date.
    else use the values from the user input.
    Scenario 1: user inputs 08/01/2010 - 08/31/2010 the custom exit returns values 08/01/2010 - 08/31/2010
    Scenario 2: user inputs 01/01/1904 the custom exit returns 09/03/2010 (today)

    Hi,
    In your case, i_vnam variable and processing variable for below statement would be same.
    LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'variable name'.
    Please see the below article for reference.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20f119d9-922d-2c10-88af-8c016638bd90?quicklink=index&overridelayout=true

  • Is there any way to get tables data with out having backup.

    Hi !
    my tnslistner is not working that is why i am not able to login in my database
    so i have planned to reinstall it and if posible get my database back from old files.
    i do not have backup,
    is there any way to get tables and data back.
    yours sincerely

    the out put of the sqlplus/ as sysdba is as followes
    Error 6 initializing sql*plus
    sp2-0667: message file sp1<lang>.msb not found
    sp2-0750: you may need to set ORACLE_HOOME to your oracle software directory
    the listener.ora at
    C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
    (PROGRAM = extproc)
    (SID_DESC =
    (SID_NAME = CLRExtProc)
    (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
    (PROGRAM = extproc)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = abc)(PORT = 1521))
    DEFAULT_SERVICE_LISTENER = (XE)
    yours sincerely

  • Method GET return data with plsql

    Hello! Its return a Json with source type PLSQL? Not want to use sys.htp.print.
    Example:
    begin
    select .... or procedure... or function...
    return X;
    end;

    Your question is not very clear.
    SELECT
    If "source type" is "Query", "Query one row", "Feed", or "Media Resource":  You must supply a SELECT statement.
    yes, you can use a function in a SELECT statement.
    select f( :input ) as pseudo_col_name from dual;
    Also, PIPELINE FUNCTION comes to mind.
    PL/SQL
    If "source type" is "PL/SQL"
    (as far as i know) The only way to return data from "an anonymous PL/SQL block" to the web browser is by using the sys.htp package.
    If you have a large amount of data to return (eg > 32,767 bytes), you'll need to LOOP over the CLOB.
    Since you want JSON format, you will need to use a package like dtr's package or build-your-own.
    (I like this site:  https://code.google.com/p/plsql-utils/ )
    MK

  • Date with a Twist

    Hello guys hop you can you a newbie !
    I'm trying to create a field within my form that only accepts two options:  a valid date (any date) or the word "clean".  Example:  09/05/2012 or "clean".  Is that possible?
    Thank you,
    CJ

    Yes, but you will need to use your own custom validation script.
    Basically you can use something like this:
    // Allow only a blank value, the word "clean" or a valid date string
    event.rc == event.value=="" || event.value=="clean" || (util.scand("dd/mm/yyyy"), event.value)!=null);
    (I had assumed your date format is dd/mm/yyyy, although it can be the other way around as well... Adjust it if necessary)

  • Query to get the date from to

    hello anyone,
    How can I create a query having 2 date and 2 variable of kind:
    from 1 date 05/06/2004
    to   2 date 15/06/2004
    yes for 2 days
    no for  1 day
    that is,
    i wish get the date with yes for 2 days and not for 1 day, this is, that I want
    05/06/2004 sabato
    06/06/2004 domenica
    08/06/2004 martedì
    09/06/2004 mercoledi
    11/06/2004 venerdi
    12/06/2004 sabato 
    14/06/2004 lunedi
    15/06/2004 martedithanks in advance

    Hi,
    The WHERE clause controls which rows will be displayed.
    If your requirements change, change the WHERE clause to reflect them.
    For example:
    DEFINE     from_date     = "TO_DATE ('05/06/2004', 'DD/MM/YYYY')"
    DEFINE     to_date          = "TO_DATE ('15/06/2004', 'DD/MM/YYYY')"
    DEFINE     yes_cnt          = 3
    DEFINE     no_cnt          = 2
    SELECT  &from_date + LEVEL - 1        AS dt
    FROM     dual
    WHERE     MOD ( LEVEL
             , &yes_cnt + &no_cnt
             )          BETWEEN  1
                       AND      &yes_cnt
    CONNECT BY  LEVEL <= 1 + &to_date
                         - &from_date
    ORDER BY  dt;This will work as long as you want the first &yes_cnt rows to be displayed (assuming there are that many), and the next &no_cnt rows not to be displayed, then another &yes_cnt rows to be displayed and another &no_cnt rows not to be displayed, and so on.
    I assume that &yes_cnt is a postive integer, and that &no_cnt is a non-negative integer. (That is, &no_cnt may be 0.)

  • Problem getting the Table Data with the selection listener

    Hi All,
    I am working on a tree and table components. I wrote a logic in the backing bean in such a way that when I expand a node the child nodes for the tree are getting added dynamically and also getting the data in the table for the node expanded in the tree using the same Toplink Query . I added the selection listener for the table and when I am selecting a row in the table I am getting the Null Pointer Exception as the RowKeySet Value for the row selected is coming null.
    Can any one please help me out with this problem
    I will be very thankful
    Regards,
    Madhavi.

    Hi All,
    I am working on a tree and table components. I wrote a logic in the backing bean in such a way that when I expand a node the child nodes for the tree are getting added dynamically and also getting the data in the table for the node expanded in the tree using the same Toplink Query . I added the selection listener for the table and when I am selecting a row in the table I am getting the Null Pointer Exception as the RowKeySet Value for the row selected is coming null.
    Can any one please help me out with this problem
    I will be very thankful
    Regards,
    Madhavi.

  • How can we get Dynamic columns and data with RTF Templates in BI Publisher

    How can we get Dynamic columns and data with RTf Templates.
    My requirement is :
    create table xxinv_item_pei_taginfo(item_id number,
    Organization_id number,
    item varchar2(4000),
    record_type varchar2(4000),
    record_value CLOB,
    State varchar2(4000));
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'USES','fever','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'HOW TO USE','one tablet daily','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'SIDE EFFECTS','XYZ','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'DRUG INTERACTION','ABC','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'OVERDOSE','Go and see doctor','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'NOTES','Take after meal','TX');
    select * from xxinv_item_pei_taginfo;
    Item id Org Id Item Record_type Record_value State
    493991     224     1265-D30     USES     fever     TX
    493991     224     1265-D30     HOW TO USE     one tablet daily     TX
    493991     224     1265-D30     SIDE EFFECTS     XYZ     TX
    493991     224     1265-D30     DRUG INTERACTION     ABC     TX
    493991     224     1265-D30     OVERDOSE      Go and see doctor     TX
    493991     224     1265-D30     NOTES     Take after meal     TX
    Above is my data
    I have to fetch the record_type from a lookup where I can have any of the record type, sometime USES, HOW TO USE, SIDE EFFECTS and sometimes some other set of record types
    In my report I have to get these record typpes as field name dynamically whichever is available in that lookup and record values against them.
    its a BI Publisher report.
    please suggest

    if you have data in db then you can create xml with needed structure
    and so you can create bip report
    do you have errors or .... ?

  • When I try to open a Pages document from iCloud, created on my iPad, I get message stating I need a newer version of Pages.  When I go to app store all I get is "installed" when looking at pages app. my Macbook pro is up to date with all updates.

    When I try to open a Pages document from iCloud, created on my iPad, I get message stating I need a newer version of Pages.  When I go to app store all I get is "installed" when looking at pages app. my Macbook pro is up to date with all updates. Any ideas?

    You have 2 versions of Pages on your Mac.
    Pages 5 is in your Applications folder.
    Pages '09/'08 is in your Applications/iWork folder.
    You are alternately opening the wrong versions.
    Pages '09/'08 can not open Pages 5 files and you will get the warning that you need a newer version.
    Pages 5/5.01 can not open Pages 5.1 files and you will get the warning that you need a newer version.
    Pages 5.1 sometimes can not open its own files and you will get the warning that you need a newer version.
    Pages 5 can open Pages '09 files but may damage/alter them. It can not open Pages '08 files at all.
    Once opened and saved in Pages 5 the Pages '09 files can not be opened in Pages '09.
    Anything that is saved to iCloud is also converted to Pages 5 files.
    All Pages files no matter what version and incompatibility have the same extension .pages.
    Pages 5 files are now only compatible with themselves on a very restricted set of hardware, software and Operating Systems and will not transfer correctly on any other server software than iCloud.
    Apple has not only managed to confuse all its users, but also itself.
    Note: Apple has removed over 100 features from Pages 5 and added many bugs:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Archive/trash Pages 5, after exporting all Pages 5 files to Pages '09 or Word .docx, and rate/review it in the App Store, then get back to work.
    Peter

Maybe you are looking for

  • Calendar Display Issue

    Hi all, i have a few links an a page, wich open the calendar. for example "May", "June", July" wich open the respective month. I provide a Startdate to the calendar (YYYYMMDD) but it always starts with the current month or (if i click trough the mont

  • Cannot sync calendar to iPhone 3G

    In iTunes, I was asked to set up my iPhone, 3G, to sync with mobile me. Well, I did whatever the set up was and it has not synced ever since. I would like to go back to the "old" sync, which worked great and transferred entries between my iMac and iP

  • New gesture trackpad options not showing up in Lion

    Why would the new trackpad options not show up after upgrading to Lion and downloading all of the updates? It's not as easy to get between full screen apps without the ability to swipe.

  • From FCP7. COLOR before MOTION?

    Should I color correct before exporting to Motion 4 for graphics? Could use a little help on the workflow best practices... Thanks.

  • Me Account Folders

    When adding new folders in Me Account Mail they append at the bottom rather than alphabetize.  Is there a way to set up preferences so new folders automatically alphabetize?