Right click tree node

Hello all,
I need to process right click on the tree node. I can get the node and process the action well. But the problem is that the selected node doesn't have a gray box (selection indicator) like when I left click it.
Please help me with this,
Thanks,
Fantabk

Dear Siva,
You can follow the following steps:-
- Create local class (eg:- lcl_screen_handler) as handler class.
- Define and implement methods handle_node_context_menu_req and handle_node_context_menu_sel for handling right click.
- In Method handle_node_context_menu_req use CALL METHOD menu->add_function for adding entries to context menu.
- In Method handle_node_context_menu_sel based on node_key and fcode handle logic for right click.
- Define event handler (eg:- grc_event_handler     TYPE REF TO lcl_screen_handler) to handle events for right click on tree.
- After creating Tree, specify events that are to be handled and assign them to tree instance
eg:- lwa_event-eventid = cl_simple_tree_model=>eventid_node_double_click.
      lwa_event-appl_event = ' '.   "system event, does not trigger PAI
      APPEND lwa_event TO lit_event. (where, lit_event TYPE cntl_simple_events)
- Also, register PAI for context menu as follows:-
Process PAI if context menu select event occurs
  CALL METHOD grc_tree->set_ctx_menu_select_event_appl (where grc_tree is Tree instance)
    EXPORTING
      appl_event = 'X'.
- Register Tree events as follows:-
CALL METHOD grc_tree->set_registered_events
    EXPORTING
      events                    = lit_event ....
- Create event handler instance for tree
  CREATE OBJECT grc_event_handler. (where, grc_event_handler is already declared on top)
- Set event handler method to handle various events on tree node
eg:-  SET HANDLER grc_event_handler->handle_node_double_click FOR grc_tree.
        SET HANDLER grc_event_handler->handle_node_context_menu_req FOR grc_tree.
        SET HANDLER grc_event_handler->handle_node_context_menu_sel FOR grc_tree.
The events should be handled now. I have followed this approach and it worked for me.
Regards,
Ashish

