Flex Tree/Webservice Interaction

Hi All... I'm trying to fill a tree with the result of a web
service, and then trigger that web service again when a node is
opened. I'll try to explain....
I have a webservice that returns facility information. I feed
it a facilityID and it gives back facilities and devices that are
assigned to that facility. So this webservice can allow you to
drill down...i.e. facility 1 has device x,y,and z and facility 2,
send 2 to the WS and get back devices a,b, and c.
My problem is that I can't seem to figure out how to do this.
I have the web service definition:
<mx:WebService id="gssdata" showBusyCursor="true" wsdl="
http://localhost/GSSData/service.asmx?WSDL">
<mx:operation name="facilityList" resultFormat="e4x"
fault="showFault(event)" result="getFacilityResult(event)" >
<mx:request>
<sID>{idField.text}</sID>
</mx:request>
</mx:operation>
</mx:WebService>
and I call the tree:
<mx:Tree id="tree" top="72" left="50"
dataProvider="{facilityMainData.facilityListResult.facilities.facility}"
height="224" width="179" itemOpen="itemClick(event)"
labelFunction="treeLabel"/>
I'm able to load the page and see the initial data in the
tree, but I can't figure out how to do the itemOpen Event. How can
I call the web service and get the result of the web service
without changing all that's in the tree already? Do I somehow have
to have another event handler for this? and if so, how do I tell
that handler what node to add the results to?
I'm really stumped by this, so any help anyone could give
would be really appreciated!!!
thanks,
Adam

hi theosa
try these
<folder label="XXX" isBranch="true"/>

