To populate a tree with httpService

Hi,
i don't arrive to populate my tree with an httpService.
Here is the code
<mx:Tree width="30%" height="100%" id="arboChambre"
labelField="@name"
dataProvider="{restree.lastResult.chambres.type}"
labelFunction="displayNodeName" />
and the script in <mx:Script>
private function displayNodeName( item:Object ) : String {
var node:XML = XML(item);
return node.@name;}
the xml returned by httpservice
<?xml version='1.0' encoding='utf-8' ?>
<chambres>
<type name="standart">
<chambre name="chambre1"/>
<chambre name="chambre2"/>
<chambre name="chambre3"/>
<chambre name="chambre4"/>
<chambre name="chambre5"/>
</type>
<type name="superieur junior">
<chambre name="chambre9"/>
<chambre name="chambre10"/>
</type>
</chambres>
And in my application i see only five icons files but not
directory and not name of the files (or directory ....)
Can you say me where is my mystake.

Thank for your answers and sorry for my english
here is my httpservice definition in my file.mxml
quote:
<mx:HTTPService id="restree" url="
http://lesite.com/index.php"
useProxy="false" method="POST" >
<mx:request xmlns="">
<action>
getTree
</action>
</mx:request>
</mx:HTTPService>
If i don't want to use lasResult , i think that i must call
the data in AS3 but it's difficult for me to understand the
documentation in english ;I tried to use URLLoader but when i
compile i have a lot of mistake.
is it the good way to use URLLoader in <mx:script>???
thank you