Similar Messages

  • 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

  • In ADF Tree how to Navigate to Pages When Clicking Tree Node   (TP4)  ?

    hi
    I know how to use af:tree as master-detail tree
    by draging detail views from Data Controls and dropping in JSF
    Page but I would like to know how to call other pages when double-clicking child nodes in the tree. in JDeveloper 11 TP4 & Windows XP
    Anybody can help?
    best regards
    Forakora;

    Hi,
    if it has to be a double click then this can be done with a clientListener that calls a JavaScript function and that you set to the doubleClickEvent type e.g.
    handleTreeSelection(event){
    // do here what you need to do
    queue event to a serverListener that references a managed bean. Use managed bean to
    navigate to another page
    Out of curiousity, what is the usecase ?
    Frank

  • Select tree node in tree component

    hi,
    i am developing a web site which has a site map as a tree component, the sitemap is a inserted in a page fragment, users could click tree nodes to go to corresponding pages. also on other pages, i have next and previous buttons which allow users to navigate through pages. the question is how can i update the tree component when users navigate using the next and previous buttons so that the correct tree node is highlighted?
    i tried to use the selected property for the tree component, but it does not do anything.
    thanks,
    lee

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

  • Context Menu on the right click of af:tree node

    Hi Experts,
    I am using drag and drop functionality in af:tree.In that i used one tree for drag source and another one tree for drop target,and it is working as expected.
    Now I want to bring one additional option in the context menu of the target tree node that is ,when i right click on any of the target tree node in addition to the default menu options like "Collapse","Expand" i want to add one more option .For this i added "contextMenu" facet after the "nodeStamp" facet inside the tree.
    *<f:facet name="contextMenu">*
    *<af:popup id="p1">*
    *<af:menu text="Delete" id="m1">*
    *<af:commandMenuItem text="Delete" id="cmi1"*
    *action="#{myWorkflow.deleteWorkflowNode}"/>*
    *</af:menu>*
    *</af:popup>*
    *</f:facet*>
    Now the problem is : before using drag and drop the context menu workes without any problem .But after using drag and drop the context menu is not popped up.
    can anybody help me to resolve this?
    Thanks,
    Priya.

    Hi Frank,
    1. I am using JDeveloper 11.1.1.3 version
    2. Drop target tree is having the context menu.
    3. Yes . In Drop event am calling a backing bean method with return type DnDAction and i return the value as DnDAction.MOVE to reflect the changes in the database table to the target tree.
    Regards,
    Priya.

  • On right click, the focus is not set on tree node.

    Dear members,
    I have a tree and a database block, when i right click on a tree node, the focus is not set on the node.
    If I first click on the node and then right click on selected node it populate the database block.
    But I want to populate the datablock on right click.
    how to implement it?
    Regards:

    No body ever encountered this problem?
    Any advice would be appreciated.
    Thanks

  • Select multiple nodes in a JTree a right click

    Hi all,
    I've a JTree and I'd like to allow the user select some nodes (one or more) right click and than show a popupMenu.
    This behavior seems not to be easy, because if I select a single node (right clicking on it) the node does not appear selected ; I need to select it left clicking and than everything works fine.
    I read some posts found in the forum and the solution seems to be :
    - attach a mouseListener to the JTree
    - get the TreePath of the node selected
    - force the selection on the node with setSelectionPath(TreePath)
    This works fine if you need to select only one node, cause if you have to select more, you simply cannot.
    I wonder a so obvious behavior is so hard to achieve.
    I hope somebody out there had made the magic.
    Any help would be appreciated.
    Flavio Palumbo

    Hi Darryl,
    I wrote the test case below.
    Using the methods you suggested it works almost fine.
    The only behavior not desired is when you select a range (shift or control), release the key an than right click ; in this case remains selected the only node you clicked on ; to select the range clicking with the right button, you have to keep pressed the key.
    Any hint would be appreciated.
    Flavio
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import javax.swing.JFrame;
    import javax.swing.JMenuItem;
    import javax.swing.JPopupMenu;
    import javax.swing.JTree;
    import javax.swing.SwingUtilities;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.TreePath;
    public class TestTree {
        JTree jtr = null;
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    new TestTree();
        public TestTree() {
            JFrame jf = new JFrame();
            jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            try {
                javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
                javax.swing.SwingUtilities.updateComponentTreeUI(jf);
            } catch (Throwable e) {
            jf.setPreferredSize(new java.awt.Dimension(200, 560));
            javax.swing.JScrollPane js = new javax.swing.JScrollPane();
            DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
            jtr = new JTree(root);
            jtr.addMouseListener(new TestTreeML());
            js.setViewportView(jtr);
            jf.getContentPane().add(js);
            for (int i = 0; i < 20; i++) {
                DefaultMutableTreeNode nodoFiglio = new DefaultMutableTreeNode("nodo" + i);
                ((DefaultTreeModel) jtr.getModel()).insertNodeInto(nodoFiglio, root, root.getChildCount());
            jf.pack();
            jf.setVisible(true);
        public class TestTreeML extends MouseAdapter {
            @Override
            public void mousePressed(MouseEvent e) {
            @Override
            public void mouseClicked(MouseEvent e) {
                try {
                    if (!e.getSource().equals(jtr)) {
                        return;
                    TreePath tpSel = jtr.getPathForLocation(e.getX(), e.getY());
                    if (tpSel == null) {
                        return;
                    int i = 0;
                    final DefaultMutableTreeNode node = (DefaultMutableTreeNode) tpSel.getLastPathComponent();
                    TreePath[] tpExisting = null;
                    if (e.isControlDown() || e.isShiftDown()) {
                        System.out.println("control/shift");
                        TreePath[] tpEx = jtr.getSelectionPaths();
                        tpExisting = java.util.Arrays.copyOfRange(tpEx, 0, tpEx.length + 1);
                        i = tpEx.length;
                    } else {
                        tpExisting = new TreePath[1];
                    tpExisting[i] = tpSel;
                    jtr.setSelectionPaths(tpExisting);
                    if (e.getClickCount() == 2) {
                        System.out.println("double click on " + node.getUserObject());
                    if (javax.swing.SwingUtilities.isRightMouseButton(e)) {
                        if (!e.isControlDown()) {
                            jtr.setSelectionPath(tpSel);
                        JPopupMenu menu = new JPopupMenu();
                        JMenuItem it0 = new JMenuItem("Option1");
                        it0.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                System.out.println("Option1 on " + node.getUserObject());
                        menu.add(it0);
                        JMenuItem it1 = new JMenuItem("Option2");
                        it1.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                System.out.println("Option2 on " + node.getUserObject());
                        menu.add(it1);
                        menu.show(jtr, e.getX(), e.getY());
                } catch (Throwable t) {
    }

  • How to find the coordinates of a mouse click in a Tree node ?

    Hello
    I have a JTree that have few nodes. The nodes contain an icon and a label (using custom cell renderer) and I want to receive right clicks on the icon and show a popup menu.
    The problem is I can only get the right click on the whole tree node, not only the icon.
    I tried two approaches:
    1. register the mouse listener directly with the icon in the cell renderer. That doesnt work since the events received by the tree node do not propagate to its sub-components.
    2. Register the event with the JTree itself and then try to find which part of the tree node was clicked (see if it was within the coordinates of the icon).
    But I cant get the node's coordinates or width.
    I tried using SwingUtilities.convertPoint or SwingUtilities.ConvertMouseEvent but it just doesnt work with DefaultMutableTreeNode.
    Any ideas how to do it ?

    user11973359 wrote:
    1. register the mouse listener directly with the icon in the cell renderer. That doesnt work since the events received by the tree node do not propagate to its sub-components.No, it doesn't work because a renderer isn't added to any component hierarchy. It isn't in any way a 'sub-component'.
    Read about editor and renderer concepts in the Oracle tutorial on How to Use Tables.
    user11973359 wrote:
    2. Register the event with the JTree itself and then try to find which part of the tree node was clicked (see if it was within the coordinates of the icon).
    But I cant get the node's coordinates or width.<tt>getPathForLocation(...) </tt>in conjunction with<tt> getPathBounds(...)</tt>.
    db

  • How to handle Right Click Event in Tree

    Hi ,
    I am Vaibhav. I have create a tree in Apex 4.0. I have to add options insert,update,delete in right click on tree node. So
    what is the solution for this scenario.
    Thanks in advance,
    Vaibhav
    Edited by: user10600404 on Apr 27, 2011 2:46 AM

    hi
    Thanks for reply,
    I have add this in tree query
    select case when connect_by_isleaf = 1 then 0
    when level = 1 then 1
    else -1
    end as status,
    level,
    rt.NAME as title,
    null as icon,
    ex.ID as value,
    null as tooltip,
    null as link
    from TREE_MASTER ex
    inner join ROOT_MASTER rt
    on ex.PARENT_ID=rt.ID
    start with ex.PARENT_ID = 11
    connect by prior ex.PARENT_ID=ex.CHILD_ID
    But tree title not looks in correct way It Looks like as Javascript synatax. So what is the solution for this ?
    Regards,
    Vaibhav

  • Highlight an ADF tree node when it is clicked

    Hello every onei ,
    Does anybody has any idea how to highlight an ADF tree node when it is clicked ?
    Here is my scenario:-
    I have a popup which has a tree component on left and when we click on any node in the tree we have to display the corresponding page on right side.
    As the tree is common for all pages in the popup, i created an XHTML template with tree. All the treenode pages will use this template to display the tree.This template i am using to implement in rest of the pages.
    So when i click any link on this tree will load the corresponding JSP. But i am loosing focus. i mean selected node is not highlighting. Because we are loading the entire target page with template.
    Could any let me know how to highlight the tree node ?
    The Main problem is we are not using ADF controllers. We are using managed beans, these managed beans attached to the JSPX pages.
    Kindly guide me if any one knows solution.
    Thanks & Regards,
    Sai Sravan.P

    Hello Sai,
    I am afraid you have posted your question in the wrong forum. This forum is about Oracle On Track Communication, a next-generation social enterprise collaboration product.
    Please re-post your question in an ADF related forum and I am sure someone will be able to answer.
    Thank you,
    Ernst.

  • Help for Activating Editing Mode on F2 Keyboard Click for a Tree Node

    I have a Jtree with several Nodes on the Left Pane. On the Right Pane I have a nodes corresponding Screen with many properties. There is a way to change the Node Name by editing the Name Field property on the Right.
    I want to Edit the tree Node name by Clicking F2 on the selected Node, Get it in the Editable Mode, Change the name and press enter. How Do I activate this editable Mode on Click of Keyboard F2 Button.

    tree.setEditable( true );

  • When generate automatically a JTable after a click on a tree node

    final int x[] = {0, 1, 2, 22, 0, 2, 0, 1, 0, 2};
    final int y[] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3};
    final int larg[] = {1, 1, 20, 1, 2, 21, 1, 22, 2, 22};
    final int haut[] = {1, 1, 1, 1, 1, 1, 1, 1, 22, 22};
    final int px[] = {5, 5, 85, 5, 0, 0, 0, 0, 0, 0};
    final int py[] = {2, 0, 0, 0, 2, 0, 2, 0, 94, 0};
    //****************** POSITIONNEMENT DES COMPOSANTS
    final Container conteneur = getContentPane();
    final GridBagLayout gridBg = new GridBagLayout();
    conteneur.setLayout(gridBg);
    final GridBagConstraints contrainte = new GridBagConstraints();
    contrainte.fill = contrainte.BOTH;
    //*********** JCOMBO1 **************
    borneDate1 = new JComboBox();
    Calendrier req = new Calendrier();
    String[] valCal = req.lireDansTable();
    borneDate1.addItem("");
    for (int i = 0; i<= valCal.length - 1; i++){
          borneDate1.addItem(valCal);
    contrainte.gridx = x[0];
    contrainte.gridy = y[0];
    contrainte.gridwidth = larg[0];
    contrainte.gridheight = haut[0];
    contrainte.weightx = px[0];
    contrainte.weighty = py[0];
    contrainte.insets = new Insets(1, 1, 1, 1);
    contrainte.ipadx = 20;
    gridBg.setConstraints(borneDate1, contrainte);
    conteneur.add(borneDate1);
    //*********** JCOMBO2 **************
    borneDate2 = new JComboBox();
    req = new Calendrier();
    valCal = req.lireDansTable();
    borneDate2.addItem("");
    for (int i = 0; i<= valCal.length - 1; i++){
    borneDate2.addItem(valCal[i]);
    contrainte.gridx = x[1];
    contrainte.gridy = y[1];
    contrainte.gridwidth = larg[1];
    contrainte.gridheight = haut[1];
    contrainte.weightx = px[1];
    contrainte.weighty = py[1];
    gridBg.setConstraints(borneDate2, contrainte);
    conteneur.add(borneDate2);
    //*********** JLABEL1 **************
    lbl1 = new JLabel(" Dates de S�lection.");
    contrainte.gridx = x[2];
    contrainte.gridy = y[2];
    contrainte.gridwidth = larg[2];
    contrainte.gridheight = haut[2];
    contrainte.weightx = px[2];
    contrainte.weighty = py[2];
    gridBg.setConstraints(lbl1, contrainte);
    conteneur.add(lbl1);
    //*********** BOUTON IMPRIMER **************
    btmImprimer = new JButton("IMPRIMER");
    contrainte.gridx = x[3];
    contrainte.gridy = y[3];
    contrainte.gridwidth = larg[3];
    contrainte.gridheight = haut[3];
    contrainte.weightx = px[3];
    contrainte.weighty = py[3];
    gridBg.setConstraints(btmImprimer, contrainte);
    conteneur.add(btmImprimer);
    //*********** BOUTON AUJOURD'HUI **************
    btmAujourdhui = new JButton("Ce jour");
    contrainte.gridx = x[4];
    contrainte.gridy = y[4];
    contrainte.gridwidth = larg[4];
    contrainte.gridheight = haut[4];
    contrainte.weightx = px[4];
    contrainte.weighty = py[4];
    gridBg.setConstraints(btmAujourdhui, contrainte);
    conteneur.add(btmAujourdhui);
    //*********** JLABEL 2 **************
    lbl2 = new JLabel(" Journal.");
    //lbl2.setVisible(false);
    contrainte.gridx = x[5];
    contrainte.gridy = y[5];
    contrainte.gridwidth = larg[5];
    contrainte.gridheight = haut[5];
    contrainte.weightx = px[5];
    contrainte.weighty = py[5];
    gridBg.setConstraints(lbl2, contrainte);
    conteneur.add(lbl2);
    //*********** JLABEL 3 **************
    lbl3 = new JLabel(" Adresse ");
    contrainte.gridx = x[6];
    contrainte.gridy = y[6];
    contrainte.gridwidth = larg[6];
    contrainte.gridheight = haut[6];
    contrainte.weightx = px[6];
    contrainte.weighty = py[6];
    gridBg.setConstraints(lbl3, contrainte);
    conteneur.add(lbl3);
    //*********** JTEXTFIELD **************
    txtPath = new JTextField();
    contrainte.gridx = x[7];
    contrainte.gridy = y[7];
    contrainte.gridwidth = larg[7];
    contrainte.gridheight = haut[7];
    contrainte.weightx = px[7];
    contrainte.weighty = py[7];
    gridBg.setConstraints(txtPath, contrainte);
    conteneur.add(txtPath);
    //*********** JTREE **************
    DefaultMutableTreeNode racine = new DefaultMutableTreeNode("MEDIACAST");
    //**********RECUPERER LES LIGNES ANIMATEUR*******
    parentNode = new DefaultMutableTreeNode("ANIMATEURS");
    racine.add(parentNode);
    GenererEnregistrement enregAnimateur = new GenererEnregistrement();
    String[] sEnregAnim = enregAnimateur.lireDansTable("SELECT numero_anim FROM animateur ORDER BY numero_anim", "numero_anim");
    for(int i = 0; i <= sEnregAnim.length - 1; i++){
    fils = new DefaultMutableTreeNode(sEnregAnim[i]);
    parentNode.add(fils);
    //************RECUPERER LES LIGNES COMPTE******************
    parentNode = new DefaultMutableTreeNode("COMPTES");
    racine.add(parentNode);
    GenererEnregistrement enregCompte = new GenererEnregistrement();
    String[] sEnregCompte = enregCompte.lireDansTable("SELECT id_compte FROM compte ORDER BY id_compte", "id_compte");
    for(int i = 0; i <= sEnregCompte.length - 1; i++){
    fils = new DefaultMutableTreeNode(sEnregCompte[i]);
    parentNode.add(fils);
    //************RECUPERER LES LIGNES DATE******************
    parentNode = new DefaultMutableTreeNode("DATES");
    racine.add(parentNode);
    GenererEnregistrement enregDate = new GenererEnregistrement();
    String[] sEnregDate = enregDate.lireDansTable("SELECT daty FROM calendrier ORDER BY numero_enreg", "daty");
    for(int i = 0; i <= sEnregDate.length - 1; i++){
    fils = new DefaultMutableTreeNode(sEnregDate[i]);
    parentNode.add(fils);
    //*************AFFICHAGE******************
    TreeNode root = racine;
    arbre = new JTree(root);
    JScrollPane paneTree = new JScrollPane();
    //**********EVENEMENT CLICK DROIT DANS JTREE***************
    MouseListener ml = new MouseAdapter() {
    public void mousePressed(MouseEvent e) {
    int selRow = arbre.getRowForLocation(e.getX(), e.getY());
    TreePath selPath = arbre.getPathForRow(selRow);
    if(selRow != -1) {
         if(e.getButton() == 1) {
         txtPath.setText(selPath.toString());
         //**-> CREER LE VECTEUR POUR JTable**<-
         String sPere = txtPath.getText();
         int iResComp = sPere.compareTo("[MEDIACAST, ANIMATEURS]" + arbre.getLastSelectedPathComponent().toString() + "]");
         //****ANIMATEURS***************
         switch(iResComp){
         case -49:
              String sReq = "SELECT animateur.matricule, animateur.prenom, calendrier.daty, compte.id_compte";
              sReq = sReq + " " + "FROM animateur, liaison";
              sReq = sReq + " " + "WHERE animateur.numero_anim = ? AND liaison.numero_anim = ? AND calendrier.daty = liaison.daty";
              String[] sParamIn = {
              arbre.getLastSelectedPathComponent().toString(), arbre.getLastSelectedPathComponent().toString()
              String[] sTypeParamIn = {
              "entier", "entier"
              String[] sParamOut = {
              "matricule", "prenom", "daty", "id_compte"
              GenererEnregistrement enreg = new GenererEnregistrement();
              objEnreg = enreg.retournerToutEnreg(sReq, sParamIn, sTypeParamIn, sParamOut);
              iNbEnreg = enreg.donnerNbEnreg(sReq, sParamIn, sTypeParamIn, sParamOut);
              Object[] teteTable = {
              "Matricule","Prenom","Date", "Numero Compte"
                                            data = clickTreeNode(teteTable.length, iNbEnreg, sParamOut.length, objEnreg);
              tableau = new JTable(data);
                                            //*********** JTABLE **************
              JScrollPane paneTab = new JScrollPane(tableau);
              contrainte.gridx = x[9];
              contrainte.gridy = y[9];
              contrainte.gridwidth = larg[9];
              contrainte.gridheight = haut[9];
              contrainte.weightx = px[9];
              contrainte.weighty = py[9];
              gridBg.setConstraints(paneTab, contrainte);
              conteneur.add(paneTab);
              break;
              else if(e.getButton() == 3) {
                   arbre.setSelectionPath(selPath);//Donne le focus au noeud click�
                   txtPath.setText(selPath.toString());
              //***********POUR LES NOEUDS PERES*******************************
              if(arbre.getLastSelectedPathComponent().toString() == "ANIMATEURS"){
                   System.out.println(selPath.getParentPath().toString());
              //***********POUR LES NOEUDS FILS********************************
              String sPere = txtPath.getText();
              int iResComp = sPere.compareTo("[MEDIACAST, ANIMATEURS]" + arbre.getLastSelectedPathComponent().toString() + "]");
              switch(iResComp){
                   case -49:
                        System.out.println("NOEUDS DANS ANIMATEURS:" + iResComp + " " + arbre.getLastSelectedPathComponent().toString());
                        break;
                   case 2:
                        if(arbre.getLastSelectedPathComponent().toString() != "COMPTES")
                             System.out.println("NOEUDS DANS COMPTES:" iResComp " " + arbre.getLastSelectedPathComponent().toString());
                             break;
                   case 3:
                        if(arbre.getLastSelectedPathComponent().toString() != "DATES")
                             System.out.println("NOEUDS DANS DATES:" + iResComp + " " + arbre.getLastSelectedPathComponent().toString());
                             break;
              arbre.addMouseListener(ml);
              paneTree.setViewportView(arbre);
              contrainte.gridx = x[8];
              contrainte.gridy = y[8];
              contrainte.gridwidth = larg[8];
              contrainte.gridheight = haut[8];
              contrainte.weightx = px[8];
              contrainte.weighty = py[8];
              gridBg.setConstraints(paneTree, contrainte);
              conteneur.add(paneTree);
              //Afficher la fen�tre
              ImageIcon ico = new ImageIcon("c:\\works\\mediacast\\gpao\\hlpglobe.gif");
              this.setIconImage(ico.getImage());
              //this.pack();
              this.setVisible(true);
    I want to generate automatically a table after a click on a tree node but I don't know when to procede

    Please do the following.<br><br>
    #In the location bar, type '''about:config''' and hit Enter.<br><br>
    #In the filter at the top, type: '''keyword.URL'''<br><br>
    #Double click it and remove whatever's in there and replace it with http://www.google.com/search?q= and then click OK.<br><br>
    #Close the tab
    The URL to add in "keyword.URL" becomes a link in this post, so right click it and choose "Copy Link Location" to copy it to the Windows clipboard. Then hit CTRL+V to paste it. Saves you having to type the whole thing.
    '''To reset your home page, do the following'''.<br><br>
    * Go to the site you want to set as your homepage.<br><br>
    * Click the Firefox button, go to '''Options '''| '''Options '''| '''General'''.<br><br>
    * Make sure it says "''Show My Homepage''" in the first dropdown menu.<br><br>
    * Click the button called "'''Use Current Pages'''" to set the homepage to the one you have on the screen.<br>
    N.B. Some of your plugins are out of date which exposes your system to attack. Please visit the [http://www.mozilla.com/en-US/plugincheck/ Plugins Check] page and update where necessary.
    Also, click '''Help '''| '''Check For Updates''' to update Firefox to 3.6.19

  • Drop through right click on LabVIEW Tree

    I have a LabVIEW Tree control on my front panel and I would like to allow the user to select an item on the tree with a right click. I believe it's called right click drop through, but I can't find any information on it. Is it possible to do this?
    Jim Haas
    Solved!
    Go to Solution.

    One way to do this would be to use the Tree:Mouse Down? filter event case.  Wire a '1' constant to the Button Output Data Node and all clicks will be treated as a left-click.

  • Displaying a context menu on right click on rich tree

    Please see the code below. I want to display a context menu on right click on a rich tree.
    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:a4j="http://richfaces.org/a4j"
          xmlns:rich="http://richfaces.org/rich">
        <style>
            .col1{ width:50%; vertical-align:top;
        </style>
        <h:form>   
            <h:panelGrid columns="1" width="100%" columnClasses="col1">
                 <rich:tree style="width:300px" nodeSelectListener="#{simpleTreeBean.processSelection}"
                    switchType="client"
                    value="#{simpleTreeBean.treeNode}" var="item" id="item">
                    <rich:componentControl event="onClick" for="menu" operation="show">
                    <f:param value="#{item.data}" name="send" />
                </rich:componentControl>
                </rich:tree>
                </h:panelGrid>
            <a4j:outputPanel ajaxRendered="true">
                <rich:panel>
                    <f:facet name="header">Last Menu Action</f:facet>
                    <h:outputText escape="false" value="Right Click :  #{simpleTreeBean.nodeTitle}" id="selectedNode" />
                    <br/>
                </rich:panel>      
            </a4j:outputPanel>
                 <rich:contextMenu event="oncontextmenu" actionListener="#{SimpleTreeBean.processCurrElement}" attached="true" id="menu" submitMode="ajax">
                <rich:menuItem ajaxSingle="true">
                <b> #{simpleTreeBean.nodeTitle}</b> Send To
                    <a4j:actionparam name="det" assignTo="#{ddmenu.current}" value=" #{simpleTreeBean.nodeTitle}"/>
                </rich:menuItem>
            </rich:contextMenu>
        </h:form>
    </ui:composition> With this code, i need left click at first then right click, then it will show the selected node. I want to get the value of the node title on right click. Please help me with it. The SimpleTreeBean code:
    package com.dW;
    import java.awt.event.ActionEvent;
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Properties;
    import javax.faces.FacesException;
    import javax.faces.context.ExternalContext;
    import javax.faces.context.FacesContext;
    import org.richfaces.component.UITree;
    import org.richfaces.event.NodeSelectedEvent;
    import org.richfaces.model.TreeNode;
    import org.richfaces.model.TreeNodeImpl;
    public class SimpleTreeBean
        private TreeNode rootNode = null;
        private String nodeTitle;
        private static final String DATA_PATH = "images/simpleTreeData.properties";
        private void addNodes(String path, TreeNode node, Properties properties) {
            boolean end = false;
            int counter = 1;
            while (!end) {
                String key = path != null ? path + '.' + counter : String.valueOf(counter);
                String value = properties.getProperty(key);
                if (value != null) {
                    TreeNodeImpl nodeImpl = new TreeNodeImpl();
                    nodeImpl.setData(value);
                    node.addChild(new Integer(counter), nodeImpl);
                    addNodes(key, nodeImpl, properties);
                    counter++;
                } else {
                    end = true; } }  }
        private void loadTree() {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            ExternalContext externalContext = facesContext.getExternalContext();
            InputStream dataStream = externalContext.getResourceAsStream(DATA_PATH);
            try {
                Properties properties = new Properties();
                properties.load(dataStream);
                rootNode = new TreeNodeImpl();
                addNodes(null, rootNode, properties);
            } catch (IOException e) {
                throw new FacesException(e.getMessage(), e);
            } finally {
                if (dataStream != null) {
                    try {
                        dataStream.close();
                    } catch (IOException e) {
                        externalContext.log(e.getMessage(), e);
        public TreeNode getTreeNode() {
            if (rootNode == null) {
                loadTree();
            return rootNode;
        public void processSelection(NodeSelectedEvent event) {
            UITree tree = (UITree) event.getComponent();
            nodeTitle = (String) tree.getRowData();
        public void processCurrElement(ActionEvent event) {
            UITree tree = (UITree)event.getSource();
            nodeTitle = (String)tree.getRowData();
            System.out.println(nodeTitle);
        public String getNodeTitle() {
            return nodeTitle;
        public void setNodeTitle(String nodeTitle) {
            this.nodeTitle = nodeTitle;
    }

    Hi,
    Do you have a solution for this? Looking for exactly the same.
    As far as I have it at the moment I have the backing object added to the attributes of the node:
    <a4j:support event="oncontextmenu"
                                         oncomplete="#{rich:component('foldersContextMenu')}.doShow(event, {})"
                                         actionListener="#{customerBean.buildContextMenu}" reRender="foldersContextMenu, selectedNode">
                                <f:setPropertyActionListener value="#{item}" target="#{customerBean.nodeTitle}"/>
                                <f:attribute name="node" value="#{item}"/>
                            </a4j:support>This allows me to get the object in the backing bean:
    public void buildContextMenu(ActionEvent event) {
            UIComponent component = event.getComponent();
            log.info("component: " + component.getId());
            Category node = (Category) component.getAttributes().get("node");
            log.debug("node : " + node);But how I translate that to setting this as the current node is causing me problems.
    Thanks
    Jon

  • Problems with right click in hierarchical tree

    Hi,
    I create a popup menu in a hierarchical tree and want to call this referencing to a node in the tree.
    I can get the node in GET_TREE_NODE_SELECTION but the node need to be selected for this...
    How can I select a node with a right click?? and then call the popup menu??
    Am I clear??
    Why the trigger MOUSE_CLICK doesn't works for right clicks??? I know about the SYSTEM.MOUSE_BUTTON_PRESSED but to use this I need a RIGHT_CLICK_TRIGGER... that I don't know how to call...
    thanks!

    Hi,
    This is a bug(96289), the same as the Base bug 1477977 which has NOT been fixed in Release 9.0.2 (as Oracle anounced) or in any earlier releases.
    Bug 1477977 was currently scheduled for the 1st patchset of Forms 9.0.4
    I don't know if it was fixed. Contact Oracle about that.
    Right now, to achive what you want you must left click to select a node. This means that the use must do a left click and a right click to have an item selected.
    Monica

Maybe you are looking for