Auto select an item in a child node of a TreeView UI control?

Hi There,
I'm having some issues with a TreeView control in my UI that I cannot seem to resolve, and thought I would ask if anybody here has done this type of thing.  My TreeView is made up of a collection of nodes, each with some child items.  When the window containing the TreeView displays, I populate it with the nodes.  I want to be able to script the selection within the TreeView, but I want the script to select a child items, not just their parent nodes.  Is this possible?  I know it is possible to selecting the parent nodes in a TreeView, but I cannot seem to get the code for selecting, via scripting, a child item of a node in a TreeView.  Any thoughts on how to acheive this?
Thanks for your time and help!
Best,
Arie
Here is some of the code I am using for auto-selecting child items of nodes in the TreeView:
                    //Code to populate the TreeView (picker) goes here
                    //Highlight the last selection
                    for (var i=0; i < picker.items.length; i++)
                        if (picker.items[i].title == SAVED_TITLE){
                            picker.selection = picker.items[i];
                            picker.selection.expanded = true;
                            for (var x=0; x < picker.selection.items.length; x++) {
                                if (picker.selection.items[x].marker == SAVED_MARKER){
                                    picker.selection = picker.selection.items[x];  //turns out the indices are relative to it's parent, not the picker's indices
                                    break;
                            break;

I had some of the above code wrong:
    // function to filter jsx files------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ -----------------------//
    function filterJSXFiles(file)
        return ((file.name.match(/.jsx(bin)?$/) != null) && (file.name != (new File($.fileName)).name));
    // Collect files in folder that holds Burrow AFX scripts---------------------------------------------------------------------------------- -----------------------------------------------------------------------------//
    var brws_ScriptFolder = "Z:\\apps\\after_effects\\AFX_Scripts\\"; 
    //print(brws_ScriptFolder)
    if (brws_ScriptFolder != null)
         var fileList = Folder(brws_ScriptFolder).getFiles(filterJSXFiles);
         //print( fileList)
        function myScript(thisObj){
        function myScript_BuildUI(thisObj){
            var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "AFX SCripts", undefined, {resizeable:true});           
            res = "group{orientation:'row', alignment:['fill', 'fill'] , alignChildren:['fill', 'fill'], \
                groupOne: Group{orientation:'column', alignment:['fill', 'fill'] , alignChildren:['fill', 'fill'], myMultiTreeView: TreeView{}   }     }     }"; // creating a resource string, controls go here
            myPanel.grp = myPanel.add(res);           
            var brws_ScripIconsDir = "Z:\\apps\\after_effects\\burrowsAFX_Script_Icons\\burrowsIconForAFX\\";   
            var jsxExt = ".jsx";
            //Add Treeview items and icons------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ -----//
            var brws_TopNode = myPanel.grp.groupOne.myMultiTreeView.add("node", "Burrows AFX Scripts");
            brws_TopNode.image = File( brws_ScripIconsDir + "BurrowsIcon20x20.png" ); 
            //brws_TopNode.helpTip = "This is the help. Is it not THE greatest thing you have seen?"
            var brws_AsciiGenerator_1_2 = brws_TopNode.add("item", "AsciiGenerator_1_2");     // CURRENTLY THROWS RESOURCE ERROR
            brws_AsciiGenerator_1_2.image = File( brws_ScripIconsDir + "AsciiGenerator_1_2.png");
            // EVENTS----------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ ---------------------------------//
            myPanel.grp.groupOne.myMultiTreeView.addEventListener('change', function (event)
                     if (myPanel.grp.groupOne.myMultiTreeView.selection.text ===  'AsciiGenerator_1_2') { fn_AsciiGenerator_1_2(); }
               }, false);// End of Event Listener
            function fn_AsciiGenerator_1_2()
                var asciiGenLoc = (brws_ScriptFolder + "AsciiGenerator_1_2" + jsxExt);
                var scr_asciiGenLoc =  new File(asciiGenLoc);
                if (scr_asciiGenLoc.exists) { scr_asciiGenLoc.open("r"); var scriptContent = scr_asciiGenLoc.read(); scr_asciiGenLoc.close(); eval(scriptContent); }
                myPanel.grp.groupOne.myMultiTreeView.selection = brws_TopNode;
            //Setup panel sizing----------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ --------------------//
            myPanel.layout.layout(true);
            myPanel.grp.minimumSize = myPanel.grp.size;
            //Make panel resizeable------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ ------------------//
            myPanel.layout.resize();
            myPanel.onResizing = myPanel.onResize = function(){this.layout.resize()}           
            return myPanel;            
            }// End of myScript_BuildUI------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ -------------------// 
        // Create the UI--------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ --------------------------//
        var myScriptPal = myScript_BuildUI (thisObj)
        if( (myScriptPal != null) && (myScriptPal instanceof Window) )
            myScriptPal.center();
            myScriptPal.show();
        }// End of if Statement-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ ---------------------//
        }// End of myScript function
myScript(this);
}// End of script

