Key press selects a node in a tree item

Hi all
I have a tree item.
When i press a key i want to go to the node which first letter is equal to the letter i press.
Is there any way to do that?
I'm using Forms 9
thank you
ricardo carvalho

not using the standard tree-item in forms. You could write your own java-bean to do so.
Have a look at Francois Degrelles JavaBean-page for a quick start.
http://forms.pjc.bean.over-blog.com/article-5029633.html

Similar Messages

  • Selecting multiple nodes of a tree through ctrl+shift

    Can i select multiple nodes of a tree through ctrl+shift.
    How??
    Thanx

    Take a look at JTree#getSelectionModel() and TreeSelectionModel#setSelectionMode(int).
    _myTree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);

  • 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                                                                                                                                                                                                                                                                                                                                                                                                       

  • Tree Bean - how to select a node?

    Can someone help how to select a node of the Tree based on the key programmatically?

    Hi there..
    I use a code like this..
    [Bindable] public var selectedNode:XML;
    [Bindable] public var mynewVar:String;
    public function treeChanged(event:ListEvent) : void   {  
    selectedNode = Tree(event.target).selectedItem as XML;
    mynewVar = selectedNode.@nameofNode;
    Cheers!

  • 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.

  • How to select a node by name in a Tree?

    Hi,
    I require some help:
    I want to select a  Node of a Tree "myTree" by his displayed name.
    I can select a Node by using "myTree.selectedIndex = idx". But how do I get the current Index of that Node?
    Thx

    Hi there..
    I use a code like this..
    [Bindable] public var selectedNode:XML;
    [Bindable] public var mynewVar:String;
    public function treeChanged(event:ListEvent) : void   {  
    selectedNode = Tree(event.target).selectedItem as XML;
    mynewVar = selectedNode.@nameofNode;
    Cheers!

  • 11gR1: expanding the current node in a tree programmatically

    Does anybody know how to programmatically expand the currently selected node in an af:tree in 11gR1? In all honesty I've searched a million OTN posts and tried a lot of examples but haven't got it working yet.
    At it's most simple I have a tree:
    <af:tree id="dirTree" value="#{bindings.NodesViewTree.treeModel}" var="node"
                 selectionListener="#{tbindings.NodesViewTree.treeModel.makeCurrent}" rowSelection="single"
                 binding="#{treeBean.dirTree}" >
      <f:facet name="nodeStamp">
          <af:outputText value="#{node.Name}" id="ot2"/>
      </f:facet>
    </af:tree>...of which the user can select a node, and the selectionListener updates the treeModel's current selected row.
    I want a button whose actionListener programatically takes the current selected row and expands (aka discloses it). I've a bean like follows:
    public class TreeBean {
      private RichTree dirTree;
      public void setDirTree(RichTree dirTree) { this.dirTree = dirTree; }
      public RichTree getDirTree() { return dirTree;  }
      public void doSomething(ActionEvent actionEvent) {
        RowKeySet selectedTreeNodes = dirTree.getSelectedRowKeys();
        RowKeySet disclosedTreeNodes = dirTree.getDisclosedTreeNodes();
       AdfFacesContext.getCurrentInstance().addPartialTarget(dirTree);
    }But I can't figure out what to do from here?
    Further to this say if we did manage to expand the current selected node, and I happened to know the oracle.jbo.Key of one of the expanded node's child nodes, how can I programatically select it.
    As mentioned I know a search of the forums yields a few hits for this topic, but none have yet solved my issue, so I'm hoping somebody can address my problem afresh please.
    Thanks for your assistance,
    CM.

    After a lot of playing it appears the JS approach is a dead-end. Ultimately what I'm attempting to achieve is to allow the user to right click a node in a tree, create a new node, and select the new node for the user. This can't be achieved in JS as the main work of creating the node must be done from the bindings/binding classes only accessible in a backing bean.
    So I've finally come up with a backing bean code solution where the user selects a node in a tree, and via a secondary action of selecting a context menu commandMenuItem the following code is executed. When I say "code solution", unfortunately I mean something that compiles & runs without throwing errors (hurrah!), but (sigh) doesn't work. I'm hoping somebody on the forum can give me a kick in the right direction please.
    The code:
      RichTree dirTree;
      public void anotherExperimentalCreate(ActionEvent actionEvent)  {
        String parentNodeType = getSelectedNodeType();
        if (parentNodeType.equals(DATABASE)) {
          // create user - todo
        } else if (parentNodeType.equals(FOLDER)) {
          // Fetch data from parent row required for new row
          oracle.jbo.domain.Number parentNodeId = getSelectedNodeId();
          oracle.jbo.domain.Number parentNodeTypeId = getSelectedNodeTypeId();
          DCIteratorBinding treeIterator = AdfUtils.findDCIteratorBinding(NODES_VIEW_TREE_ITERATOR);
          RowSetIterator treeRsi = treeIterator.getRowSetIterator();
          // Create new row
          // Why rsi.createAndInitRow? See - http://radio.weblogs.com/0118231/stories/2003/01/17/whyDoIGetTheInvalidownerexception.html
          Row newRow = treeRsi.createAndInitRow(new NameValuePairs(new String[]{"ParentNodeId"}, new Object[]{parentNodeId}));           
          oracle.jbo.domain.Number newNodeId = (oracle.jbo.domain.Number)newRow.getAttribute("NodeId");
          newRow.setAttribute("ParentNodeId", parentNodeId);
          newRow.setAttribute("NodeTypeId", parentNodeTypeId);
          newRow.setAttribute("Name", "New Folder" + newNodeId.toString());
          treeRsi.insertRow(newRow);
          // Commit changes and refresh iterator so it places new child row at correct location in tree
          FacesCtrlActionBinding commitBinding = AdfUtils.findFacesCtrlActionBinding("Commit");
          commitBinding.execute();     
          treeIterator.executeQuery();
          // Rebuild tree's current selected row by grabbing the current selected rows list (from which this action was invoked)
          // and add the additional new row to the end, with the goal of making the new row selected.
          // For "single" selection tree, and fact this routine can only be invoked via selecting a node, we only need
          // first element from iterator
          // Technique for casting to list derived from following OTN post:
          //    ADF Faces  - type of key element!
          List<Key> currentSelectedRowKeys = (List<Key>)dirTree.getSelectedRowKeys().iterator().next();
          ArrayList<Key> newSelectedRowKeys = new ArrayList<Key>();
          // Copy existing selected row keys to our new selected row key list
          for (Key currentSelectRowKey : currentSelectedRowKeys) {
            newSelectedRowKeys.add(currentSelectRowKey);
          // Add our new row's key to the end of the list
          newSelectedRowKeys.add(newRow.getKey());
          RowKeySetTreeImpl newSelectedRowKeySetTree = new RowKeySetTreeImpl();
          newSelectedRowKeySetTree.add(newSelectedRowKeys);
          // **** doesn't work ****
          dirTree.setSelectedRowKeys(newSelectedRowKeySetTree);
          AdfFacesContext.getCurrentInstance().addPartialTarget(dirTree);
      }As per the "doesn't work" annotation above, the problem is when the tree is refreshed via the PPR event, the tree hasn't selected the new row as passed to setSelectedRowKeys. Instead the state of the tree (expand/collapse) is the same as before the code is fired, though the new row is present as a child.
    Has anybody any clues at all on what I can attempt to try next please?
    Regards,
    CM.

  • Key press - Dynamic action

    All,
    I need to assign a value 1 to a page item whenever key is pressed:
    Here what I did:
    1. Created a item P1_SHOW
    2. Created a dynamic action
    Event : Key Press
    Selection Type : Item(s)
    Item(s) : P1_SHOW
    True action: pl/sql
    :P1_SHOW := 1;
    Thanks.

    user-Rachna
    I guess your problem is that you don't see the item :P1_SHOW change in your screen.
    In the action set the "Page Items to Return" to :P1_SHOW.
    You could also use a dynamic action of type "set value" and Set Type "static " this will not set the session state but also will not do a ajax request.
    See the difference between the two methods in [url http://goo.gl/LE4aD]this demo
    Nicolette

  • Tree item when-tree-node-selected fires differently from 6i to 10g.

    In forms 6i, when you keyboard navigate between tree nodes, the wtns trigger will fire. In 10g it does not. In 10g, it will fire if you press the tab key or mouse click on a node.
    Anyone know if this was done on purpose?
    I ran into this after finally trying my props.fmb in 10g. It works fine in 6i, but not in 10g
    copy of my form is here:
    http://www.tailboom.com/oracle.php
    Forms [32 Bit] Version 6.0.8.18.3 (Production) cleint server
    Forms [32 Bit] Version 10.1.2.0.2 (Production)
    I wrote most of the tree handling code for oracle apps APPTREE. This is the code that most if not all tree's in apps uses to build standard tree. So I have a pretty good understanding of the forms tree item. And know the wtns fired for web forms 6i on every node like 6i client server. This is very strange IMO.
    Thanks.
    --pat                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Oleg,
    thanks for the reference. Although the bug you identify deals with when-tree-node-activated, it is possible they fixed the when-tree-node-selected issue at the same time. With my test tree, i can currently duplicate both issues. I tried to download the patch, but it is only available for linux and unix. No windows patch. I don't have my linux env up and running to where I can test yet. So I can not confirm.
    --pat                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How we know the selected node in a Tree object in a form?

    In a TREE object in forms, how can we know the current selected node by clicking a push button.
    lets say , there are 10 nodes in my tree, and 5th one i selected. But i want to store the selected node in a variable, when i click a button.
    please help
    thanks

    Hello
    I've just notice what might be a bug in Oracle forms because when I have the when-tree-node-selected trigger present for the tree (It does not matter if it executes null or some code), the code in option 1 works fine on a when-button-pressed trigger on a button item. This is what I had done to give you a reply.
    My second option will work because you're populating a parameter with when-tree-node-selected trigger which is then readable form anywhere else in the form. All you add is a check on when-button-pressed. Also for bug handling you need to consider setting the value to null when deselecting. I have this option working currently in one of my applications.
    DECLARE
         num_selected NUMBER;
         htree ITEM;
    curren_node FTREE.NODE;
    BEGIN
    htree := find_item('tree.form_list');
    num_selected := ftree.get_tree_property(htree,ftree.selection_count);
    for j in 1..num_selected
    LOOP
    curren_node := ftree.get_tree_selection(htree,j);
    message('hello :'||ftree.Get_Tree_Node_Property(htree,curren_node,ftree.node_value),acknowledge);
    end loop;
    END;     
    cheers
    Q

  • Selecting/highlighting a node in Flex Tree using HierarchicalCollectionView as DataProvider

    Hi,
    I am using GroupingCollection2 as the dataprovider for HierarchicalCollectionView. The GroupingCollection2 takes its data from an ArrayCollection. And finally I have a Tree whose dataprovider is the HierarchicalCollectionView . I want to acheive 2 things:
    1) I want to programatically select/highlight a node in this tree. Using expandItem and passing the Object from the arraycollection is not working.
    2) Refresh the tree if there is a change in the arrayCollection.
    For the second task, I have a Java Layer that gives me the ArrayCollection  (dp for GroupingCollection2) when I fire a CairngormEvent. But the problem is that every node in the tree is duplicated. I can clearly see that say there are 8 items in the array collection but still the tree shows 16 items ( Each item duplicated as the node in the tree.)
    I have been trying to figure this out for many days now without any luck. Any sort of suggestion would be appreciated.
    Thank u in advance.

    I got the refreshing of the tree part by myself. One needs to call the refresh method on the GroupingCollection2 and HierarchicalCollectionView objects when the arraycollection has just arrived from the database.
    But I still havent been able to figure out how to highlight or open a tree node programatically. I am repeating that using (calling / setting) tree.expandItem() and tree.openItems is not helping me. Plz somebody help.

  • Select the multiple nodes in a tree

    Hi Experts,
    We need to select the multiple nodes in a tree.Whatever we are selecting,that has to be added in the table as a tree structure itself.
    For ex:
    A
    |--A1
        |--B1
    If We select the A then A,A1 and B1 has to be added in a table.Please help me out for this.
    Regards
    Nutan
    Edited by: Armin Reichert on Jan 29, 2008 2:33 PM

    Hi,
    You have to create a recursive node and use the tree by nesting UI component
    Following tutorial will be of use
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/webdynpro/wd%20java/wdjava%20tutorials%20and%20articles%20archive/constructing%20a%20recursive%20and%20loadable%20web%20dynpro%20tree.pdf
    Recursive Node
    http://help.sap.com/saphelp_nw70/helpdata/en/5d/97384162316532e10000000a1550b0/frameset.htm
    TreeByNesting
    http://help.sap.com/saphelp_nw70/helpdata/en/92/12a74046033913e10000000a155106/content.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#31 [original link is broken]
    Regards
    Ayyapparaj

  • When i try and open a tab that is the same as the page im currently on i closes it self. not when i type the full address, but when i use the arrow keys to select the url and press enter

    when I try and open a tab that is the same as the page I'm currently on it closes it self. Not when I type the full address, but when I use the arrow keys to select the url and press enter. I just don't like typing in the same address 5 times, when the older Firefox worked.

    Hi
    AutoPunch enabled? Command click in the bottom half of the Bar Ruler to turn it off
    CCT

  • Why only gets one node when select many nodes of tree in DWCS4 on Mac OS

    I use tag <mm:treecontrol> to create tree in DWCS4 on Mac OS.
    When I select many nodes in tree, but I only get one node by method: selectedNodes.
    codes of created tree as following:
    <mm:treecontrol name='tree' size='20' multiple noheaders>
         <mm:treecolumn state='hidden'>
              <mm:treenode value='A' state='expanded'></mm:treenode>
              <mm:treenode value='B' state='expanded'></mm:treenode>
              <mm:treenode value='C' state='expanded'></mm:treenode>
    </mm:treecontrol>
    Who can  tell me reasons?
    Thanks!
    comments: if don't use tag <mm:treecolumn>, tree will not show on Mac OS.

    Hi macbig,
    I finally got to look at my sister's computer. The HDD "Repair Disk" found missing threads, missing directory records, etc. and ended with:
    Error: Disk Utility can't repair this disk. Back up as many of your files as possible, reformat the disk, and restore your backed-
    up files.
    Then, I tried "Verify Disk" and it found invalid volume file count and ended with:
    The volume Macintosh HD was found corrupted and needs to be repaired.
    Error: This disk needs to be repaired. Click Repair Disk
    I guess running Apple Hardware Test is not going to happen. :/
    I've ordered online a new 2.5 disk, make a Maverick boot USB, and start from scratch. Do you have any other suggestions?
    As for the corrupted old hard drive, do you have any suggestions of how to get out the data somehow?
    Thank you so much!

  • How to get UIComponent of the selected node in af:tree with drag and drop

    Hi
    Are there examples showing how one could get a UIComponent using DropEvent to be used with a Popup showing as a custom "context menu" at the target node ?
    Right now, with dropEvent.getDropComponent, we could only get the tree.
    We like to get its selected node so that the popup shows at the node level, not at the tree level.
    Thanks

    Hi Frank
    Thanks for responding.
    We like to show on our custom "context menu" using PopupHints (not using facet name contextmenu) with 3 commandMenuItems.
    Since component id is needed by PopupHints to place this custom "context menu", we tried
    RichTree dropTree = (RichTree)dropEvent.getDropComponent();
    alignId = dropTree.getClientId(context);
    // alignId = pt1:pt_region1:1:pt1:pc1:navTree
    getClientId returns us the tree id and hence the context menu is placed next to tree.
    We like to place the context menu next to a target node of the tree when dragging and dropping.
    But we couldn't figure out how to get that node id.
    In your suggestion,
    List dropRowKey = (List) dropEvent.getDropSite();
    RichTree dropComponent = (RichTree) dropEvent.getDropComponent();
    dropCompoent.setRowKey(dropRowKey);
    how do we then get the id of this node then ? What's the method ?
    Thanks Frank

Maybe you are looking for

  • Is there a way to read the system DoubleClickTime double-click%3F

    Hi, I'm doing some customized actions on a tree if a user "slow-double-clicks" on a valid tag in the tree. My current solution works, but I would like to set the "limit" or interpretation of what constitutes a "slow" double-click based on the system

  • Video Import Problem: Decompressing?

    So I have had Premiere Pro for a couple months now and I don't know why this problem is happening now when it wasn't a few days ago. I try to import my video file (.mpg) and it gives me this error: "There was an error decompressing audio or video." W

  • Problems with Adobe pdf files as attachments in Mail

    I have 4 Adobe pdf files that I can open and view without a problem. The minute I try to attach them to an email to send to someone else, they show in the email as blank pages with the message that in order to be viewed, a more recent version of Adob

  • DOCTYPE in HTML pages.

              Hi,           in weblogic510, the html pages created by a servlet (using HTMLKONA) contain           the DOCTYPE as follows:           <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Draft//EN">           Is it possible to change this to someth

  • Bad iPod Problem!

    About a week ago, my iPod froze on me. I tried resetting it and all my friends tried and no one could figure it out. It gave me the unhappy icon that tells you to go to www.apple.com/support/ipod so I went there and tried everything possible and stil