Hiding tree dataprovider nodes.

Hello once again,
I'm a little stuck on something... i've got xml that looks
like
<template label="company">
<tab label="general">
<section label="address">
<field label="street">
<width>50</width>
<height>50</width>
</field>
</section>
</tab>
</template>
I then use that xml as the dataprovider for my tree, all is
great BUT, i don't want the tree to display anything below field.
I'm a little stuck on how to do that. I found this snippet from
someone at Adobe but I think it confused me more than helped me
"The Tree uses the ITreeDataDescriptor interface to pull
items out of the data, so a custom impl could filter based on
whatever criteria you'd like. Specifically you'll want to write a
custom getChildren to return only the children that you want
displayed. You may also need isBranch and hasChildren but the
defaults may work for you."
Based on that it sounds like I can test for the xml node
local name while the tree is rendering and only render 1 of the 4
that I want to show...
Can anyone point me in the direction to a working example
(with source)? Or have some pointers that might help?
Regards,
Zach Brown

Reformatting isn't really an option. Well, I suppose it is
but it isn't really one I want to consider as the data is quite a
bit more complicated than what I presented. Each field has
additional tags below (as in my example) but, further to that tags
below the field tag have tags below them. There is a complex
permissions and restrictions scheme that each field adheres to
depending on the user and or type of user. Additionally there are
field flags wich describe the type of content in the field, each
field can have anywhere from 1 to x type flags.
<template label="company">
<tab label="general">
<section label="address">
<field label="street">
<contentTypes>
<type>General Content</type>
<type>Address Information</type>
</contentTypes>
<userTypes>
<type>1</type>
</userTypes>
<explicitPermissions>
<userID>1</userID>
</explicitPermissions>
<width>50</width>
<height>50</width>
</field>
</section>
</tab>
</template>
Essentiall i've got very structured data thats perfect for a
heirechal model view but, i only want to display some of that
heirarchy in my tree. The rest of the data is used elsewhere in the
same editor that I'm building and using the same xml for
databinding.
Thanks for the suggestions though, it's already something
that I have spent some serious time thinking about.
Regards,
Zach