Similar Messages

  • Populate hierarchical tree with Query "Select * from EMP"

    Dear(S)
    I want to populate a Hierarchical Tree to display results
    in a well alligned form as results usually display in SQL Plus environment.
    I try much using LPAD() and RPAD() function but fail to get required results.
    I want to display more than one field values by concatenating them.
    e.g.
    SMITH CLERK 800
    ALLEN SALESMAN 1600
    WARD SALESMAN 1250
    JONES MANAGER 2975
    Please someone guide me how i can allign more than one field values in a Hierarchical tree.
    Thanks and regards,
    Tanveer Ahmad.

    Dear Thiru,
    I have successfully populate the tree
    but i want to display these fields at a specific distance.
    How i can do it? (I have try it with LPAD() and RPAD() but fail.)
    Thanks
    Tanveer

  • Tree Doesnt populate the whole data with HTTPService request

    Hi,
    I am working with the tree control which populates the tree
    with the HTTPService request.
    Step1. Make a HTTPService Request and fetch the top level
    entries.
    Step2. When ever the user opens an treeItem by clicking on
    the Triangular icon besides the tree item
    Make a HTTPService, fetch the data, on the callback method
    append the Datasource with the new data for the item to open.
    problem is the tree branch gets populated with partial data
    instead of the full data where as the DataSource has the full data.
    Step3. when ever the user clicks on the item
    Make a HTTPService, fetch the data, on the callback method
    append the Datasource with the new data for the item to open.
    Now the tree item gets populated with the correct data.
    tried every thing to refresh the tree....

    private function refreshTree():void{
    tree.expandItem(rootNode, false);
    tree.expandItem(rootNode, true);
    this helped

  • Populating Tree with External XML File

    I want to use external files for populating Flex 3
    components. I have been successful using code very similar to that
    below for a data grid & for a combo box, but it won't work for
    a tree. Can you determine wh?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:HTTPService id="dp_Tree1" url="Tree1.xml" />
    <mx:Tree dataProvider="{dp_Tree1.lastResult.root.node}"
    creationComplete="dp_Tree1.send()" width="333"/>
    </mx:WindowedApplication>
    It's not working & I can't determine why. Attached is my
    xml file that I tested it with.

    Thanks a bunch folks, but my intent is to have as little code
    as possible. I want to help people who are not coders create
    designs using external xml files to populate controls. I was able
    to create very simple code with just two lines to populate a
    DataGrid from an external xml file:
    <mx:HTTPService id="dp_DataGrid1" url="DataGrid1.xml"
    />
    <mx:DataGrid
    dataProvider="{dp_DataGrid1.lastResult.component.rows}"
    creationComplete="dp_DataGrid1.send()" />
    And just two lines for a ComboBox:
    <mx:HTTPService id="dp_ComboBox1" url="ComboBox1.xml"
    />
    <mx:ComboBox
    dataProvider="{dp_ComboBox1.lastResult.component.rows}"
    creationComplete="dp_ComboBox1.send()" />
    Isn't it possible to populate a tree with two lines like as
    it is with a DataGrid & ComboBox?

  • Flex 4, is it possible to populate a tree component with sqlite table data?

    is it possible to populate a tree component with sqlite table data?
    If it is, how would I go about doing this?
    Thanks
    Kristin

    Hi Mustafa,
    it is true, the function can return component as type. This is more for the scenario, when you want to recognize some component based on some checks, eg.
    if(something)
    return CHECKBOX_1;
    else
    return CHECKBOX_2;
    so, the use case exists for sure. But of course the application itself is static.
    where do you see a scenario for dynamic creation of components?
    The only one component which can instantiate new components is the SplitCellContainer, and this is restricted to the drag&drop action from Fragment Bookmark Gallery. And this is again restricted to containers, as Fragment can hold containers as parent component. Of course the container content will be created/instantiated as well (I have coded example with ComponentManager in the Community SDK: Second Functional Application with SDK Components (Online Composition v.2) blog).
    As far I know there is no function in SplitCellContainer which would "simulate" the drop of a Fragment today (perhaps worth an Idea on this?). Having that - the scenario would be possible. Today, this can be made partly - but the user would need to drag&drop a prepared fragment with the component.
    Anyway, the problems will start after the creation - then it would be require to have also functions to re-position the new created component in some other container - this would be complex probably.
    Karol

  • How to populate a tree from .aspx file?

    Hi,
    I'm very new to flex. I have a .aspx file which has xml populated in it. I would like to populate the tree based on the values of the .aspx file. Here is my code which i have tried doing this functionality but it couldn't worked out. Could anyone help me out to resolve this problem.
    This is my sample aspx file:
    Sample.aspx:
    <?xml version="1.0" encoding="utf-8"?>
    <myTree label="Main Root">
    <node label="Root">
    <node label="Folder a">
    <node label="item 1 a"/>
    </node>
    <node label="Folder b">
    <node label="item 1 b"/>
    <node label="item 2 b"/>
    </node>
    <node label="Folder c">
    <node label="item 1 c"/>
    <node label="item 2 c"/>
    </node>
    <node label="Folder d">
    <node label="item 1 d"/>
    <node label="item 2 d"/>
    </node>
    </node>
    </myTree>
    Here is my mxml file which i was trying:
    TreefromXml.mxml:
    <?xml version="1.0" encoding="utf-8"?><mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="XmlRpc.send()">
    <mx:Script>
    <![CDATA[
    importmx.collections.ArrayCollection;
    importmx.rpc.events.FaultEvent;
    importmx.rpc.events.ResultEvent;
    importmx.controls.Alert;
    public var XmlNode:XML=newXML();
    public function HandleXml(event:ResultEvent):void
    XmlNode= new XML(event.result.myTree.node);
    tree1.dataProvider=event.result.myTree.node; 
    public function HandleFault(event:FaultEvent):void
    Alert.show(event.fault.faultString, "Error"
    ]]>
    </mx:Script>
    <mx:HTTPService id="XmlRpc" url="Sample.aspx" result="HandleXml(event)" fault="HandleFault(event)"> 
    </mx:HTTPService>
    <mx:Panel id="panel1" width="400" height="200"> 
    <mx:Label id="label1" text="Sample Label" /> 
    <mx:Tree id="tree1" labelField="@label"> 
    </mx:Tree> 
    </mx:Panel>

    Hi Wolfman,
    I do not understand what you are trying to say. My requirement is to fetch xml from .aspxfile and then use it to populate the tree structure in flex. It would be great if you could share me with the piece of code which suites my requirement. Thanks
    Regards,
    Saravana

  • ADF tree with command link

    Hello,
    I have a menu build with a tree and a region. When I click a link from the tree the region populate a page with another dinamic tree based on a session variable that refresh each time that i click a link from the first tree. After click the link I have a flow that has an executewithparams method and the page that will show the second tree.
    My problem is that the second tree doesn't refresh its branches at my first click on the link but on the second yes and I receive :
    <NavigationPaneRenderer><_renderContent> Warning: There are no items to render for this level
    <FormRenderer><setupEncodingContext> Multiple forms detected on viewId: /pages/index.jspx. Rich client currently has some limitations in dealing with multiple forms.
    I have set the autorefresh for the iterator but I haven't success.
    Can anyone help me?
    Thank you.

    Hi Frank,
    It's true that my execute with params method accessthe session scope attribute directly but in my page fragmet i haven't af:form
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:c="http://java.sun.com/jsp/jstl/core">
    <!--oracle-jdev-comment:preferred-managed-bean-name:backing_doc-->
    <af:panelGroupLayout id="pgl2">
    <c:set var="viewcontrollerBundle"
    value="#{adfBundle['.main.view.ViewControllerBundleMain']}"/>
    <af:panelGroupLayout id="pgl1" layout="vertical">
    <af:panelBox text="#{sessionScope.OrgMeniuId eq 920 ? viewcontrollerBundle.1 : viewcontrollerBundle.2}"
    id="pb1" styleClass="AFStretchWidth"
    binding="#{backing_doc.pb1}">
    <f:facet name="toolbar"/>
    <af:tree value="#{bindings.DocVO2.treeModel}" var="node"
    selectionListener="#{bindings.DocVO2.treeModel.makeCurrent}"
    rowSelection="single" id="t1" binding="#{backing_doc.t1}"
    fetchSize="-1" styleClass="AFStretchWidth"
    inlineStyle="font-size:small;">
    <f:facet name="nodeStamp">
    <af:group id="g1" binding="#{backing_doc.g1}">
    <af:commandLink id="cl1"
    text="#{node.Desc}#{node.DescOp}"
    action="#{backing_doc.ActionIdLink}"
    actionListener="#{backing_doc.discloseItem}"
    binding="#{backing_doc.cl1}" immediate="true"
    partialTriggers="::pb1">
    <af:setActionListener from="#{node.IdOp != null ? node.IdOp : node.Id}"
    to="#{sessionScope.backing_doc.actionId}"/>
    <f:attribute name="node" value="#{node}"/>
    <af:setActionListener from="#{node.IdOp != null ? node.DescOp : node.Desc}"
    to="#{sessionScope.OrgDocDesc}"/>
    <af:clientListener method="onDownload" type="action"/>
    </af:commandLink>
    <af:resource type="javascript">
    function onDownload(evt){ evt.noResponseExpected(); }
    </af:resource>
    </af:group>
    </f:facet>
    </af:tree>
    </af:panelBox>
    </af:panelGroupLayout>
    </af:panelGroupLayout>
    </jsp:root>

  • Flex component with HTTPService

    OK, so I'm a Flex newbie so forgive me if I'm missing the
    obvious.
    I created a Flex component that references a HTTPService to
    populate a DataGrid with data. As a standalone .mxml file, it works
    fine. When I place it into a Flex application where the component
    is referenced, the grid shows up, but I get no data. I've tried
    referencing the HTTPService in the application itself, no luck.
    I've tried referencing the service in a creationComplete function
    on the application page, no luck. I'm sure there's just some little
    snippet that allows the service to run in the component...the
    component looks fine when I run it, I just don't get any
    data.

    Thanks--actually I figured it out--I was overlooking
    something obvious. However, I have a new issue that I would
    genuinely appreciate assistance on.
    I am building a Flex app where I have 4 custom components.
    Each component calls a web service to pull data in. I am using an
    MXML application file to bring in each component with an additional
    component where the user can select a date range and submit that
    range to the various web services. So what I need to do is make the
    date fields public variables and then append those variables to the
    web service calls as name/value pairs.
    No matter what I do, I cannot seem to get the other
    components to recognize the date variables as public vars. I've
    written them out as variables as part of a public function, tried
    to make them bindable, nothing works...
    So for example, this is a simplified version of my date range
    component (using only one date), assuming I've named the component
    datebar.mxml:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="100%">
    <mx:Script>
    <![CDATA[
    public function clickHandler():void
    var sdate:String = start_date.text;
    ]]>
    </mx:Script>
    <mx:ApplicationControlBar width="100%" height="30">
    <mx:DateField id="start_date" />
    <mx:Button label="refresh" click="clickHandler();" />
    </mx:Label>
    </mx:ApplicationControlBar>
    </mx:Canvas>
    Then in another component using a web service, I place:
    <mx:HTTPService
    id="os_downloads"
    url="
    http://publishingdynamics.com/service.asmx?start_date={datebar.sdate}"
    useProxy="false">
    Where {datebar.sdate} is the variable I'm referencing to get
    a value from. I get a constant error doing this. I've tried several
    varitions. I can successfully create a public variable in the same
    manner not using a form value and get the component to display that
    variable using the same syntax, where I reference the source
    component like: {datebar.myvar} so I know the namespace referene
    works.
    Admittedly I'm not a very good ActionScripter...

  • Populate Flex tree control from mysql

    Hi
    I am just learning Flex and I started playing with the Tree
    control. I am trying to populate the Tree from Mysql using php and
    I am just hitting wall after wall.
    Please Help
    Thanks in advance

    quote:
    Originally posted by:
    ntsiii
    Stop running and get a map (read the documents)
    This is hardly a useful comment and must discourage new users
    from asking questions. If you think the documentation relating to
    the use of the tree control is straightforward then I beg to
    differ.
    If you are aware of a clear example of how to use the data
    tree with a php backend returning a remote data object please
    enlighten me. Meanwhile I continue my search but not within the
    livedocs.
    One site I have found that may be of use is
    http://flexdiary.blogspot.com/2009/01/lazy-loading-tree-example-file-posted.html
    Not everyone is an expert.

  • Traversing a tree with breadthFirstEnumeration

    Hi all,
    I'm trying to traverse a DefaultMutableNode tree using breadthFirstEnumeration. However, while traversing I need to remove some branches and continue with the Enumeration.
    Do you know any way to preserve the Enumeration after removing a branch???
    For example:
    for(Enumeration en = trial.breadthFirstEnumeration(); en.hasMoreElements() ;) {
                   DefaultMutableTreeNode currentNode = (DefaultMutableTreeNode)en.nextElement();
                   if((String)currentNode.getUserObject() == "2") {
                        ((DefaultMutableTreeNode)(currentNode)).removeAllChildren();
                   System.out.println((String)currentNode.getUserObject());
    This code traverses a tree with depth 3 and branching factor 3. In the meanwhile it removes node 2's children.
    However the otuput is
    0 1 2 3 4 5 6
    instead of: 0 1 2 3 4 5 6 10 11 12
    I'd be very grateful if someone can help me.
    Regards,
    Pesho

    This is how it usually is done.
    Start with an empty map, e.g. HashMap. The map has e.g. company name as key, and company as value.
    Start traversing, and do a lookup towards the map when you find a company reference. Use the company within the map if there is one, and create a new company and place it in the map if it doesn't exist. Populate the companies within the map with information when you bump into them during traversal.
    The map will contain fully populated companies when the traversal is completed, and all companies will reference the same instances since you always are checking the map.
    Kaj

  • Tree with multiple root nodes does not display

    I am trying to create a tree to display some hierarchical data which contains several root nodes.
    I have specifed that the TREE_ROOT value is always Null as the root nodes have a null value for the PARENT_ID. The page displays yet none of the data is displayed.
    I have manage to get it to work by creating a dummy single root that I reference from the existing root values?

    Phattam,
    The TREE_ROOT identifies the root node's ID, not its PARENT_ID.
    For example, if we build a tree on the oehr_employees table, the ID is EMPLOYEE_ID and the PARENT_ID is MANAGER_ID. therefore, to identify the start of the tree, we could populate the TREE_ROOT with a select statement e.g.
    SELECT employee_id FROM oehr_employees WHERE employee_id = 100This identifies a single value and the tree starts from employee_id 100.
    If we used a select statement that retrieves more than one row, e.g.
    SELECT employee_id FROM oehr_employees WHERE manager_id = 100then the tree starts at one of the children of employee_id 100 - ApEx will not show a tree that has more than one starting node. If you want to show these alternative starting points, you'll need to do exactly what you have done - create a 'dummy' root node.
    Hope this helps,
    Bryan.

  • Calling and re-calling with httpservice

    Here is a strange thing I ran into today. I have a program
    which queries a DB through an aspx script called with httpservice.
    A user clicks on a name, the query runs, and populates a form with
    data from the database. The user can then edit the information and
    submit the form to another script which makes changes to the DB.
    That is all working except that when the user clicks on the same
    name again, the old information is returned. I have verified that
    the DB is being altered with the submit script. If I close the
    application and reopen it and select the user again, then the
    modified data is there. Is there something I am missing the
    httpservice call? I've tried setting the array used for the result
    data to null. I even put just a text field on the page and printed
    the results of the query to it. It shows the old data too. It seems
    like it's not actually running the query again like it should, but
    rather taking the values from some place in memory until I close
    the app and reopen it. Any ideas?
    Relevant parts of my code are posted.

    OK...I've figured out that it is not actually calling the
    page again. I had my aspx page log an entry each time the page was
    called and for some reason, even though I am using the send(), it
    does not actually go out and resend the data to the page. Anyone
    know why?

  • How to build a BIG TREE with Tree-Form layout

    Hi,
    I do have a self-referenced table with our org structure - 15 000 positions.
    I do want to create a tree with this structure.
    Requirements :
    a, to have a tree-form layout
    b, to have search capabilities
    I have tried to use several combinations (maybe all)
    - from using only one View object and create recursive tree - doesn't even run
    - to use two View objects, first as top level nodes, the other as the rest - it runs
    but I can search only top level, and what is worse, by clicking on the node for showing additional information (tree-form layout) I'm waiting for ages for seeing the info
    (it seems that all records are loaded one by one into AS)
    Could you provide some ideas how to deal with this ?
    Thanks.

    I am sorry, this is beyond the scope of this forum.
    As with any functionality not directly provided by JHeadstart, you can build it yourself using the ADF design time tools in JDeveloper. Please use the JDeveloper forum for help on this first step.
    Then, to keep your pages generatable you can move these customizations to custom templates. We are happy to help you with this last step, should you have problems there.
    Steven Davelaar,
    JHeadstart Team.

  • How to populate a page with images in across/down direction?

    Hi,
    Does anyone know how to populate a page with images in across and down direction (for example 6 X 6 )? It seems that I cannot use data table because records are only running downward and each row can have one record.
    Any suggestion would be appreciated. thanks.

    Alex,
    You can create your own tabular form using APEX_ITEM API's
    Create report and you can put similar code to following
    SELECT APEX_ITEM.TEXT(1,col1) pk1, APEX_ITEM.TEXT(2,col2) pk2 FROM your_tableSo data will be displayed in TEXT boxes as if it's a tabular form. Now you need to handle INSERT/UPDATE/DELETE processes manually. You can easily handle INSERT and DELETE. But handling UPDATE can be a nightmare. What if user has updated both the column values?
    Updated details
    One way out would be to use ROWID as Primary key to handle DELETE and UPDATE
    SELECT APEX_ITEM.CHECKBOX(1,ROWID) tick, APEX_ITEM.TEXT(2,col1) pk1, APEX_ITEM.TEXT(3,col2) pk2 FROM your_tablebut yet I suggest to go for proper primary key..
    Regards,
    Hari
    Edited by: Hari_639 on Dec 3, 2009 6:52 PM

  • How to populate table rows with selected listbox items?

    Hello,
    I am trying to populate a table with selected listbox items. Each item should be a new row in the table. The picture below is the listbox and table I am using. I need to get the selected name to populate the Attendee column of the table when the user clicks the Add button. How do you do this with mutltiple attendees selected?
    Thank you,
    Angie

    So you're considering the fact the if the user clicks the button twice, the name will appear twice and you don't want this, right?
    Then you must check if any value is the same than the one you are about to add in the row..
    for (var i = 0 ; i < ListBox1.length; i++){
         if (ListBox1.getItemState(i) == true){
              for (var x = 0 ; x < Table1._Row1.count; x++){
                   var boNewAttendee = true;
                   var strAttendee = Table1.resolveNode("Row1[" + x.toString() + "]").txtAttendee;
                   var newAttendee = ListBox1.getDisplayItem(i);
                   if (strAttendee.rawValue == newAttendee){
                        boNewAttendee = false;
                        break;
              if (boNewAttendee){
                   txtAttendee.rawValue = ListBox1.getDisplayItem(i);

Maybe you are looking for