Dynamically refresh a Tree

Hi Everybody,
I need to get Tree nodes refreshed based on some criteria.
The criteria will be based on a combobox or PopupMenuButton change
event. To achieve the same, I am using a Tree control, which is
being populated by an XMLListCollection. The XMLListcollection has
a filterFunction that filters the tree nodes that will be
displayed. The criteria for the filterFunction depends on a
ComboBox selection.
The filterFunction for the XMLListCollection is called during
the Combo change event but the tree data is not refreshed and
doesnot display the desired filtered result.
I have tried doing this for a arraycollection with a datagrid
and it works fine but doesnot work for a tree. How can we refresh
the tree data. Below are the code snippet used to perform the Tree
filter which is not working and not throwing any error as well.
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="vertical" creationComplete="SetFilter();"
creationPolicy="all" >
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import flash.events.Event;
private function SetFilter():void{
xlc.filterFunction = treeFilter;
private function treeFilter(item:Object):Boolean{
var blResult:Boolean = false;
var csProject:String = [email protected]();
// mx.controls.Alert.show(csProject + " .. " +
cmbTree.selectedLabel.toString());
if(csProject.indexOf(cmbTree.selectedLabel.toString()) !=
-1){
blResult = true;
return blResult;
]]>
</mx:Script>
<mx:XML id="xmldata" source="data/treedata.xml"/>
<mx:XMLListCollection id="xlc"
source="{xmldata.node}" filterFunction="treeFilter"/>
<mx:Tree id="trTest" dataProvider="{xlc}"
labelField="@label" showRoot="false">
</mx:Tree>
<mx:ComboBox id="cmbTree" change="xlc.refresh()">
<mx:ArrayCollection>
<mx:Object label="By Licensee, Project" data="By
Licensee, Project"/>
<mx:Object label="By Licensee, Project, File Type"
data="By Licensee, Project, File Type"/>
<mx:Object label="By Licensee, Date" data="By Licensee,
Date"/>
<mx:Object label="By Licensee, Date, Project" data="By
Licensee, Date, Project"/>
</mx:ArrayCollection>
</mx:ComboBox>
</mx:Application>
treedata.xml file has the following data that is displayed as
tree nodes.
<root>
<node label="By Licensee, Project">
<node label="Abc">
<node label="Mugs"/>
<node label="Test" />
</node>
</node>
<node label="By Licensee, Project, File Type">
<node label="Abc123">
<node label="Mugs1"/>
<node label="Test1" />
</node>
</node>
<node label="By Licensee, Date">
<node label="Abc456">
<node label="Mugs2"/>
<node label="Test2" />
</node>
</node>
<node label="By Licensee, Date, Project">
<node label="Abc567">
<node label="Mugs3"/>
<node label="Test3" />
</node>
</node>
</root>
Please advise and suggest on where I am going wrong or if
there is any other better way to perform the desired result.
Thanks.
Regards,
Paromita

You can not filter but can you refresh the tree control? Or
do you have to build a new dataprovider every time ... What if you
want to add an item to a node such as:
tree.dataDescriptor.addChildAt(tree.selectedItem,
{label:"topper", children:[{label:"one"}, {label:"two"}]}, 0);
once you add the item you have to expand the node that you
added it to ... how do you get the tree to refresh ... i have tried
tree.validateDisplayList();
tree.validateNow();
treeDp.refresh();
and my dataprovider is an ArrayCollection

