Selecting node in af:treeTable

Hi! My task is to alter custom selection function on af:table and make it work for treeTable. Make current method I took from this tutorial http://www.oracle.com/technetwork/developer-tools/adf/learnmore/25-generic-tree-selection-listener-169164.pdf
And here is a method that I have to change:
public void TblStagesOnSelect(SelectionEvent selectionEvent) {
GeneralFunction.makeCurrent(selectionEvent);
if(treeTable.getRowAtRangeIndex(treeTable.getCurrentRowIndex()).getAttribute("IdParentStage") == null){
parentUser.setAttributeValue(tf_idUserRespRequest.getValue());
} else{
for (int i=0;i<=treeTable.getEstimatedRowCount()-1;i++){
if (treeTable.getRowAtRangeIndex(treeTable.getCurrentRowIndex()).getAttribute("IdParentStage").equals(treeTable.getRowAtRangeIndex(i).getAttribute("IdStage")))
parentUser.setAttributeValue(treeTable.getRowAtRangeIndex(i).getAttribute("IdUserResp"));
break;
This method was written for table, but it doesn't work on treeTable. Can anyone help?

did u check this
Jdeveloper,Oracle ADF &amp;amp; Java: Tree Table Component in Oracle ADF(Hierarchical Representation)
http://www.oracle.com/technetwork/developer-tools/adf/learnmore/26-get-selected-tree-node-data-169165.pdf

Similar Messages

  • How to get the selected node value of a tree which is build on java code

    Hi Experts,
    How can i get the selected node value if I build the tree programatically.
    I am using the following code in selectionListener but it is throwing error.
    RichTreeTable treeTable = (RichTreeTable)getQaReasontreeTable();
    CollectionModel _tableModel =
    (CollectionModel)treeTable.getValue();
    RowKeySet _selectedRowData = treeTable.getSelectedRowKeys();
    Iterator rksIterator = _selectedRowData.iterator();
    String selectedQaCode ="";
    while (rksIterator.hasNext()) {
    List key = (List)rksIterator.next();
    JUCtrlHierBinding treeTableBinding =
    (JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
    JUCtrlHierNodeBinding nodeBinding =
    treeTableBinding.findNodeByKeyPath(key);
    String nodeStuctureDefname =
    nodeBinding.getHierTypeBinding().getStructureDefName();
    selectedQaCode = selectedQaCode + nodeBinding.getAttribute(0);
    where I am using following link to create a tree with java code.
    http://one-size-doesnt-fit-all.blogspot.com/2007/05/back-to-programming-programmatic-adf.html
    Please help me in resolving this issue.
    Regards
    Gayaz

    Hi,
    you should also move
    JUCtrlHierBinding treeTableBinding =
    (JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
    out of the while loop as this is not necessary to be repeated for each key in the set
    Frank

  • Selected node in a tree table (via Data Controls and not managed bean)

    I am facing some problems in getting the selected row in a tree table.I have used data controls for creating the tree on the page.
    I have 3 POJO's,ex; Class AB which has a list of Class CD.And Class CD has a list of class EF. (Used for the tree table)
    Now i have a java class, called MyDelegate.java which has a list of AB.I generated data controls off this MyDelegate class and have dropped the ABlist as a tree table (also displaying CD and EF in the tree table).
    It displays fine with nodes of AB,CD (child of AB)and EF(child of CD)
    The tree table is not bound to any managed bean.
    For performing actions on the tree, i create a method - "doSomething() in the delegate class",generate data controls and drop it as a button.
    Inside doSomething(), i need acess to the selected node in the tree (it can be a node of type AB or CD or EF).
    The problem: I always get access to the node of type AB, and not the child nodes no matter what i click in the tree table.
    doSomething(){
    DCBindingContainer dcBindingContainer = (DCBindingContainer)ADFUtil.evaluateEL("#{bindings}");
    DCIteratorBinding dcTreeIteratorBinding = dcBindingContainer.findIteratorBinding("lstABIterator");
    RowSetIterator rowTreeSetIterator = dcTreeIteratorBinding.getRowSetIterator();
    DCDataRow rowTree = (DCDataRow)rowTreeSetIterator.getCurrentRow();
    if (rowTree.getDataProvider() instanceof AB) {
              //do something
              AB selectedAB = (AB)row.getDataProvider();
    } else if (rowTree.getDataProvider() instanceof CD){
              //do something
    } else if (rowTree.getDataProvider() instanceof EF) {
              // do something
    How do i access the "selected child node of the tree table" here in the delegate class method? Pls help.

    Hi Frank,
    Thanks for the response. In my case, i dont have a managed bean, so i am slightly unsure how to do it.
    There is a mention "Note that another way to access the treeTable component at runtime is to search for it in JavaServer Faces UIViewRoot. This latter option allows you to write more generic code and does not require to create a page dependency to a managed bean"
    How do i use this adf view root (without a managed bean) to get hold of the selected row in the tree table. Pls help.
    Thanks.

  • Change icon of a non selected node in JTree

    Hello
    I have a swing application contening a JTree.
    I'd like to know how to change the icon of a non selected node in my tree. I have the information about the node and its path. I try to change userObject information and the icon of the node with the setIcon of (DefaultMutableTreeNode), and reload the node (DefaultTreeModel) but it doesn't work.
    Do I have to set the change in my CellRenderer ?
    Any advice will be welcome
    Anne

    If you carefully look at the java tutorial tree, the change is made for all the leaf icon. What I want is to change the icon of a not selected node of my tree while I do other stuff with the other nodes like select, display their contents, drag them ...
    the operation of a not selected node is independant from the selection in the tree.
    So I still ask how to force a node to reload and take care of the change of his icon.
    Anne

  • How could i get the selected node in the JTree

    getLastSelectedPathComponent() �returns the parent node of currenr selected, so how could I get the selected node itself in the JTree
    I will appretiate for any help!

    i think you can get by....
    TreePath treePath = tree.getSelectionPath();
    DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) treePath.getLastPathComponent();

  • JTree: How to get the currently selected node

    How do I get the currently selected node in JTree?
    getLastSelectedPathComponent() this method always return the last selected node and not the current one.
    Thanks in advance
    Sachin

    Use
    TreePath selectedPath = tree.getSelectionPath()If your tree allows multiple selections, use
    TreePath [] selectedPaths = tree.getSelectionPaths() this will return an array of all selected tree paths.
    Once you get the tree path, call the treePath.getLastPathComponent(). this should tell you the currently selected node.
    Hope this helps
    Sai Pullabhotla

  • No properties can be maintained for the selected node (MTE)

    Hi!
    I would like to set up the user defined alerts, e.g. Shortdumps frequency for satellite system from SOLMAN.
    The access of the MTE on the satellite system goes without any problem
    (<SID>\...\R3 Abap\Shortdumps frequency)
    When I set up this alert via System Monitoring and try to access it by double clicking I get the following error: No properties can be maintained for the selected node (MTE).
    Has some one some ideas how to solve this problem?
    Any helpful information will be appreciated.
    regards
    Thom

    Hi,
    Please ensure you have enough(like S_RFCACL) authoraization in both Solman and Your satellite system
    Check here [Solution Monitoring - Regarding MTE|Solution Monitoring - Regarding MTE]
    Thanks,
    Jansi

  • JTree and selected node question

    Hello
    Is it possible to convert the selected node to an int?
    I guess I'm looking for something llike this.
    int nodeNumber = node.getSelectedIndex();
    There is nothing like that in the API, and it would help greatly if I could find a way do this.
    Thanks
    Have a good holiday
    Jim

    From the API for JTree
    public int getMinSelectionRow()
    Gets the first selected row.
    Returns:
    an integer designating the first selected row, where 0 is the first row in the display
    But I think this is based on how many rows are displayed at the present time and might change if the tree is opened above it.

  • Smart forms - COMPLEX SELECTION node in ECC 6.0

    HI ABAPers ,
        Where we can find the COMPLEX SELECTION node in ECC 6.0 ..
    i searched but not able to find .. can you plaese  guide me
    regards
    ravi
    Edited by: Julius Bussche on Feb 18, 2009 9:52 AM
    Please use meaningfull subject titles

    Hi Ravichandra,
    You will find the similar threads and search in SDN
    Re: Complex Section in Smart Form
    Re: complex section of main window :  smart forms
    Regards,
    Sravanthi

  • Auto scrolling to a selected node in Tree

    Hi All,
    In my one of my flex application, i am selected nodes in a tree based on some input. However, if my tree is large and the selected node is at the bottom then i cant see what is selected until i scroll down. Is there any automatic way of scrolling to a node when that node is selected?
    Thanks.

    I have tried the following, but it is not working.
    Tree.scrollToIndex(Tree.selectedIndex);
    Any idea?

  • Right click select node in tree (for a standalone Air app)?

    For the sake of userfriendliness (in regard to a context menu) I wold like to "move" the selected node in a tree to the node that currently has the focus when right clicking it - like how the context menu access in windows file explorer works (focus and selected item are always the same  when right clicking).
    In worst case scenario I would like to disable a created context menu if the selected node and the node that currently has the focus are not the same).
    Now users can get confused when right clicking to access my context menu, in the tree structure, if the selected node and the node they are currently hovering over (and thus are in focus) are different.
    I was thinking of finding which node currently has the focus and then making that node the selected node - but I cant get it to work:-).
    Please, help a beginner.

    Hi,
    Duplicate thread of
    http://swforum.sun.com/jive/thread.jspa?threadID=64518
    MJ

  • Save selected node in Tree control

    I'm making this flex form for my school to add a new student
    to the DB. When the admin clicks on a button it will open a Tree
    control that displays the available courses and sections in the
    following heirarchy:
    Year>Semester>Course Name>Sections
    Now I want that when he clicks on the button Select within
    this new window showing the Tree, it will store the current
    selected node and the full path to it, so that back in the original
    form it will display the Year, Semester, Course name and section.
    I've tried using the value and selecteditem methods from the tree
    control but they are not working. Any ideas to figure out the full
    path of the selected item?

    You will need to climb back up the ancestor nodes to build
    that path yourself.
    "parent()" i believe returns the parent of the current node.
    Tracy

  • I need only to select node with "NodeName" (or/and Number) in a Java Tree

    I need only to select node with "NodeName" (or/and Number) in a Java Tree. Can anybody help me? Thanks a lot

    http://www.jetbrains.com/idea/openapi/5.0/com/intellij/util/ui/tree/TreeUtil.html
    http://www.tangoone.com/swf/docs/javadocs/org/swf/components/TreePane.html
    I fin SelectNode() function here - but I don't know how to connect these clases

  • How to select node in JTree without firing event?

    I have got standard situation. JTree in the left panel, and several edit boxes in right panel. Certainly, I have TreeSelectionListener, which on every tree node selection shows corresponding model values in edit boxes.
    I'd like to implement next logic:
    1. Something was changed in any edit box in right panel. Model has been changed.
    2. User clicks on different node in tree.
    3. Dialog "Message was not saved. Save?" with Yes/No/Cancel buttons are shown.
    Yes/No buttons are easy to handle.
    Question is about Cancel. I'd like on Cancel button left all edit boxes in their present state (do not restore values from saved model) and select back node, which wasn't saved.
    Problem is next. If I select node by setSelectionPath or smth like that, but... JTree fires event and my listener receives onTreeItemSelected back, which checks that node wasn't saved and ......
    Who does have any idea, or have done similar tasks? How can I select node and do not allow tree fire event this time?
    Thanks in advance.

    First, as soon as the model changes (when editing any
    combo box) some flag will be set. Now the logic which
    updates the combo boxes will do it only on a change of
    the current node and (this is new) if the flag wasn't
    set. You should have some flag anyway because somehow
    you must determine when to show the dialog, shouldn't
    you?Yes, I have got this logic implemented. But it's only the half :)
    I know exactly when my model has been changed, but if it was changed, i'd like to ask user what to do next - svae/loose changes/cancel
    And on cancel i'd like to select last edited tree node and do not get event from tree at that moment.
    >
    Second way, prevent selecting a new node if that flag
    has been set. You could do this by subclassing
    DefaultTreeSelectionModel and overriding some methods
    (setSelectionPath() et al).Ok. I'll investigate this.
    >
    MichaelThanks.

  • Treeview Selected Node is not visible

    Hi
    I have below code snippet
                                TreeNode tn = TreeView1.FindNode(DefaultCustomFolderPath);
                                if (tn != null)
                                TreeView1.CollapseAll();                           
                                tn.SelectAction = TreeNodeSelectAction.SelectExpand;
                                tn.Selected = true;
    This code was working fine when i was having Windows XP OS..
    Now that the XP OS has been upgraded to Windows7, it is showing the collapsed tree view only i.e the selected node is not automatically displayed. If you expand the treeview to the selected node, it is selected/highlighted correctly.
    Please help to solve this issue
    Edit: I am using <asp:TreeView>

    There is a different TreeView for every UI Technology (WinForms, WPF, ASP.Net). Plus several 3rd party TreeViews. Please specify wich one you use and ideall repost in the proper (sub)forum for the UI Technology.
    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.

Maybe you are looking for

  • Máquina de Estado

    Bom dia pessoal,   estou com dúvidas na implementação em uma máquina de estado(ME). Estou fazendo uma aplicação que busca adquirir dados, startando com um trigger, analisar estes dados e mostra-los o resultado gráfico da análise. Bem, para complement

  • Merging of multiple rows in an internal table as a single record

    Hi All, I have an internal table which has the following columns: text, date, time, user. it stores notes in the internal table. The problem is...when I save a note with multiple lines and spaces it saves each line of the note as a row in the interna

  • How to download  data into XLSX file in ABAP ECC 6.0 using FM: GUI_DOWNLOAD or any other FunctionModules

    Hi ABAP Exterts, Any one help on this , there is a requirement to download the data into XLSX file only. I am able to to download the data into XLS file using the FM: GUI_DOWNLOAD in SAP ECC 6.0and also opening the file . But when i download the data

  • Stop playing after 1 minute

    iPod shuffle about 2 months old. Since a view days stops playing after 55 seconds. No indication on the LEDs. If you press Pause/Play green LED blinks for 1 minute. It seems all other functions are there but no audio output. iPod is in room temperatu

  • Can I get markers in FCP to work like locators in Avid?

    Hi all, I am used to working with Avid's locators. I might be working on an episode of television and I will put a locator at each commercial break for easy navigation while the director and I are still fine cutting. If we extend a segment, then the