Similar Messages

  • Hiding a intermediate node in a Jtree without hiding leaf nodes

    Hi who can help me out of this problem. What my prob is dat i m interrested in hiding few intermediate nodes in JTree without hiding their children.
    Thanks
    Rakesh

    but how do you then expand to see the children? once the node is hidden, can you by any means expand/collapse it to view/hide the child leaves?

  • Is it possible to put two different colors in tree parent node background and child nodes background?

    Is it possible to put two different colors in tree parent
    node background and child nodes background?
    Any help will be very helpful.
    Thanks

    Hi PanosE,
    Yes, you can set up another Standard Edition Server in child domain and then deploy pool pairing.
    You need to deploy a new Front End Pool for the new Standard Edition Server.
    A similar case for your reference.
    https://social.technet.microsoft.com/Forums/office/en-US/eca4299c-8edb-481e-b328-c7deba2a79ba/lync-2013-standard-edition-lync-fe-pools-in-multiple-domain-single-forest-senario?forum=lyncdeploy
    Best regards,
    Eric
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Tree View Node Element Resize

    Hello,
    Is there any way to resize Tree View Node Element programatically.
    In .fr file the height of the tree view node element is set to 90.
    On a button click I want to resize the element height to 18.
    I have tried using IControlView->SetFrame(TmpRect); but with no luck.
    Thanks,
    Prakash.

    Take a look at ITreeViewWidgetMgr, you can implement GetNodeWidgetHeight(...)
    and you may need to call ITreeViewMgr->NodeChanged(...) to get the TreeView to re-paint your Node.

  • Bette way to referenced tree model nodes from UI to perform actions on them

    A singleton facade is built.
    Its init() method loads several "tree model configs", each of them referenced by a name.
    This singleton creates a Project instance for a given "tree model config" calling the facade method -> createProject(String pjrName, String modelConfigName)
    When the Project is built a new Model instance is set ( remember the model instance is a tree holding nodes )
    The new Project instance built is added to a List that the facade has and then it's returned to the UI part that called ->createProject(prjName,modelconfigName)
    Given the Project instance the UI has to build a JTree representation of the model that the project references and the UI will have button actions that should call methods of the Nodes of the model referenced by the Project.
    Doing it this way the UI will be able to reference objects directly without going through the facade.
    Maybe I should return to the UI something like a ProjectKey instance instead of letting have the UI the Project instance ?
    It should be better if I process the possible node actions behind the Facade and not the UI, but how can I do it ?
    Having a ProjectKey in my UI I could ask the facade a model tree representation but not having the real nodes, otherwise having some NodeKey instances ?

    Sounds like you want to represent a tree structure, without a reference to the real tree.
    I'll take it further: maybe you don't want the UI to know there's a real tree data-structure with nodes and pointers to children, because maybe you build the tree on the fly from a database.
    So use the Builder pattern instead of committing to a specific data structure.
    Google results for Builder pattern: http://www.google.com/search?hl=en&q=builder+pattern&btnG=Google+Search
    Your UI should know how to construct nodes and children graphically, when told. This means it should have methods like addNode, but related to the domain: addSubProject maybe.
    A Project object is the Director, knowing which part goes where, but it doesn't know the real end result (a JPanel or HTML). So it has a method buildProject(Builder e) or exportProject(Exporter e), where all logic of assembling the parts is.
    When you have that, write a class JTreeProjectExporter implements Exporter.
    Hope this helps.

  • Programatically creating ADF Tree with nodes,child nodes & links?

    Hi,
    Currently I am using Build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660. Please provide me detailed code for programatically creating ADF Tree with nodes, child nodes and links in it.
    Thanks,
    Vik

    You need to create a model for the tree. ADF has a build in model that you can use to build your own tree.
    This is what you need to write in your JSPX:
    <af:tree summary="Navigation" id="treeNav" value="#{pageFlowScope.treeNavigationBackingBean.model}"
               var="node" contextMenuSelect="true" rowSelection="single" fetchSize="30">   
           <f:facet name="nodeStamp">
          <af:outputText id="txtText" value="#{node.text}"/>
        </f:facet>
    </af:tree>This is the code to retreive the model:
      public TreeModel getModel() {
        if(model == null)
            model = new ChildPropertyTreeModel(instance,"children");
        return model;
      }instance contains the actual tree. I build it in the constructor of my managed bean:
        public BeanTreeNavigation() {
          ArrayList<TreeItem> rootItems = new ArrayList<TreeItem>();
          TreeItem node1 = new TreeItem("Root node");
             ArrayList<TreeItem> level1 = new ArrayList<TreeItem>();
             TreeItem level1Node1 = new TreeItem("Level1 Node1");
              level1.add(level1Node1);
           node1.setChildren(level1);
           rootItems.setChildren(node1); 
          this.setListInstance(rootItems);
          root = rootItems;
      public void setListInstance(List instance) {
        this.instance = instance;
        model = null;
      }The TreeItem class is not a default one. I created it myself. You can make of it whatever you want:
        public class TreeItem {
          private String text;
           private List<TreeItem> children = null;
           public TreeItem(String text){
            this.text = text;
            public void setText(String text) {
                this.text = text;
            public String getText() {
                return text;
            public void setChildren(List<TreeItem> children) {
                this.children = children;
            public List<TreeItem> getChildren() {
                return children;
            }I wrote the TreeItem as an inner class of the managed bean.
    The most important part is the getModel methode. There you need to specify an Object and the name of the getter that will return a List of the children.
    Hope this helps.
    Edited by: Yannick Ongena on Feb 22, 2011 7:30 AM

  • How to save an n-ary tree of nodes to and from an xml file

    Hello,
    I am trying to represent a n-ary tree of nodes in xml.
    More accurately, I am trying to save/instantiate a
    tree of nodes to-from an xml file.
    How do I represent the parent-child relationships?
    Java: (simplified)
    class Node {
    Arraylist childNodes;
    Node parent;
    XML:
    From what I have been learning about XML,
    DTD:
    <?xml version="1.0" ?>
    <!DOCTYPE acd
         <!ELEMENT Node (childNodes, parent)>
         <!ATTLIST Node id ID #REQUIRED>
         <!ELEMENT childNodes (Node*)>
         <!ELEMENT parent (Node?)>
    ]>
    Qs:
    1) How do I represent the relationships? What would
    normally be a reference in Java, how do I represent in
    XML?
    2) Do I use ID, IDREF? I have been trying to find some
    examples to learn how. i.e. Does the IDREF, ID
    automatically become an in-memory reference (or pointer)?
    3) Is it preferable to use XML schema?
    thanks,
    Anil Philip
    Olathe, KS
    for good news go to
    http://members.tripod.com/goodnewsforyou/goodnews.html

    I downloaded XML Spy and used it to correct my earlier schema.
    Qs:
    In the instance document xml file;
    1) How would one display the parent node?
    2) If a child has a reference to a parent node as in the schema below, how can one know that the references are the same?
    i.e. when the parent node is first declared and when it is referred to by the child.
    Perhaps this raises a larger question - how does XML handle recursive references?
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://juwo.com/acd" xmlns="http://juwo.com/acd" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:annotation>
              <xs:documentation>ACD nodes. juwo LLC 2005</xs:documentation>
         </xs:annotation>
         <xs:complexType name="Node">
              <xs:sequence>
                   <xs:element name="parent" type="Node" minOccurs="0"/>
                   <!-- Node[] childNodes -->
                   <xs:element name="childNodes" type="ListOfNodes"/>
                   <!-- String data -->
                   <xs:element name="data" type="xs:string"/>
              </xs:sequence>
              <!-- Node parent -->
         </xs:complexType>
         <xs:complexType name="ListOfNodes">
              <xs:sequence>
                   <xs:element name="i" type="Node" minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
    </xs:schema>

  • Populate a canvas when a tree-leaf node is clicked

    I'm trying to populate a canvas or a list container with
    images when a tree-leaf node is clicked. I got the tree control
    working alright so far (populated via an external XML) but I'm
    having a hard time figuring out how to populate the adjacent
    container when a leaf node from a tree is clicked by a user. I know
    I'm supposed to code this in the 'change' event but am having a
    difficult time trying to figure out how to do this. I looked at the
    source code in some of the sample apps but I couldn't find anything
    that resemble what I'm trying to do.
    Since each leaf node would be unique, each one of them would
    trigger an external load of images (via http service) ... and so
    the url would be unique as well for each.
    'Appreciate the help from anyone who could help.
    Thanks.

    Thanks for the quick response Tracy ...
    Actually, I don't have mage load part coded yet :) ... I do
    have a somewhat general idea on how it should be coded though (i
    think, hehe). I'm thinking the selected item in the leaf node would
    have the data for the 'url' or 'folder location' of the images that
    would have to be retrieved and displayed in the canvas. I'm just
    not sure how to go about diplaying them in the canvas. Do I have to
    load them in some sort of array first and then datasourced it for
    my canvas? Not really sure how to go about doing it ... 'am totally
    newbie with Flex and just learning it by going through the online
    help and looking at the codes on some of the sample apps.
    Thanks again.
    pixelflip

  • Get tree selected node onPageLoad

    We just turned on change persistence to keep our row selections as we traverse our taskflows and pages.
    In one of our pages we have a situation where we have a tree (master) and table (table) whose data is partially based on what is selected in that tree. We use the following logic to determine what is selected in the tree to perform the query on the table.
    public static JUCtrlHierNodeBinding getTreeSelectedNode(RichTree tree) {
    JUCtrlHierNodeBinding node = null;
    if (tree != null) {
    Object oldRowKey = tree.getRowKey();
    try {
    RowKeySet selectedRowKeySet = tree.getSelectedRowKeys();
    if (selectedRowKeySet != null) {
    for (Object selectedRowKey : selectedRowKeySet) {
    tree.setRowKey(selectedRowKey);
    node = (JUCtrlHierNodeBinding)tree.getRowData();
    break;
    } finally {
    tree.setRowKey(oldRowKey);
    return node;
    I hooked up a beforePhase listener on my jspx to call this function and get the (previously - last time user was on this page) selected row and then refresh the table based on the selected tree row's data. This seems to work, but . . . in my log I'm seeing the following error. It seems like for some reason it's trying to convert my Raw UUID to an int, I have no idea why.
    <SortableModel> <_toRowIndex> Invalid rowkey:oracle.jbo.Key[B68F305BF7F5496D8A0FF99EE8F97CF0 ] type:class oracle.jbo.Key
    <SortableModel> <_toRowIndex>
    java.lang.ClassCastException: oracle.jbo.Key cannot be cast to java.lang.Integer
    at org.apache.myfaces.trinidad.model.SortableModel._toRowIndex(SortableModel.java:341)
    at org.apache.myfaces.trinidad.model.SortableModel.setRowKey(SortableModel.java:137)
    at org.apache.myfaces.trinidad.model.ChildPropertyTreeModel._setRowKey(ChildPropertyTreeModel.java:376)
    at org.apache.myfaces.trinidad.model.ChildPropertyTreeModel.setRowKey(ChildPropertyTreeModel.java:178)
    at org.apache.myfaces.trinidad.component.UIXCollection.setRowKey(UIXCollection.java:425)
    at oracle.apps.aia.sr.common.JSFUtils.getTreeSelectedNode(JSFUtils.java:392)
    So, I thought that maybe this wasn't the best way to get the selected node. So, after some research I changed the logic to be:
    public static JUCtrlHierNodeBinding getTreeSelectedNode(RichTree tree) {
    JUCtrlHierNodeBinding node = null;
    if (tree != null) {
    CollectionModel treeModel = (CollectionModel)tree.getValue();
    if (treeModel != null ){
    JUCtrlHierBinding treeBinding = (JUCtrlHierBinding)treeModel.getWrappedData();
    if (treeBinding != null){
    RowKeySet rks = tree.getSelectedRowKeys();
    if (rks != null){
    if (!rks.isEmpty()){
    List firstSet = (List)rks.iterator().next();
    node = treeBinding.findNodeByKeyPath(firstSet);
    return node;
    However, at the time of the beforePhase (I even tried an afterPhase listener) the tree isn't null, but the CollectionModel is null for some reason. I'm not sure where to go from here, any ideas?

    Hi,
    if you use lazy loading (contentdelivery="lazy" then the data is queried after the tree renders. ou would need to set it to immediate to acess data suring the Preparerender phase).
    Frank

  • Executing jscript from tree child node

    Hi,
    I am trying to execute a jscript code when pressing tree child node (commandLink)
    to launch a popup, but in vain.But I succeed to launch the popup from another side.
    I used
    <af:commandLink text="#{node}">
    <af:showPopupBehavior popupId="MyPop"/>
    <af:clientListener method="showPopup" type="action"/>
    </af:commandLink>

    I am confused by the code sample. You have a clientListener to launch the popup and you use the showPopupBehavior component. Either case amounts to roughly the same code so you are calling the popup twice.
    --Ric                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Tree dataProvider from PHP

    Hello all!
    I see in the web many many many example how to populate a
    Tree, but, i cant find no example how to populate a Tree FROM PHP.
    I am using HTTPService and know how to use it but, i don't
    know the structure of nodes.
    In PHP file, i am doing this:
    echo "<node label='root'><node label='NODE
    1'><node label='child 1 of NODE 1' /><node label='child
    2 of NODE 1' /></node></node>";
    and, in the Tree, I am putting:
    dataProvider="{myHttpService.lastResult}"
    but, nothing happens, no result in Tree!
    What is the correct way?

    I've got my list populating correctly from XML generated by
    php but any time I click on a folder in the tree list I get an
    error:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="dirListSvc.send();">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    private var dirList:XML;
    [Bindable]
    public var selectedNode:XML;
    // Event handler for the Tree control change event.
    public function treeChanged(event:Event):void {
    selectedNode=Tree(event.target).selectedItem as XML;
    private function
    directoryResultHandler(event:ResultEvent):void
    dirList = event.result as XML;
    // Fault handler - displays the error
    private function
    directoryFaultHandler(event:FaultEvent):void
    Alert.show(event.fault.message, "Could not load dirList");
    ]]>
    </mx:Script>
    <mx:HTTPService
    id="dirListSvc"
    url="
    http://localhost/iqAssets/scripts/directory.php"
    resultFormat="e4x"
    result="directoryResultHandler(event);"
    fault="directoryFaultHandler(event);"
    />
    <mx:HDividedBox width="100%" height="100%">
    <mx:Tree x="10" y="10" labelField="@label"
    dataProvider="{dirList}" width="250" height="530"
    change="treeChanged(event)"/>
    <mx:Panel height="100%" width="50%"
    title="{selectedNode.@label}">
    <mx:Text text="{selectedNode.@path}" />
    <mx:Image source="{selectedNode.@path}" />
    </mx:Panel>
    </mx:HDividedBox>
    </mx:Application>

  • Tree's node label disappear?

    Guys,
    I have the php returned me a xml data to my tree control.
    When I expand or collapse a node, one of the children node's label
    become empty. However, If I maximize the browser, everything is
    back to normal. I am using Adobe Flex builder 3. Any idea?
    -Alan

    "2JZ" <[email protected]> wrote in message
    news:glqtok$8v5$[email protected]..
    > Amy,
    >
    > Here is how I declare teh tree control.
    >
    > <mx:Tree id="ViewTreeCtrl" width="100%" height="100%"
    > horizontalScrollPolicy="auto"
    allowMultipleSelection="true"
    > color="#000000"
    > dataProvider="{ViewXML}" labelField="@name"
    borderStyle="none" alpha="1.0"
    > selectable="true" iconFunction="TreeIconAssignment"
    dropEnabled="true"
    > dragEnabled="true" dragDrop="OnViewDragDrop(event)"
    > dragEnter="OnDragEnter(event)">
    >
    > I am not sure if I am indirectly using custom
    itemRenderers. When using
    > these
    > functions:
    >
    > labelField="@name"
    > iconFunction="TreeIconAssignment"
    >
    > Where TreeIconAssignment() specify which embedded icons
    to use base on
    > the
    > node's type.
    That shouldn't cause the problem. I'm not seeing anything in
    what you
    posted that would cause the problem. Sorry :-(

  • Flash Tree Object & node list

    Hi All,
    Unsure if this is a noodle scratcher or undoable!
    Either way, does anyone know of a way when using the 'tree'
    flash component in Director to get the component to supply a list
    of some sort back to director.
    I'm adding & subtracting branches to the Object
    successfully, but I figure it must know whats where I just need it
    to tell Director so I can manipulate it out to a XML file !!
    Cheers

    Alright, this is a long one. Make a Director file based on
    the following and when it starts it’ll open the xmlDoc.xml
    XML file, parse it into a Flash XML object and assign that object
    as the dataProvider for a Flash component Tree. Then you can select
    a planet node from the Tree, enter text into the Flash component
    text field, and click the Flash button to add a moon to the
    selected planet node with the entered text as its label. The button
    also saves whatever XML makes up the tree to the xmlDoc.xml XML
    file by calling the saveXml() function. You could have whatever
    event you want call the save function.
    To start, drag a Flash Tree component to the stage as sprite
    1, a Flash TextInput component to the stage as sprite 2 and a Flash
    Button component to the stage as sprite 3. Make sure to do
    Modify>Movie>Xtras… and add the FileIo.x32 Xtra so
    it’ll work if you make a projector.
    Add this script to Frame one:
    function exitFrame(me)
    ///// make Fileio obj, Flash XML obj, populate Tree
    // Fileio
    var fileObj = new xtra("fileio");
    fileObj.openFile(_movie.path + "xmlDoc.xml",0);
    var xmlString = fileObj.readFile();
    fileObj.closeFile();
    fileObj = null;
    // Flash XML obj
    var fTree = sprite(1);
    var fXmlObj = fTree.newObject("XML");
    fXmlObj.ignoreWhite = true;
    fXmlObj.parseXML(xmlString);
    // populate Tree
    fTree.dataProvider = fXmlObj;
    ///// make button listerner to handle clicks
    var fButton = sprite(3);
    var fButtonEvt = fButton.newObject("Object");
    fButton.addEventListener("click",fButtonEvt);
    fButton.setCallback(fButton, "click",
    symbol("fButtonClick"), "fButtonEvtScript");
    Make this Movie Script, name it fButtonEvtScript:
    function fButtonClick(me,evtObj)
    var fTree = sprite(1);
    var fText = sprite(2);
    // determine if a Tree node is selected
    try
    String(fTree.selectedNode.attributes.label);
    // execute if node selected is planet
    if (fTree.selectedNode.nodeName == "planet")
    var newNode = fTree.newObject("XMLNode",1,"moon");
    // make node lable text field if text present, else default
    text
    if (fText.text == "")
    newNode.attributes.label = "Default Moon";
    } else {
    newNode.attributes.label = fText.text;
    // add new moon node
    fTree.selectedNode.addTreeNode(newNode);
    saveXml();
    } else {
    _player.alert("Must select planet node");
    } catch (errObj) {
    // alert no node
    _player.alert("No Node Selected");
    function saveXml()
    var fTree = sprite(1);
    // make string to save
    var xmlString = "<?xml version=\"1.0\"
    encoding=\"iso-8859-1\" ?>\n"
    xmlString += fTree.dataProvider.firstChild.toString();
    // save file
    var fileObj = new xtra("fileio");
    fileObj.openFile(_movie.path + "xmlDoc.xml",0);
    fileObj["delete"].call(fileObj);
    fileObj.createFile(_movie.path + "xmlDoc.xml");
    fileObj.openFile(_movie.path + "xmlDoc.xml",0);
    fileObj.writeString(xmlString);
    fileObj.closeFile();
    fileObj = null;
    Finaly add this script to any Frame after Frame one; I used
    Frame 10.
    function exitFrame(me)
    _movie.go(_movie.frame);
    Here’s the XML file:
    <?xml version="1.0" encoding="iso-8859-1" ?>
    <star label="Sol">
    <planet label="Mercury" />
    <planet label="Venus" />
    <planet label="Terra">
    <moon label="Luna" />
    </planet>
    <planet label="Mars">
    <moon label="Phobos" />
    <moon label="Deimos" />
    </planet>
    <planet label="Jupiter">
    <moon label="Callisto" />
    <moon label="Ganymede" />
    <moon label="Europa" />
    <moon label="Io" />
    </planet>
    <planet label="Saturn">
    <moon label="Titan" />
    </planet>
    <planet label="Uranus" />
    <planet label="Neptune" />
    <planet label="Pluto">
    <moon label="Charon" />
    </planet>
    </star>
    Sorry I got slack with the code comments, but I reckon you
    can figure out what’s going on. I figure this’ll give
    you a good start on what you’re trying to accomplish. I
    strongly suggest checking out the LiveDocs for Director regarding
    Flash and Components and Flash regarding Flash XML, XMLNode and the
    Components Language Reference. Remember though, things have changed
    since the Flash 8 Asset Xtra, so some of the documentation is out
    of date.

  • How to make the tree sibling nodes sorting  in memory per the VO default?

    Hi,
    I have a question on the uncommitted tree nodes sorting. The tree was built using the same VO with the view link to itself (parent/child relation). I have defined a default sorting on my VO. Now if I insert a node to the tree, the sibling nodes may not sort correctly if it is not committed. I tried to insert it to the RowsetIterator at the right position, it seems OK. but when you right click or something that make the tree to refresh, the order will mess up. If I do an auto save after each action, everything looks OK. But the fusion pattern is to do a global save, I have to manipulate the tree with the uncommitted data. I know I can set the view object's SQL mode to do the in-memory sorting. But not sure if it works on the tree structure, because it is not a single RowsetIteroator.. Can someone give an advice? Many thanks.
    Edited by: user736572 on Jan 20, 2012 2:48 PM

    Thanks Sudipto for trying to help. I did try that, and as I mentioned in the previous posting, it doesn't work for the tree nodes (multiple RowSetIterator). the following is my code, where the treeVO is the vo instance for the firstLevel tree nodes and it has view link to its children. I am not sure how to sort all children for each level. Even for the first level where I did the explicit sorting in memory, it still not sorting at all.
    treeVO.setSortBy("code");
    treeVO.setQueryMode(ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS|ViewObject..QUERY_MODE_SCAN_DATABASE_TABLES);
    treeVO.executeQuery();

  • How to get the current tree element (node/childnode/childnode/...) ?

    Hello!
    I'm trying to create a kind of a navigation tree for my application.
    It should represent some elements of an XML structure and some other nodes for other options.
    The binding with the context is not a problem, I can create the tree up to all the levels I want to.
    The problem now is, that I don't know, how to get the "current tree element", when there is any action.
    For example:
    public void onActionSelect(...) {
    String test = wdContext.currentTreeNodeElement().getText();
    wdThis.wdGetContext().currentContextElement().setSelectedElement(test);
    With this method I can get the text of the "first level nodes". If I want to get the "second level node", I can do
    String test = wdContext.currentTreeNodeElement().currentChildElement.getText();
    ..and for the next levels so on.
    Isn't there any general method to get the information of the selected element without knowing before, whether it is a nodeElement or a nodeElement.currentChildElement or a nodeElement.currentChildElement.currentChildElement, ...?
    Greetings,
    Ramó

    Hi,
    if you following that pdf ,
    i think your not implemented the below code in DomodifyView method
    if (firstTime) {
          IWDTreeNodeType treeNode = (IWDTreeNodeType) view.getElement("TheNode");
          /* The following line is necessary to create parameter mapping from parameter "path" to parameter "selectedElement".
    Parameter "path" is of type string and contains the string representation of the tree element (its corresponding context element to be exact)
    that raised the onAction event. Parameter "selectedElement" is of type IWDNodeElement (or extends it) and is defined as parameter in the event handler
    that handles the onAction. The parameter mapping defined here translates the String "path" into the corresponding context element that then can
    be accessed within the event handler
          treeNode.mappingOfOnAction().addSourceMapping("path", "selectedElement");
          /* The following line is necessary to create parameter mapping from parameter "path" to parameter "element".
    Parameter "path" is of type string and contains the string representation of the tree element (its corresponding context element to be exact)
    that raised the onLoadChildren event. Parameter "element" is of type IWDNodeElement (or extends it) and is defined as parameter in the event handler
    that handles the onLoadChildren. The parameter mapping defined here translates the String "path" into the corresponding context element that then can
    be accessed within the event handler
          treeNode.mappingOfOnLoadChildren().addSourceMapping("path", "element");
    please cross check once.
    Thanks,
    Ramesh

Maybe you are looking for