Similar Messages

  • Problem of refreshing a tree in web dynpro java

    hi all,
    I'm facing a problem for refreshing a tree in web dynpro java for SAP HR.
    I created a viewset with 2 cells( 1 view for each).
    In the 1st view I created a droplistbyindex to select the unit ID and in the 2nd view ( defaut=false)  I called a method to populate my tree according to my selection in the 1st view ( method called in wdInit).
    When I make the first selection everything is ok.
    But when I select another unit ID, the tree is not changed and I know the context is well changed according to my selection.
    So I think the method is executed only the first the view is called.
    In this case, how can I refresh my tree on real-time?
    Thanks for your help
    Yimin

    May be u can write the code wdDoModify instead.
    -Ashutosh

  • Dynamically Refresh Dropdown in JSF

    I wanna dynamically refresh dropdown values. Here is my requirement
    The user creates new record by selecting "New" value from the dropdown. Then user enters values on form fields and clicks the Submit button. The result is record gets created in the database and also gets populated in the dropdown. Now i wanna show this record as selected value in the dropdown instead of New to faciltate update/delete operations.
    Note: The reason i am doing this is subsequent save results in detached object hibernate exception. To resolve this exception if i create a new instance then i will loose the original object so i cant do update/delete on the original object. My backing bean is in session scope
    Any pointers/suggestions will be highly appreciated
    Regards
    Bansi

    What do you mean by preset it by property because the new value is allready set in the backedbean but its not reflected on the page as the drop down doesn't get refreshed.

  • Dynamically refresh a list box in a web report

    Dear All,
    I am having a serious issue with one of my web reports. I am using Oracle 9i PL/SQL Cartridges for developing my web reports. The problem is :
    I have a drop down box for department and also a list box for locations.
    I want to dynamically refresh the locations list box whenever the user selects a department.
    I know I have to refresh the page somehow to get the list box requery from the database.
    Can anyone please send me a sample code or suggest how to do it. I am new to PL/SQL cartridges.
    Thank You

    hello,
    althought his is not a PL/SQL cartridge forum i'll give it a shot.
    the basic behind the solution would be that your procedure need input values that would be used to create this cascading effect. so you would have e.g. input values for region and country for a form that should provide selection fro region country and city.
    when the procedure is called for the first time without any parameters, it would generate a drop down list for the first (region) parameter. when the user selects a value javascript would kick in that would submit the form that basically calls itself, but this time passing the value for the region parameter.
    now the procedure would create two drop down lists (region and country) because it had a value passed for region. both drop down lists would have a javaScript event that would submit the form. the only difference would be that the region list would need to clear the value of the country value before submitting so changing the region would produce a new country list.
    i hope that was clear enough. as for the code example. that is simple javaScript and you can find tons of examples on the Web. just look for "JavaScript" and "OnChange".
    regards,
    philipp

  • Could not load or refresh node tree creation failed on node

    Hi Experts
    I created one user with MSS role and ERP COMM role.
    It is working fine. We restarted the server for other purpose. Then surprisingly the MSS role was locked. I am unable to see the MSS tab in the top level navigation.
    When i expand the workset in line manager -> Manager Self Service -> Worksets
    I am getting the following error::
    Could not load or refresh node tree creation failed on node:
    pcd:portal_content/com.sap.pct/line_manager/com.sap.pct.erp.mss.bp_folder/com.sap.pct.erp.mss.worksets
    I can be able to expand and priveiw the Pages and iviews, except the worksets
    Please guide me, i am badly stucked here.
    Regards,
    Srinivas

    Hi KRISHNA,
    Check the below thread and notes mentioned in that
    Re: Tree creation failed on node: pcd:portal_content
    Koti Reddy

  • How to auto refresh a tree region

    Is possible to automaticaly refresh a tree region?

    Anyone can help me with this?
    Edited by: macwadu on 4/Ago/2011 3:10

  • Refresh a Tree XML dataProvider

    Hello!
    I have a problem with refreshing a Tree dataProvider. This is what I use:
    [Bindable]
    private var xmlFontes: XML;
    I then use it to put some php/sql generated xml. And then I make it a Tree dataProvider.
    So far so good... But I need to refresh the xml, and I use xmlFontes.refresh; and it works great. But I need to know when the refresh is complete, and I can't. Is it possible?
    Thank you so much for your help!
    Alexandre

    Well... I don't know if I can explain mutch better... My english is not great!
    I'm using a SpringLoadedTree, that I believe is some kind of tree but with more functions.
    When my application initializes it makes this:
    <mx:HTTPService id="treeF" showBusyCursor="true" url="php/treeFontes.php" resultFormat="e4x"  result="onResultFontes(event)" />
    My treeFontes.php file queries a sql database and gives back some xml code. And then:
    xmlFontes = XML(event.result);
    And xmlFontes is the dataProvider of my tree. This tree I'm using lets me drag and drop items between the tree nodes. When I do that I call another HTTPService to update the node position on the database. When it finishes updating the database I call the <mx:HTTPService id="treeF"... again and it updates the tree.
    What I wanted to do is this:
    When I drag the node on the tree I save that nodes parent id and when I drop it I save the new parent node id - confusing. With this I was hopping to be able to open the tree nodes from where I dragged and droped the child node. I can do this, but only with the click of a button...
    In my onResultFontes function I call another function that does what I want, but it's not working, beacause I don't know if it has finished generating the tree, and it probably tries to open the nodes before they are created.
    The function to open the nodes previously opened does something like this:
    expandParents(node[0]); - This is the original node - saved on drag
    expandParents(node[1]); - This is the destination node - saved on drop
    It's quite confusing... But I can't think of a better way.
    Thanks and sorry for all the confusing explanation!

  • FPN Could not load or refresh node Tree creation failed on node: pcd:-Error

    Hi,
    I´m configuring a FPN using CRM Java as a producer and SAP Portal as a consumer, the SSO from SAP Portal to CRM Java is working fine, but we are having this Error when trying to Expand Content Administration > Portal Content > NetWeaver Content Producers > MyProducer System
    Could not load or refresh node Tree creation failed on node: pcd:NetWeaver_content_producers/........
    Also in Identity Management I can see the Federated Data Source but when search for roles no rol is retrieved and returns two messages.
    Last Search might be innacurate
    No element Found
    Has somebody faced this Error?
    Thanx in Advanced!
    Kind Regards,
    Gerardo J

    Hi KRISHNA,
    Check the below thread and notes mentioned in that
    Re: Tree creation failed on node: pcd:portal_content
    Koti Reddy

  • Dynamic Refresh not working

    Hello Experts
    I have a text box and a select list. As soon as the user enters a value in the text box, the select list should refresh depending on the value that has been entered in the text box. I have a query behind the select list which selects from a table where value = text box value.
    To achieve this I created a dynamic refresh on the text box so that it freshes the select list as soon as the focus is lost, but everytime I run the page, a refresh icon appears next to select list but it seems to refresh forever and nothing gets populated in the select list. If I submit the page then the list is populated, but I don't want to submit the page but want to pick up the value from the text box and refresh the select list.
    Any help on this is appreciated.
    Thanks

    Hi,
    >
    I have a text box and a select list. As soon as the user enters a value in the text box, the select list should refresh depending on the value that has been entered in the text box. I have a query behind the select list which selects from a table where value = text box value.
    To achieve this I created a dynamic refresh on the text box so that it freshes the select list as soon as the focus is lost, but everytime I run the page, a refresh icon appears next to select list but it seems to refresh forever and nothing gets populated in the select list. If I submit the page then the list is populated, but I don't want to submit the page but want to pick up the value from the text box and refresh the select list.
    >
    You cannot use LoV based on SELECT as the SELECT will execute only when the page is loaded, which you have already noticed.
    What you need to do is construct the HTML fragment for the select list and push it into your HTML DOM as described in Denes Kubicek's demo.
    Cheers,

  • How to refresh the tree

    hi
    I am using jdev 11g
    in my page ,i use <af:panelSplitter> panel , left is my tree ,right is tree node details with dynamic region , because the different level has the different details page, so i use dynamic region
    But when the node details update or delete at right, my left tree can not refresh ,how to refresh with ManagerBean or others ?
    who can help me? thanks very much , i am waiting for your reply on line.

    hi, tks,
    in dynamic region , there is another page ,how to set PartialTriggers between two page(tree page and page in region ), perhaps it can't?

  • Refresh model tree

    When I display model tree and only then add new model using "scene.addModel" the model tree does not get refreshed to display the added nodes. I have also tried to add scene.update(); and runtime.refresh(); but without any luck.
    How to force model tree to refresh?

    The model tree is published from the 3D API to the Acrobat UI when the 3D annotation is initialized (i.e. when the embedded script completes running for the first time). After that, the only changes you will see occur when a selection event bubble is triggered, so in your case where the models are being loaded after the init loop finishes, you need to force a selection event to fire by temporarily picking and unpicking the newest node in the scene:
    scene.addModel("pdf://something.u3d");
    scene.selectedNode = scene.meshes.getByIndex(scene.meshes.count-1);
    scene.selectedNode = undefined;
    That will show your new node in the tree panel in the UI. What you're seeing is 'unintentional correct behavior' in the sense that there's no way to hide an entry in the tree so tying the UI update to a specific event bubble allows someone to add a model, set it to invisible, and avoid the node declaring itself in the UI until the author wants you to see it. Yes, we should have documented what I just told you... but you're only the second person to ask and it's been like this for years
    Most people will preload eall the resources during the init loop and set the dynamic bits of the model to invisible - in which case the tree lists everything. You're seeing that effect with your "Time 0 (0)" node.

  • Dynamic Action on tree change

    Hi,
    Is it possible to trigger a dynamic action from a change in the selection of a tree leaf?
    Using Apex 4.0.1.
    Thanks,
    Chris

    change in the selection of a tree leaf?You meant a different node is clicked , didn't you ?
    If so the D.A would be
    event click
    triggered by : jQuery selector
    selector : div.tree li>a
    if you want to get node id of the clicked element in JS
    you can use
    $('this.triggeringElement).parents('li:first').attr('id');

  • Dynamically refresh to report regions

    I have a page with multiple regions. Two of the regions are report regions that I want to refresh dynamically. I am using 4.0. I created a dynamic action that fires based on an item's value changing. It contains two actions, a 'Refresh' action for each region. Only one region will refresh. If I put an 'Alert' action between the two 'Refresh' actions, then both regions will be refreshed. I have tried to do this multiple ways, such as using the $a_report() function from within my page level javascript. Results are the same. I can get one region to refresh, but not two. Any ideas or suggestions on why I can not refresh multiple regions?

    Thanks for your reply. I tried what you said and still no luck. I then created a new page with two simple regions, a select list, and a button to trigger the refresh. I wanted it be stripped of any other items or code and I used your javascript. It still only refreshes one region. I am requesting space on the Oracle site and will create my test there. Maybe there is a bug in the version we have installed. Our version is 4.0.0.00.46.

  • Dynamic menu in tree structure in JSP

    Hi,
    1) I need to display a dynamic menu in JSP. The menu depends on the values received from database. I need to show the items in the structure of tree (like parents, child relation). The tree can have multiple levels (the parent can have children & these children too can have children). This tree structure would be on left side of the screen.
    I would like to use some custom tags rather than javascript. Can somebody post the custom tags or some samples?
    2) Also, once the user selects different items from menu, different action classes should be called. And accordingly, the right side of the screen will show different data.
    So, there should be any way to set different action classes for the menu items. Please post any samples or helpful links.

    Hi,
    1) I need to display a dynamic menu in JSP. The menu depends on the values received from database. I need to show the items in the structure of tree (like parents, child relation). The tree can have multiple levels (the parent can have children & these children too can have children). This tree structure would be on left side of the screen.
    I would like to use some custom tags rather than javascript. Can somebody post the custom tags or some samples?
    2) Also, once the user selects different items from menu, different action classes should be called. And accordingly, the right side of the screen will show different data.
    So, there should be any way to set different action classes for the menu items. Please post any samples or helpful links.

  • Problem refreshing the Tree Component icons

    Hello,
    I'm using the Tree, adding the nodes dinamically, following the example: http://www.netbeans.org/kb/55/vwp-databasetree.html
    This Tree shows the access permissions from the users, and show a red icon on the itens without permissions and a green icon on the itens with permissions.
    In the nodes, I add an action that change this permissions when the user click.
    If the permission is Ok on the clicked item, the action remove this permission and vice-versa.
    The action is working fine, but the problem is the refresh of the tree after click. The icons stay like before the click. It is refreshed only if I navigate to another page and return after. Then the icons are showed correct.
    In the method that add the nodes, I select the node icons like this:
    if (havePermissionModulo(grupo, modulo)){
    moduloNode.setImageURL(imgPermissaoOk);
    }else{
    moduloNode.setImageURL(imgPermissaoNegada);
    Where imgPermissaoOk and imgPermissaoNegada have the path to the images.
    Sorry by my english :)

    It is hard to tell
    When the user clicks on an icon, is the page submitted to the server and the page redisplaying itself?
    Is the tree's clientSide property cleared (that is, false).
    Is the browser caching the images? What if you hit a Shift-Reload?

Maybe you are looking for

  • Import Layers? AI CS 1

    Dear Readers: I thought that the Place... command would preserve my layers but instead it seems to place all the objects in groups with a clipping path. How can I import layers from 4 files into a master file? Sincerely, rene

  • Comcast static IP, own domain moving away from Qwest

    Hi, We currently have a separate ISP and Qwest's DSL. We have our primary domain setup (mydomain.com) so I can run multiple vhosts, mail, etc. and an Apple Airport Extreme as a our primary router, configured with the public IP, etc. In addition, we r

  • Stereomix/What you hear?

    ? <div class="lia-component-body lia-message-body">hi everybody. Lately I've been introduced to streaming games to friends online. Well,I'd like to stream game audio and microphone input. Since my X-Fi XtremeGamer doesn't have Stereomix I tried the "

  • How do I create clips from my video.

    I have a long video that I want to break up into smaller clips.  I'm a noob and could use a little help. Thanks in advance.

  • I need to rese the email used for my security questions, how do i do this?

    I had two new emails verified in place of my olds, seeing as I have forgotten all the passwords to my old emails. The problem is is that my email for my security questions  aren't resetting. I need my security questions to start up my iPhone and I ha