Similar Messages

  • Populate Flex Tree from Java Code (Database)

    Hi
    Can someone please help me? I'm very new to using flex. I'm
    basically trying to create a tree that is populated from data in my
    database. I am using hibernate to fetch that data.
    The plan is to basically create the tree in Java code (since
    I don't want any processing done on the client PC) and then pass
    this to the flex tree (or an actionscript data structure that is
    compatible as the tree datasource)
    I am creating the java tree using DocumentImpl. Is this
    correct? What class would work?
    Element e = null;
    Node n = null;
    Document xmldoc= new DocumentImpl();
    Element root = xmldoc.createElement("USERS");

    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.

  • Dataprovider for Flex Tree

    how do you dynamically populate nodes in the Flex tree with data from a database?
    For example... if I have a node for Groups and a database for names of groups... how would I populate the child nodes of the Groups folder with the names of the groups in the database?

    alright i'll experiment. you may be able to help me understand why this isn't working though... this is the route i was going down:
    i wanted to convert this mxml to actionscript and bind it to the tree (so i can add results from my dataprovider):
        <mx:XMLListCollection id="treeData">
            <mx:source>
          <mx:XMLList>
                  <node label="Items">
                      <node label="Open"/>
                      <node label="In Progress"/>
                  </node>
          </mx:XMLList>
            </mx:source>
        </mx:XMLListCollection>
    and i was trying this code to make it bindable:
    var stringData:String = '<node label="Items">' + '<node label="Open"/>' + '<node label="In Progress"/>'
    + '</node>';
    var treeData= new XMLList(stringData);
    but when i use actionscript to create the treeData variable... and use {treeData} as the binding data... nothing shows in my tree.

  • How we can show the xml data without any attribute in a flex tree (without having any label field) ?

    how we can show the following data in a flex tree (without having any
    label field) ?
    <?xml version="1.0"?>
    <rootNode>
            <childNode>
            < subchildNode >
                    <valueNode>1000</valueNode >
                    < valueNode >999-888-777</valueNode >
                    < valueNode >STORTZ</valueNode >
                    < valueNode >PAM STORTZ</valueNode >
                    < valueNode >88 ST. MORTON ROAD</valueNode>
            </subchildNode>
            </childNode >
    </rootNode >

    as is - no how
    wrap those xml chunk with a class having clear public properties like:
    public class dataRecord {
         protected var xml:XML;
         function dataRecord(xml:XML) {
              this.xml = xml;
         public function get id ():String {
              return XML(xml.descendants("valueNode")[0]).toString();
         // and so on
    simpliest way is to change xml structure to use attributes than wrapping that thing with AS code, it's time consuming and non efficient.

  • How to Flex tree control using folder click event  to pass coldfusion to get data from dynamiclly ?

    Hi friends.........
                Iam using flex tree control data coming from coldfusion file to display grid. As i click the tree folder to change the data from dynamic from grid.
    How to pass the folder id from coldfusion file.. Is it possible ?.. Means give any example please....
    Any One Help Me......
    With Regards.,
    Lingu.......

    When you set the dataProvider for your tree control, you actually pass an array or arraycollection or whatever to that property. The array contains objects coming from your server, right? Each object should contain a property with the folder id, something like:
    var arr:Array = [{id: 1, folderID: 34, name: "..."}, {id: 2, folderID: 4, name: "..."}, ...];
    Now, when you click an item in your tree or your dataGrid, you can access the folder id by:
    myTree.selectedItem.folderID
    Hope this helps
    Dany

  • Change the root of Flex Tree dynamically

    I have a Flex Tree constructed dynamically. The dataprovider is xmllistcollection.The user clciks on a button to add an item(node) to the tree.
    when user tries to add 2nd item to the tree I want to create root(with a button) at the top automatically.
    So  a Root need to be created dynamically after 2nd item is added.
    Can someone please help me in getting this.
    I am using MXTreeItemrender  as Itemrender and was able to add nodes. But I could not get the third item(I am taking this xml node as Branch and adding) added to the top of the tree.
    Any help is very much appreciated

    Or in APEX 4.0 this can be done using a Dynamic Action that executes JavaScript code to change the region title.
    Give the region a static region ID for use in a jQuery selector.
    As solutions may be dependent on APEX version&mdash;among other factors&mdash;always specify the following information in your initial post:
    <li>APEX version
    <li>DB version and edition
    <li>Web server architecture (EPG, OHS or APEX listener)
    <li>Browser(s) used
    <li>Theme
    <li>Templates
    <li>Region type

  • Flex Tree Vertical Scroll Bar Issue

    When i click on the + image of flex tree than first time the vertical scroll bar is not coming but when when i minimize it and again click on + than it appears can any one tell me what is the issue??

    Hi Rob,
    I have tried changing styles of those div's in  which I have my dropdown's are there but it didnt work.
    Below is the code for reference:
    <div class="k-animation-container km-popup" style="width: 250px; height: 206px; margin- padding- padding-right: 10px; padding-bottom: 15px; display: none; "><div class="k-list-container k-popup k-group
    k-reset" id="MaintenanceType-list" data-role="popup" style="height: 200px; display: none; font-family: 'Segoe UI', Verdana, Tahoma, Arial; font-size: 11px; font-style: normal; font-weight: normal; line-height: normal; width: 244px; -webkit-transform: translateY(-206px);"><ul
    unselectable="on" class="k-list k-reset" tabindex="-1" role="listbox" aria-hidden="true" id="MaintenanceType_listbox" aria-live="off" style=""><li tabindex="-1" role="option" unselectable="on" class="k-item"></li><li tabindex="-1" role="option"
    unselectable="on" class="k-item">AUX - Accessories belonging to EA group</li><li tabindex="-1" role="option" unselectable="on" class="k-item">ARL - Artificial Lift</li>
    Regards,
    Jyothi

  • Edit node name in flex tree

    I want to edit a node in flex tree. Editable property of the
    tree makes all nodes editable based on "SELECT" action . But now
    based on my custom selection I want to edit a particular node. I
    thought of custom item renderer and item editor but that applies to
    all the nodes on "SELECT" action. Please let me know how to edit
    particular nodes based on particular action.
    Ex: On click of a button i want to edit the name of node
    (Node is just text with folder icon).
    Tx..
    Flextron

    Flextron,
    I was trying to find an answer to the same issue. After
    walking through the Tree and List class a bit I came up with this.
    Here is an example where the Tree is not editable and double
    clicking a node will allow you to rename it.
    tree.addEventListener( ListEvent.ITEM_DOUBLE_CLICK,
    itemDoubleClick );
    tree.addEventListener( ListEvent.ITEM_EDIT_END, itemEditEnd
    private function itemDoubleClick( event:ListEvent=null
    ):void
    tree.editable = true;
    tree.editedItemPosition = {rowIndex:tree.selectedIndex};
    private function itemEditEnd( event:ListEvent=null ):void
    tree.editable = false;
    - Jank

  • Flex tree

    Hi. I have some problem with Flex tree component.
    When I have XML (1), then I have correct tree output
    folder
    -item
    -item
    But when I create something like(2) , then I will have folder
    XXX like item.
    How can I solve it ?

    hi theosa
    try these
    <folder label="XXX" isBranch="true"/>

  • Issue with child items of flex tree using QTP

    Hi,
    We are trying to automate Flex web application using QTP10.
    We are facing below issue with Flex tree when we try to automate a scenario of selecting a child item displayed in flex tree.
    Issue:
    On recording the step of selecting an item from Flex tree using QTP, the script displayed is .Select Index1. But when we replay it back no action is being performed.
    Also on object spy we are able to navigate only till flex tree and we are not able to spy child items of flex tree.On the web page the child items are displayed as radio buttons/checkboxes.
    Please provide a solution for me to this problem.
    Thanks

    Hi,
    You could perform a HTTP trace (using HTTP watch) and compare the OCI data in POST method for both users (the correct and incorrect ones).
    Perhaps there is some additional/missing information being passed from catalog to SRM.
    Kind regards,
    Ricardo

  • Add a button to the branch/root in a Flex Tree

    Can someone provide me code or  guide me how to  add a button to all nodes that has children/leaf( but not  to leaf). I tried from the example in this link
    http://www.remwebdevelopment.com/dev/a31/Flex-Checkbox-TreeItemRenderer.html , but I ma getting buttons for all the nodes(including leaf).
    i need to hav ethe button on the rideside corners horizontally to all branches/root.
    Please correct me where i am wrong or provide me correct code. Thanks in advance
    package  
    PKG{
    import mx.controls.Button;  
    import mx.controls.Tree;  
    import mx.controls.treeClasses.TreeItemRenderer;  
    import mx.controls.treeClasses.TreeListData;  
    public class TreeData extends TreeItemRenderer{
    private var bWidth:Number = 30;  
    private var bHeight:Number = 20;  
    public function TreeData(){
    super();}
    var btn:Button=new Button();  
    override protected function createChildren():void{
    //addChild(btn);
    super.createChildren();}
    override public function set data(value:Object):void{
    super.data = value;  
    // get the tree that owns us  
    var _tree:Tree = Tree(this.parent.parent);  
    // if the current node is a branch node  
    //for each(item:Object in  
    if(TreeListData(super.listData).depth=1)                             -or if(TreeListData(super.listData).hasChildren)   these are not working for me{
    btn.width = bWidth;
    btn.height= bHeight;
    btn.label=
    "Remove Attachment";btn.right=10;
    else{
    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{ 
    super.updateDisplayList(unscaledWidth,unscaledHeight); 
    if(super.data){ 
    var tld:TreeListData = TreeListData(super.listData); 
    // if the current node is a branch node  
    if(TreeListData(super.listData).depth=1){
    this.btn.visible=true; 
    this.btn.x=200; 
    this.btn.y = super.label.y+4; 
    //super.label.x = this.btn.x +; 
    //this.btn.y = super.label.y+8; 
    else{
    this.btn.visible=false; 
    this.btn.includeInLayout=false;}

    Hi Albert.
    You need to do a few things for that :
    - Create your own GUI status by copying STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN.
    - Set your own PF-Status using the Exclude table because otherwise your exclude table would become meaningless.
    - define a subroutine to handle the user commands.
    Sample implementation :
    FORM pf_status USING extab TYPE slis_t_extab.
      extab = pf_exclude.   
      SET PF-STATUS 'STANDARD' EXCLUDING extab.       
    ENDFORM.                    "PF_STATUS
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = repid
          i_callback_user_command  = 'USER_COMMAND'
          i_callback_pf_status_set = 'PF_STATUS'
          is_layout                = layout
          it_fieldcat              = fieldcat
          it_excluding             = pf_exclude
        TABLES
          t_outtab                 = itab
        EXCEPTIONS
          OTHERS                   = 0.
            FORM user_command  USING r_ucomm LIKE sy-ucomm
                                       rs_selfield TYPE slis_selfield.
    ENDFORM.
    Please reward points if found helpful.

  • Flex tree control expanditem dynamically..?

    Hi All.,
               I have using tree control using to display. when i pass the data with folder id dynamically  to expanding particular child node of tree.
        How to extarct tree with dynamic...?
    Below sample coding.....
    <mx:tree id="folderTree" />
    folderid=2618;
         callLater(expandTree, [folderid]);
         private function expandTree(folderid: Object) : void
                    folderTree.expandChildrenOf(folderTree.getChildAt(0), true);
                    folderTree.selectedItem = folderid;
    but not extracting tree.
    anyone help this problem
    With Regards.,
    Lings

    Thanks buddy for the answer.
    Unfortunately the answer came after quite long time of posting the message. Anyway I was able to open a tree on demand using HttpService and due to my new requirement I changed it to RemoteObject.
    I my latest change I am able to populate tree nodes on demand and also the same solution if getting update from server via JMS using Consumer object.
    I kind a like this solution because it took me good amount of effort to find the right solution.
    If any one is intersted the he/she can reply to the post and I can provide code here or may at some location so that it can be easily downloaded.
    The solution is Flex-Grails combination.
    Thanks everybody.

  • Flex gsoap webService

    Hi, i have a problem with Flex application that call a web service created with gSoap.
    This is the scenario: the flex app run and web service run on the same machine that cannot have an internet connection (this is the problem).
    Everything work fine if the machine can navigate to the net and resolve http://schemas.xmlsoap.org and http://www.w3.org.
    This probably because not all the definition needed by the soap comunication are defined locally in the wsdl...
    Does anyone know how to solve this problem? There's a way to build a complete local WSDL with all the necessary?
    thx

    Got it to work.  Followed http://blog.danmcweeney.com/57 with some modifications. The Flex bloggers have mostly omitted the fact that when you create your own webservice from a standard BAPI, the resulting wsdl does not hold the same CASE for things such as the operation, parameters etc. It is important to match the cases (Title Case in mt instance) to get the WS to work on flex.

  • Flex Tree component qestion.

    Hi, this might be a piece of cake for you guys. But I could not figure out how to expand the tree by default when you bring up your app.
    Thanks.
    K

    Set openItems
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Flex Tree does not selecting (highlight) the selectedIndices

    have an array of items that should be selected in my tree control. As you can see from my code below,I bind this array to the selectedIndices property of the tree. The selectedItems are not properly selecting in tree(selecting some other items and always root is selected).Flex seems to "ignore" my items (highlights some other indices). Am I missing something?
    Perhaps I'm going about this in wrong way?
    Thanks for your help!
    My XMLList:-
    <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
            <fx:XMLList id="XMLList">
            <node>
                <node name="max">
                    <node name="Emanuele"
                          surname="Tatti" age="23" wage="1200"/>
                    <node name="Francesco"
                          surname="Rapana " age="22" wage="1000"/>
                    <node name="Constantin"
                          surname="Moldovanu" age="23" wage="1200"/>
                    <node name="Marco"
                          surname="Casario" age="29" wage="1500">
                        <node name="Marco"
                              surname="Casario" age="29" wage="1500">
                            <node name="Marco"
                                  surname="Casario" age="29" wage="1500">
                                <node name="Marco"
                                      surname="Casario" age="29" wage="1500">
                                </node>
                            </node>
                        </node>                
                    </node>
                </node>
            </node>
            </fx:XMLList>
    </fx:Declarations>
    My Action Script Function:-
    public function select_tree():Void
    tree.validateNow();
    var allItems:Array = new Array();
    for(var n:Int =2;n<7;n+2)      
            allItems[n]=n; // o/p- 2,4,6
    tree.selectedIndices = allItems1;   //2,4,6 items should select ,but 0,2,4,5 are selected why?
    *****My MXML:-*****
    <mx:Button id="btn" label="Find Unmatch Nodes" width="221" height="30" click="select_tree()"/>
    <mx:Tree id="tree"  right="10" top="54" bottom="10" width="49.5%" dataProvider="{XMLList}"
        fontFamily="Verdana" fontSize="11" showScrollTips="true"
        allowMultipleSelection="true"
        alternatingItemColors="[#F5F5F5]"
        labelField="@label" selectionColor="#ECF335" showRoot="false"/>

    Are the nodes open to “expose” the children?

Maybe you are looking for

  • MRP issue for future delivery PO/STO date

    We have a sceanrio where the available material quantity in MRP list is considering future delivery date STO quantity.  The PO delivery date is 08.11.2008 and MRP run date is 07.11.2008. Step 1, material master details: Material = 16814, MRP Type = P

  • How do I save anything to iCloud??

    I have backed up my iphone to icloud hoping that I would be able to access everything on my computer but can't get anything.  How do I save just my contacts to the iCloud and then access them from my computer?  (PS  If you are reading this, Winston C

  • Julian date query

    Hi, I have on one column in which I have data like [634798640030000000,0].Now I have to convert this data into date format like dd/mm/yy.Could any one help me how do I convert this data into date format.

  • Printing differences between photoshop cs4 and LR 2.3

    printing using a canon 9000, when I print in LR the prints com out very, very low contrast.  I have imported into PS CS4 and print looks like it does on the screen. I can't find what print setting I'm missing in LR, I'm guessing there is software swi

  • My 4G icon registers LO all the time  Why?

    I can receive emails, but not send  why??