Similar Messages

  • Auto select new item in tree

    Hi
    I have a tree that i allow user to drag and drop items to it - what is the easiest way so the new item is automatically selected? ie, tree.selectedIndex should point to the new item's index.
    Unfortunately it thought this was easy apparently it was not - like if the nodes in the tree control are collapsed, the selectedIndex is different than when all the nodes are expanded.
    Do note that the way i populate my tree is through a data provider - so i populate a class that would become the tree's data provider, so when the tree refreshes, i simply do this:
    myTree.dataProvider = project.p;   
    I can track where my new item was inserted in my "project" instance - but like i said earlier, the tree itself have different selectedIndex when the nodes are collapsed and when they are not.
    THanks

    Hi,
    I just posted a demo and source code on my blog: Auto select New Item in Tree component
    In above example i use loopAndFind() custom function.
    Hope it helps!
    Mariush T.
    Blog: http://mariusht.com/blog/

  • Need to chart attribute value of just one child node of XML document

    I have a XML document with (for example) 7 parent nodes, each
    parent node has 5 child nodes. The parent nodes have an attribute
    @EarlierDTS (DateTime type) that is the x-axis category of a chart.
    Each child node has an attribute @eventid which specifies the id of
    the event, and another atttribute @NumOccurs which specifies how
    many times that event occured in that period.
    How do I tell Flex I want a simple line chart of the eventID
    = 215? What if I want two lines, for both eventID=215 and
    eventid=307?
    I have studied the posts and blogs for over a week now, and
    have seen this question or similar come up quite a few places, with
    no answer.
    1) Should I focus on learning how to create a filterfunction
    for the XMLList that underlies my XMLListCollection so that the
    filtered data view is just one child node per parent node ( or two
    child nodes for the second case)? And set the filtered data view as
    the dataprovider of my chart's vertical series?
    2) Should I focus on learning how to create a XML Filter
    query that selects just one or two child nodes for each parent
    node, and set the charts' series' dataprovider to this filter
    expression? (I don't think this is allowed - but I'm checking with
    the forum members...)
    3) Should I focus on learning how to convert the
    XMLListCollection into a HierarchicalData object, and then learning
    how to filter this object so there is only one (or two) childs per
    parent? This seems like a lot of coding - I almost have to create a
    pair of classes - one for the parent and one for the child - so I
    can create nested ArrayObjects.
    4) Should I create a brand new XMLList by walking the
    original XML list, and inserting Parent nodes and just the child
    nodes that match the eventID(s) I want to chart, into the new
    XMLList?
    I believe that the easiest way would be to create a
    Filterfunction for the XMLList, and bind the chart series to the
    (filtered) XML List. But the problem with this approach is that I
    have seen more than 2 posts asking how to accomplish filtering that
    removes specific children from the view, with no solutions posted.
    Help! What is the best way to get just one child for each
    parent, from an XMLList?

    "whertzing" <[email protected]> wrote in
    message
    news:[email protected]...
    >I have a XML document with (for example) 7 parent nodes,
    each parent node
    >has 5
    > child nodes. The parent nodes have an attribute
    @EarlierDTS (DateTime
    > type)
    > that is the x-axis category of a chart. Each child node
    has an attribute
    > @eventid which specifies the id of the event, and
    another atttribute
    > @NumOccurs
    > which specifies how many times that event occured in
    that period.
    >
    > How do I tell Flex I want a simple line chart of the
    eventID = 215? What
    > if I
    > want two lines, for both eventID=215 and eventid=307?
    >
    > I have studied the posts and blogs for over a week now,
    and have seen this
    > question or similar come up quite a few places, with no
    answer.
    >
    > 1) Should I focus on learning how to create a
    filterfunction for the
    > XMLList
    > that underlies my XMLListCollection so that the filtered
    data view is just
    > one
    > child node per parent node ( or two child nodes for the
    second case)? And
    > set
    > the filtered data view as the dataprovider of my chart's
    vertical series?
    >
    > 2) Should I focus on learning how to create a XML Filter
    query that
    > selects
    > just one or two child nodes for each parent node, and
    set the charts'
    > series'
    > dataprovider to this filter expression? (I don't think
    this is allowed -
    > but
    > I'm checking with the forum members...)
    >
    > 3) Should I focus on learning how to convert the
    XMLListCollection into a
    > HierarchicalData object, and then learning how to filter
    this object so
    > there
    > is only one (or two) childs per parent? This seems like
    a lot of coding -
    > I
    > almost have to create a pair of classes - one for the
    parent and one for
    > the
    > child - so I can create nested ArrayObjects.
    >
    > 4) Should I create a brand new XMLList by walking the
    original XML list,
    > and
    > inserting Parent nodes and just the child nodes that
    match the eventID(s)
    > I
    > want to chart, into the new XMLList?
    >
    > I believe that the easiest way would be to create a
    Filterfunction for the
    > XMLList, and bind the chart series to the (filtered) XML
    List. But the
    > problem
    > with this approach is that I have seen more than 2 posts
    asking how to
    > accomplish filtering that removes specific children from
    the view, with no
    > solutions posted.
    >
    > Help! What is the best way to get just one child for
    each parent, from an
    > XMLList?
    I'd just look at a dataFunction. There's an example here that
    may point you
    in the right direction:
    http://flexdiary.blogspot.com/2008/08/charting-example.html
    HTH;
    Amy

  • Problem when selecting child node in Hierarchical Tree

    I have a hierarchical tree on a form populated thru a table query(form1). When I click on a child node, it opens form2 which contains a tab canvas. After closing forms, I return to the form1(containing Tree). At this point If I want to click on the same child node, I should be able to open form2 again. This doesn't happen.
    I have the following code in my When-Tree-node_selected trigger:
    Declare
    htree item;
    vnode_label varchar2(50);
    node_clicked FTREE.NODE;
    vnode_value number;
    vnode_depth number;
    v_type number;
    v_value varchar2(100);
    v_form_name varchar2(100);
    v_alert_return number;
    begin
    -- Find the tree itself.
    htree := FIND_ITEM('tree_block.tree');
    node_clicked := :SYSTEM.TRIGGER_NODE;
    vnode_value := FTREE.NODE_label;
    -- Find the value of the node clicked on.
    vnode_label := FTREE.GET_TREE_NODE_PROPERTY (htree,:SYSTEM.TRIGGER_NODE,FTREE.NODE_label);
    vnode_depth := to_number(ftree.get_tree_node_property(htree,:SYSTEM.TRIGGER_NODE,ftree.Node_depth));
    --Open form for node selected on tree and/or specific tab page
    if vnode_depth <> 1 then
    if :system.trigger_node_selected = 'TRUE' then CASE vnode_label
    WHEN 'Personal' then
    v_form_name :='HR_PERSONAL_INFO_UPDATE';
    WHEN 'Citizenship' then
    v_form_name :='HR_PERSONAL_INFO_UPDATE';
    WHEN 'Emergency Contact' then
    v_form_name :='HR_PERSONAL_INFO_UPDATE';
    if id_null(Find_form(v_form_name)) then
    open_form(:global.application_path || v_form_name,ACTIVATE,NO_SESSION,SHARE_LIBRARY_DATA);
    else
    go_form(v_form_name);
    end if;
    END IF;
    elsif vnode_depth = 1 then
    if :system.trigger_node_SELECTED = 'TRUE' then CASE vnode_label
    WHEN 'EMPLOYEE INFO' then
    v_form_name :='HR_PERSONAL_INFO_UPDATE';
    vnode_label := 'Personal';
    WHEN 'REPORTS' then
    v_form_name :='HR_REPORTS';
    vnode_label := '';
    if id_null(Find_form(v_form_name)) then
    v_form_name := :global.application_path || v_form_name;
    open_form(v_form_name,ACTIVATE,NO_SESSION,SHARE_LIBRARY_DATA);--,p_list);
    else
    go_form(v_form_name);
    end if;
    end if;
    end;
    Can anyone please help me? I don't want the user to double click. They should only click once.
    Thanks,
    Mercedes

    Right clicking does not change the current selection. The tree has no way to report what node was right clicked. Only work around is to left click the node you wish then right click it.
    --pat                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to calculate the last selected item in a tree node where we can customize the list to the node.

    Hi,
    I'm new to the Flex field. I got a task where i have a tree (TREE is the id) with X and Y as nodes. In X i have got a list of pages(dataprovider is array collection) added dynamically(means User can configure the pages).On selecting last item(last page) in the list of X node, the  view will be presented with a component say Xlast on the right side which is in view stack. In that component , there is button called NEXT which has to be greyed out for the last page. I tried by calling the below code on viewChange event
    if(viewstack.selectedchild == XlastpageId)
    Nextbtn.enabled = false;
    but this will work only when we know XlastpageId is the lastpage for the tree. but how to implement this when we dont know which is the last page of the X node in a Tree.
    I also tried by calculating the children of the tree on tree click event which is
    if (Tree.selectedItem == TREE.numChildren - 1)
    Nextbtn.enabled = false;
    i know this is wrong because we have 2 children for the tree( X and Y) so it is showing 2-1 and the button is greyed out for the first click.
    Please help me out.
    Thanks in Advance,
    Sw

    Hi,
    According to your post, my understanding is that you want to monitor the last login user’s details.
    There is no out of the box way to achieve it in SharePoint.
    We can use cookie to be a flag for checking whether there is an user just log in. After the page loaded, if the cookie is null, it suggests that there is an user just log in our site, then we
    can get this user’s information using JavaScript Object Model and add the information into a custom list. With this list, we can monitor user’s login details.
    Refer to the following link:
    https://social.technet.microsoft.com/Forums/en-US/0cd4d531-cb61-4d90-aa70-413267f4a735/how-to-know-login-and-logout-details-of-a-user-in-sharepoint-online-2013?forum=sharepointdevelopment
    Besides, here are two similar posts for your reference:
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/1a35283e-0f2a-49b8-b330-801a3cfcd890/programatically-get-all-current-logged-in-users-list-for-a-sharepoint-site?forum=sharepointdevelopmentprevious
    https://social.technet.microsoft.com/Forums/en-US/10953be3-cb1c-40c7-9454-545c8338b551/how-to-know-login-users-count-and-their-details-in-sharepoint-2010-web-application?forum=sharepointgeneralprevious
    Best Regards,
    Lisa Chen
    Lisa Chen
    TechNet Community Support

  • How to avoid the selection of a Parent node and its child node at a time?

    Example:
    consider the below JTree.
    Parent1
    ---->Parent2
    -------->Child3
    Parent3
    ---->Parent4
    My requirement :
    Parent1 and Parent3 can be selected at a time(using ctrl keys)
    Parent2 and Parent4 can be selected at a time
    Parent1 and Parent2 should not allowed to select at a time.
    In general : A parent and any of its child should not be selected at a time.
    How to achieve this? Anyone please help me.

    Thanikai wrote:
    I am very sorry.Whatever for? It's a valid question.
    How do i implement a custom TreeSelectionModel?I would start by going through the source of DefaultTreeSelectionModel so see how the default selection is handled. Also probably check out JTree.EmptySelectionModel to see how selection is prevented.
    Which methods to override?Methods in the class you choose to extend, obviously. But before that you need to firm up certain design decisions: if a parent node is selected and the user attempts to select one of its child nodes, do you select the child and deselect the parent or do nothing/ and vice versa.
    etc.... may form the basis for a future, more specific question accompanied by a [_SSCCE_|http://mindprod.com/jgloss/sscce.html].
    luck, db

  • NodeList.item(i) returns every other child node

    I have used the following code to eliminate null elements from a Node.
    But somehow NodeList.item(i) only returns every other child node.
    The original Node (retNode) is:
    <getHearingDetailsByCaseNoWSResponse><hearingDetailsVO xmlns="http://vo.cis.com"><NOA/><applicationNo>sAppNo0</applicationNo><caseNo/><designation/><docID/><duration/><endTime/><hearDate/><judgeName/><natureOfClaim/><outCome/><outComeTime/><outcomeDate/><remarks/><roomNo/><sessionNo/><stEndTime/><tohCode/><typeHear/></hearingDetailsVO></getHearingDetailsByCaseNoWSResponse>
    retNode.getLength() gives 19 which is correct.
    NodeList lv2List = retNode.getChildNodes();          
    int numOfLv2 = lv2List.getLength();
    if(numOfLv2 == 0) {
         if(!hasAttribute(node)) parent.removeChild(node);
              return;
         for(int i=0; i<numOfLv2; i++) {
              Node lv2Node = lv2List.item(i);
              if(lv2Node == null || lv2Node.getNodeType() != Node.ELEMENT_NODE) continue;
              removeNullElement(lv2Node);     
         }However, lv2List.item(0) returns <NOA/> element, lv2List.item(0) returns <caseNo/>, lv2List.item(1) returns <docID/>, and lv2List.item(9) returns <typeHear/>. From item(10) to item(18) all returns null.
    I was very confused by this.
    I am using Xerces-J implementation. I have set
    System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
    Did I do something wrong or I missed out something?
    Please enlighten me.
    Regards,
    Xinjun

    When an element is removed from a list, the index of each element coming after the removed one will be one less than it was before the removal, so you will have to subtract 1from the variable "i" after you have removed an element and before you start the next cycle in order not to skip the index of the removed element:for(int i=0; i<numOfLv2; i++) {
      Node lv2Node = lv2List.item(i);
      if(lv2Node == null || lv2Node.getNodeType() != Node.ELEMENT_NODE) continue;
      removeNullElement(lv2Node);
      i--
    }

  • XML E4X Select nodes based on child node attribute.

    Hey,
    I am trying to make a selection on following XML.
    I want to retrieve a list of the variable node when its child nodes metadata attribute "name" is not equal to "transient". I have read through the documentation but have not been able to solve this and it should be rather simple. So far I have tried with something like.
    var variables:XMLList = classInfo.variable.(metadata.(@name != "transient"));
    var variables:XMLList = classInfo.variable.(metadata.@name != "transient");
    But it returns all variable nodes.
    <type name="com.sca.dataModel::PresentationDataEntity" base="com.sca.dataModel::BaseEntity" isDynamic="false" isFinal="false" isStatic="false">
      <extendsClass type="com.sca.dataModel::BaseEntity"/>
      <extendsClass type="Object"/>
      <variable name="subtitle" type="String">
        <metadata name="__go_to_definition_help">
          <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/>
          <arg key="pos" value="128"/>
        </metadata>
      </variable>
      <variable name="id" type="Number">
        <metadata name="__go_to_definition_help">
          <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/>
          <arg key="pos" value="153"/>
        </metadata>
      </variable>
      <variable name="tableName" type="String">
        <metadata name="transient"/>
        <metadata name="__go_to_definition_help">
          <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/>
          <arg key="pos" value="118"/>
        </metadata>
      </variable>
      <variable name="db_SortAsc" type="Boolean">
        <metadata name="transient"/>
        <metadata name="__go_to_definition_help">
          <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/>
          <arg key="pos" value="281"/>
        </metadata>
      </variable>
      <variable name="title" type="String">
        <metadata name="__go_to_definition_help">
          <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/>
          <arg key="pos" value="100"/>
        </metadata>
      </variable>
      <method name="setData" declaredBy="com.sca.dataModel::BaseEntity" returnType="*">
        <parameter index="1" type="Object" optional="false"/>
        <metadata name="__go_to_definition_help">
          <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/>
          <arg key="pos" value="330"/>
        </metadata>
      </method>
      <metadata name="__go_to_ctor_definition_help">
        <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/>
        <arg key="pos" value="167"/>
      </metadata>
      <metadata name="__go_to_definition_help">
        <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/>
        <arg key="pos" value="42"/>
      </metadata>
    </type>

    Perfect, that worked!
    Thanks.
    Jonas

  • 6.1 Print Templates - auto select items in the print dialog popup

    In the slide deck I have about 6.1 it says the following:
    •Print Templates
    –Print templates can now be used to auto select items in the
    print dialog popup. By default, the out of the box template
    selects the current specification
    Unfortunately I haven't been able to find how to do this in the EP documentation. Could someone point me in the right direction on how to do this?

    Download Extensibility Pack 2.6. It was just released. Take a look at page 11 in the Print Extensibility Guide. It should have the info you need. If not let me know.
    Here is the link for the downloads:
    https://support.oracle.com/CSP/ui/flash.html#tab=PatchHomePage(page=PatchHomePage&id=h1j503ev())

  • Since upgrading to Firefox 4 I've been unable to select search items from the google drop down box in the toolbar. Instead, I have to retype my search item completely as I also unable to select 'auto-complete' items as they appear.

    Since upgrading to Firefox 4 I've been unable to select search items from the google drop down box in the toolbar. Instead, I have to retype my search item completely as I also unable to select 'auto-complete' items as they appear.

    Known problem with the Google Toolbar extension. <br />
    http://www.google.com/support/toolbar/bin/static.py?page=known_issues.cs

  • How do I create multiple types of child nodes in ADF  Faces Tree Component

    Hi,
    I am trying to construct a tree using ADF Faces. The tree I am trying to develop should look something like:
    - Departments
    + Dept 10
    + Dept 20
    + Dept 30
    + Dept 40
    - Employees
    + SCOTT
    +ALLEN
    + BLAKE
    The nodes shown at the top level should serve as labels, indicating the various types of nodes available.
    I have created the top level RootLabelsViewObj, with a SQL clause:
    select rn, node_label
    from (
    select 1 rn
    , 'Employees' node_label
    from dual
    union all
    select 2 rn
    , 'Departments' node_label
    from dual
    union all
    select 3 rn
    , 'Bonusplans' node_label
    from dual
    I have created ViewLinks between the RootLabelsViewObj and the DeptView and EmpView respectively (created on top of DEPT and EMP table in SCOTT schema), based on the LABEL attribute in the RootLabelsViewObj and with ViewLink SQL specified like:
    :Bind_NodeLabel = 'Departments' for the link with DeptView and :Bind_NodeLabel = 'Employees' for the link with EmpView.
    In the ADF BC Application Module Tester, I get exactly what I want.
    However, when I create a JSF JSPX page and drag the RootLabelsViewObj from the Data Control Panel to the page as ADF Tree, I run into a little issue: it seems like I cannot create a second Branch Accessor rule for the RootLabelsViewObj1: I have created a first Branch Accessor Rule referring to DeptView and now try to create a second one for EmpView, to allow Employees to be displayed under the root label "Employees" - but I cannot.
    The PageDefinition looks like:
    <tree id="RootLabelsViewObj1" IterBinding="RootLabelsViewObj1Iterator">
    <AttrNames>
    <Item Value="Rn"/>
    <Item Value="NodeLabel"/>
    </AttrNames>
    <nodeDefinition DefName="model.RootLabelsViewObj"
    id="RootLabelsViewObjNode">
    <AttrNames>
    <Item Value="NodeLabel"/>
    </AttrNames>
    <Accessors>
    <Item Value="DeptView"/>
    </Accessors>
    </nodeDefinition>
    <nodeDefinition DefName="model.EmpView" id="EmpViewNode">
    <AttrNames>
    <Item Value="Ename"/>
    </AttrNames>
    </nodeDefinition>
    <nodeDefinition DefName="model.DeptView" id="DeptViewNode">
    <AttrNames>
    <Item Value="Deptno"/>
    </AttrNames>
    </nodeDefinition>
    </tree>
    Does anyone know:
    - whether it is possible (intended) to have more than one branch accessor per node (i.e. more than one type of child under a node in the tree)
    - if so, how this can be achieved?
    Right now it looks like I am limited to each node in the tree having only one type of child node.
    Please tell me I am wrong.
    best regards,
    Lucas

    Give this a shot mate
    event.getNativeEventTarget();That will allow you to access the DOM object directly
    Id can be retrieved via
    event.getNativeEventTarget().id;

  • ADF Tree setting focus back to parent node after deletion of child node

    Hi,
    Is there a way to get the focus back to the parent node (or rather any particular node) in a tree?
    I have a use case where we need to get the focus back to the parent node after a child node is deleted.
    Currently the focus is shifted to the next node in the tree, but the need is to get the focus shifted back to the parent node. Also the parent node should be re-invoked to populate to get the latest status after deletion of the child node.
    Any help/pointers?
    Thanks

    Thanks for the reply Frank.
    I saw the link http://sreevardhanadf.blogspot.in/2012/07/showing-next-row-as-current-row-after.html
    However the issue is since I am using custom created tree using POJO tree item (composite object).
    calling myTree.getWrappedData() doesn't gives me a handle to JUCtrlHierBinding and subsequent access to JUCtrlHierNodeBinding.
    my program gives me data like -
    List<MyTreeItem> treeData = (List<MyTreeItem>)treeModel.getWrappedData();
    because my tree model is build using -
    treeModel = new ChildPropertyTreeModel(items, "children");
    where items is List of <MyTreeItem>
    Hence I am unable to get a handle using -
    List nodeParentList = nodeParent .getKeyPath();
    I am programmatically able to invoke the parent node to get the fresh data, only issue is the focus/selection of that node is not happening
    Is there a way around?
    Thanks
    Sachin

  • ContextException: DataNodeInfo(AdminView): unknown child node IO

    Hi all,
    I am getting this exception while creating a Web Dynpro application which provides a drop-down menu (containing a list of tables from SQL server) for the user. The user can select a table from the drop-down, and when he clicks Submit, the contents of the table selected has to be displayed.
    For this, I am creating a node in the context of the view dynamically and also adding attributes to the node corresponding to the columns of the table selected. I am doing this dynamic creation in the wdModifyView(). I am creating the view layout which displays the table-contents dynamically too.
    But when I run the application, I am getting this exception. Following is the complete stack trace,
    com.sap.tc.webdynpro.progmodel.context.ContextException: DataNodeInfo(AdminView): unknown child node IO
         at com.sap.tc.webdynpro.progmodel.context.Paths.followMetaPath(Paths.java:794)
         at com.sap.tc.webdynpro.progmodel.context.Paths.getAttributeInfoFor(Paths.java:234)
         at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.TableAdapter._getAlignment(TableAdapter.java:11239)
         at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.TableAdapter._calculateColumnHAlign(TableAdapter.java:12455)
         at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.TableAdapter.setViewAndNodeElement(TableAdapter.java:398)
         at com.sap.tc.webdynpro.clientserver.uielements.adaptmgr.URAdapterManager.getAdapterFor(URAdapterManager.java:285)
         at com.sap.tc.webdynpro.clientserver.uielements.adaptmgr.URAdapterManager.getAdapterFor(URAdapterManager.java:93)
         at com.sap.tc.webdynpro.clientserver.uielements.adaptbase.AbstractAdapter.getAdapterFor(AbstractAdapter.java:495)
         at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FlowLayoutAdapter$Items.getControl(FlowLayoutAdapter.java:368)
         at com.sap.tc.ur.renderer.ie6.FlowLayoutRenderer.renderFlowLayoutItemFragment(FlowLayoutRenderer.java:288)
         at com.sap.tc.ur.renderer.ie6.FlowLayoutRenderer.renderFlowLayoutFragment(FlowLayoutRenderer.java:244)
         at com.sap.tc.ur.renderer.ie6.FlowLayoutRenderer.render(FlowLayoutRenderer.java:49)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:434)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:133)
         at com.sap.tc.ur.renderer.ie6.ScrollContainerRenderer.renderScrollContainerFragment(ScrollContainerRenderer.java:619)
         at com.sap.tc.ur.renderer.ie6.ScrollContainerRenderer.render(ScrollContainerRenderer.java:74)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:434)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:133)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.UiWindowRenderer.render(UiWindowRenderer.java:52)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:434)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:133)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendHtml(HtmlClient.java:1057)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.fillDynamicTemplateContext(HtmlClient.java:457)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendResponse(HtmlClient.java:1245)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.retrieveData(HtmlClient.java:253)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doRetrieveData(WindowPhaseModel.java:595)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:156)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:150)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Please help...

    Here it is,
    public static void wdDoModifyView(IPrivateAdminView wdThis, IPrivateAdminView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
        //@@begin wdDoModifyView
              if (firstTime) {
              } else {
                   String[] retString = null;
                   java.util.ArrayList arList = new java.util.ArrayList();
                   Context ctx = null;
                   DataSource ds = null;
                   String dataSource = "jdbc/WebCASDS";
                   try {
                        ctx = new InitialContext();
                        if (ctx == null) {
                             wdContext
                                  .wdGetAPI()
                                  .getController()
                                  .getComponent()
                                  .getMessageManager()
                                  .reportSuccess("Error - No Context");
                        ds = (DataSource) ctx.lookup(dataSource);
                        if (ds == null) {
                             wdContext
                                  .wdGetAPI()
                                  .getController()
                                  .getComponent()
                                  .getMessageManager()
                                  .reportSuccess("Error - No dataSource: " + ds);
                   } catch (ContextException ce) {
                        wdContext
                             .wdGetAPI()
                             .getController()
                             .getComponent()
                             .getMessageManager()
                             .reportSuccess("Inside catch1: Context Exception" + ce);
                   } catch (Exception e) {
                        wdContext
                             .wdGetAPI()
                             .getController()
                             .getComponent()
                             .getMessageManager()
                             .reportSuccess("DataSource Look up Exception ");
                   try {
                        IWDDropDownByKey key =
                             (IWDDropDownByKey) view.getElement("DropDownByKey");
                        String TableName1 = key.getSelectedKey();
                        wdContext
                             .wdGetAPI()
                             .getController()
                             .getComponent()
                             .getMessageManager()
                             .reportSuccess("Selected Table : " + TableName1);
                        Statement stmt = null;
                        ResultSet rs = null;
                        ResultSetMetaData rsmtadta = null;
                        int colCount;
                        int x = 0;
                        int i;
                        String[] colName = null;
                        String[] colType = null;
                        String sqlQuery = null;
                        stmt = conn1.createStatement();
                        sqlQuery = "select * from " + TableName1 + "";
                        wdContext
                             .wdGetAPI()
                             .getController()
                             .getComponent()
                             .getMessageManager()
                             .reportSuccess("SQL Query:" + sqlQuery);
                        stmt.execute(sqlQuery);
                        rs = stmt.executeQuery(sqlQuery);
                        rsmtadta = rs.getMetaData();
                        colCount = rsmtadta.getColumnCount();
                        wdContext
                             .wdGetAPI()
                             .getController()
                             .getComponent()
                             .getMessageManager()
                             .reportSuccess("Column Count " + colCount);
                        colName = new String[colCount + 1];
                        colType = new String[colCount + 1];
                        for (i = 1; i <= colCount; i++) {
                             colName[i - 1] = rsmtadta.getColumnName(i);
                             colType[i - 1] = rsmtadta.getColumnTypeName(i);
                             if (colType[i - 1].equalsIgnoreCase("varchar")) {
                                  colType[i - 1] = "ddic:com.sap.dictionary.string";
                             } else if (colType[i - 1].equalsIgnoreCase("datetime")) {
                                  colType[i - 1] = "ddic:com.sap.tut.wd.languages.myDate";
                             wdContext
                                  .wdGetAPI()
                                  .getController()
                                  .getComponent()
                                  .getMessageManager()
                                  .reportSuccess("Column Name " + colName[i - 1]);
                             wdContext
                                  .wdGetAPI()
                                  .getController()
                                  .getComponent()
                                  .getMessageManager()
                                  .reportSuccess("Column Type " + colType[i - 1]);
                        //Creating a node corresponding to the selected table
                        IWDNodeInfo rootNodeInfo = wdContext.getNodeInfo();
                        IWDNodeInfo tableNodeInfo =
                             rootNodeInfo.addChild(
                                  "TableSelected",
                                  null,
                                  true,
                                  false,
                                  true,
                                  false,
                                  false,
                                  true,
                                  null,
                                  null,
                                  null);
                        wdContext
                             .wdGetAPI()
                             .getController()
                             .getComponent()
                             .getMessageManager()
                             .reportSuccess("After node creation");
                        //Creating the attributes for the node created.. corresponding to the columns present in the selected table
                        for (i = 1; i <= colCount; i++) {
                             tableNodeInfo.addAttribute(colName[i - 1], colType[i - 1]);
                        wdContext
                             .wdGetAPI()
                             .getController()
                             .getComponent()
                             .getMessageManager()
                             .reportSuccess("After attribute creation");
                        IWDNode tableNode = wdContext.getChildNode("TableSelected", 0);
                        int rowCount = 0;
                        while (rs.next()) {
                             try {
                                  IWDNodeElement tableElement = tableNode.createElement();
                                  wdContext
                                       .wdGetAPI()
                                       .getController()
                                       .getComponent()
                                       .getMessageManager()
                                       .reportSuccess("Inside while before for, element initialized");
                                  for (i = 1; i <= colCount; i++) {
                                       wdContext
                                            .wdGetAPI()
                                            .getController()
                                            .getComponent()
                                            .getMessageManager()
                                            .reportSuccess(
                                                 "values1..."
                                                      + rs.getObject(
                                                           colName[i - 1].toString()));
                                  for (i = 1; i <= colCount; i++) {
                                       tableElement.setAttributeValue(
                                            colName[i - 1],
                                            rs.getObject(colName[i - 1].toString()));
                                       wdContext
                                            .wdGetAPI()
                                            .getController()
                                            .getComponent()
                                            .getMessageManager()
                                            .reportSuccess("Inside for, element row created");
                                  tableNode.addElement(tableElement);
                                  wdContext
                                       .wdGetAPI()
                                       .getController()
                                       .getComponent()
                                       .getMessageManager()
                                       .reportSuccess("Element created :" + tableElement);
                                  rowCount++;
                             } catch (ContextException ce) {
                                  wdContext
                                       .wdGetAPI()
                                       .getController()
                                       .getComponent()
                                       .getMessageManager()
                                       .reportSuccess(
                                            "Inside catch2: Context Exception" + ce);
                             } catch (ClassCastException e) {
                                  wdContext
                                       .wdGetAPI()
                                       .getController()
                                       .getComponent()
                                       .getMessageManager()
                                       .reportSuccess("Class cast exception" + e);
                        IWDTable table =
                             (IWDTable) view.createElement(IWDTable.class, null);
                        IWDNodeInfo tableNodeCreatedInfo = tableNode.getNodeInfo();
                        table.bindDataSource(tableNodeCreatedInfo);
                        IWDCaption tableCaption =
                             (IWDCaption) view.createElement(IWDCaption.class, null);
                        tableCaption.setText("Table Contents");
                        table.setHeader(tableCaption);
                        for (i = 1; i <= colCount; i++) {
                             IWDTableColumn column =
                                  (IWDTableColumn) view.createElement(
                                       IWDTableColumn.class,
                                       "ColCaption" + i);
                             IWDCaption caption =
                                  (IWDCaption) view.createElement(
                                       IWDCaption.class,
                                       "TableCaption" + i);
                             String header = colName[i - 1];
                             caption.setText(header);
                             column.setHeader((IWDCaption) caption);
                             table.addColumn(column);
                             wdContext
                                  .wdGetAPI()
                                  .getController()
                                  .getComponent()
                                  .getMessageManager()
                                  .reportSuccess("Inside for after creating column header");
                        //                                        IWDUIElementContainer root =
                        //                                                                 (IWDUIElementContainer) view.getRootElement();
                        //                                                            root.addChild(table);
                        int k = 1;
                        while (k <= rowCount) {
                             wdContext
                                  .wdGetAPI()
                                  .getController()
                                  .getComponent()
                                  .getMessageManager()
                                  .reportSuccess("Inside while layout creation after headers are in");
                             for (i = 1; i <= colCount; i++) {
                                  IWDTableColumn innerColumn =
                                       (IWDTableColumn) view.createElement(
                                            IWDTableColumn.class,
                                            null);
                                  IWDNodeElement nodeElement =
                                       tableNode.getElementAt(k - 1);
                                  String attribValue =
                                       nodeElement.getAttributeAsText(colName[i - 1]);
                                  wdContext
                                       .wdGetAPI()
                                       .getController()
                                       .getComponent()
                                       .getMessageManager()
                                       .reportSuccess(
                                            "Inside inner for, attrib value "
                                                 + attribValue);
                                  IWDTextView nameTextview1 =
                                       (IWDTextView) view.createElement(
                                            IWDTextView.class,
                                            "nameTextview" + k + i);
                                  wdContext
                                       .wdGetAPI()
                                       .getController()
                                       .getComponent()
                                       .getMessageManager()
                                       .reportSuccess("After text-view creation");
                                  nameTextview1.bindText(attribValue);
                                  innerColumn.setTableCellEditor(
                                       (IWDTableCellEditor) nameTextview1);
                                  table.addColumn(innerColumn);
                             k++;
                        IWDUIElementContainer root =
                             (IWDUIElementContainer) view.getRootElement();
                        root.addChild(table);
                   } catch (ContextException ce) {
                        wdContext
                             .wdGetAPI()
                             .getController()
                             .getComponent()
                             .getMessageManager()
                             .reportSuccess("Inside catch3: Context Exception" + ce);
                   } catch (RuntimeException e) {
                        wdContext
                             .wdGetAPI()
                             .getController()
                             .getComponent()
                             .getMessageManager()
                             .reportSuccess("Inside catch : runtime exception" + e);
                   } catch (SQLException e) {
                        wdContext
                             .wdGetAPI()
                             .getController()
                             .getComponent()
                             .getMessageManager()
                             .reportSuccess("Inside catch : SQL exception" + e);
                   } catch (Exception e) {
                        wdContext
                             .wdGetAPI()
                             .getController()
                             .getComponent()
                             .getMessageManager()
                             .reportSuccess("..normal exc.." + e);
        //@@end

  • Is it possible to restrict the user from creating a sibling and allow him to ONLY create child nodes in DRM?

    When in a hierarchy, a user right clicks on a node to crate a new node, he has two options
    -Child
    -Sibling
    Is it possible to restrict the user from creating a sibling and allow him to ONLY create child nodes?
    Business cases:
    1. different level nodes need to have different prefixes.
    - Thus, the default prefix property definition uses the level number to assign a prefix
    - Also, a validation, to ensure the correct prefix, uses the level number
    But if the user can create a child and a sibling then the default prefix will only be right for a single case and not both.
    Thanks

    If the images are exactly the same size then make sure the layer with the mask
    is the active layer and in the other documents go to Select>Load Selection and choose
    your document with the layer mask under Source document and under channel choose the layer mask.
    After the selection loads press the layer mask icon at the bottom of the layers panel.
    MTSTUNER

  • I have a table with info and would like to select an item from that table

    Hi
    I have a table with info (course info that I searched for) and would like to select an item from that table to use for further use in my application.
    It must work more or less like the tree structure where I can use an On Action select.
    In other words; let say I am looking for all courses with "Advisor" it its descriptin / name, I want to click on one of the names and use it lets say to book people on.
    Could some please assist me with this.
    Regards
    Debbie

    Hi
    The datasource for my table is the node searchcatalog.  Under this node there is an attribute calles description where the items found are displayed.
    I changed my code as follow:
    data: ls_table type wd_This->Elements_searchcatalog,
          lr_element type ref to if_wd_context_element.
      DATA lo_nd_searchcatalog TYPE REF TO if_wd_context_node.
      DATA lo_el_searchcatalog TYPE REF TO if_wd_context_element.
      DATA ls_searchcatalog TYPE wd_this->element_searchcatalog.
    navigate from <CONTEXT> to <SEARCHCATALOG> via lead selection
      lo_nd_searchcatalog = wd_context->get_child_node( name = wd_this->wdctx_searchcatalog ).
    @TODO handle not set lead selection
      IF lo_nd_searchcatalog IS INITIAL.
      ENDIF.
    get element via lead selection
      lo_el_searchcatalog = lo_nd_searchcatalog->get_element(  ).
    @TODO handle not set lead selection
      IF lo_el_searchcatalog IS INITIAL.
      ENDIF.
    get all declared attributes
      lo_el_searchcatalog->get_static_attributes(
        IMPORTING
          static_attributes = ls_searchcatalog ).
    lo_nd_searchcatalog->get_lead_selection->( exporting index = wdevent->index importing
    element = lr_element ).
    lr_element->get_static_attributes->( importing static_attributes = ls_table ).
    wd_context->set_attribute( exporting name = 'SELECTED' value = ls_table-description ).
    When I try to activate it errors with: List elements that take up more than one line is not allowed.  This error at the sentence: lo_el_searchcatalog->get_static_attributes(
    If you cannot assist me further I will understand.  Thank you.

Maybe you are looking for