Creation of a Popup Menu for a Tree Node

Hi Ppl,
  I need to create a Pop-up Menu for a tree node in WebDynpro Application, please give me a "How to .." sort of material or a link which would have same sort of information...
Also, My requirement is to call the pop-up on the right click of mouse on the tree node, please let me know on which event handler I can call it ? Do I require a custom event handler for it ?
Thanks in advance
Anish

Hi Anish,
You simply add a Tree UI element, and then right-click the tree UI element and insert a TreeNode element.
To the TreeNode element you can add a menu, and then to this menu you can add menu items. When the user right click the tree node, the menu item is displayed. If the user clicks the menu item, the action for the menuitem is run.
Hope that helps.
Daniel

Similar Messages

  • Application wide popup menu for JTextComponent descendants

    Hi!
    I'm working on large project with reach Swing GUI and I got stuck with one small but wery annoing problem. I have to append simple popup menu to all text input fields (JTextComponent descendants) in whole application. I'm realy lazy to append mouse listener on each component, so I'm asking, is there any way to append "default" popup menu for all components. Please, don't answer about custom components instead of Swing plain JTextComponent descendants - it's worse to change classes for all fields then add mouse listener to them.
    As an example of what I want I could forward you to UIManager.put() method, which affects all properties of component behaviour thoughout application. I want to find same solution, maybe there any registry or smth. else in API.
    Than you in advice.

    You could always try extending something like MetalTextFieldUI so that it adds the listeners to the text field automatically. You'd then need to register that UI class with the UIManager at startup:
    public class MyTextFieldUI extends MetalTextFieldUI {
      protected void installListeners() {
        super.installListeners();
        // TODO - Install your listener here
      protected void uninstallListeners() {
        super.uninstallListeners();
        // TODO - Uninstall your listener here
    UIManager.put("TextFieldUI", MyTextFieldUI.class.getName());Personally, I think you're just being lazy... getting your components to extend a subclass of JTextField should be no trouble at all and will leave you with clearer code.
    Hope this helps.

  • Queue for Binary Tree Node

    I need to create a simple Queue class for Binary Tree Node. The class consist of only enqueue and dequeue, I cannot use the Collection Interface though. But I have no idea how to do it. Below is my Binary Tree Node Class.
    public class BTNode {
         private customer     item;
         private BTNode     left;
         private BTNode     right;
         public BTNode() {// constructor
              item = null;
              left = right = null;
         public BTNode(customer newItem) {// constructor
              item = newItem.clone();
              left = right = null;
         public void setItem(customer newItem) {// set methods
              item = newItem.clone();
         public void setLeft(BTNode newLeft) {
              left = newLeft;
         public void setRight(BTNode newRight) {
              right = newRight;
         public customer getItem() {     // get methods
              return item;
         public BTNode getLeft() {
              return left;
         public BTNode getRight() {
              return right;
    public class Queue1 extends BTNode {
        public Queue1() {
            super();
        public void enqueue(BTNode newItem) {
        public void dequeue() {
    }

    public class Queue1 extends BTNode {Why do you think that the queue should extend BTNode?
    You probably want to aggregate a List.
    Kaj

  • Problem with Pre-Popup-Menu in Hierarchical Tree

    Hi,
    In Forms 10g I have made an application with an Hierarchical Tree. All works well, except the use of the Pre-Popup-Menu trigger.
    In that trigger when I read the values of Node_Label and Node_Value I get the values of the previous selected node, not the values of the node on which I issue the right mouse click. So, it seems that by clicking the node I need is not selected.
    Does anyone have any clues to solve this problem?
    Thanks in advance.

    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                                                                                                                                                                                                                                                                                                                                                                                                       

  •      Need coordinate for particular tree node as currently expanded

    Hi All,
    i am working in flex for the past two months,currently i am
    working on the drag and drop on a tree , where i am able to drag
    one tree leaf node to another another tree leaf node and i am able
    to draw a line between the two leaf node indicating that this has
    been dragged from the previous tree of a particular node to the
    current node of the tree.
    The problem which i am facing is that when i collapse the
    expanded tree , the line which i have drawn is not able to
    synchronize with the tree expand or collapse (the line remains in
    the same position even when the particular leaf node move down coz
    of expansion of the above tree node.)
    any help will be appreciated.

    there is a private function in the tree.as class:
    private function getVisibleChildrenCount(item:Object):int
    that I can use by multiplying how many children there are by
    how tall each item "physically" displays on the screen as, but I
    want to get that publicly. I don't want to go about hacking the
    tree.as code, that's poor form in the highest. Does anybody else
    have any ideas...
    please?

  • 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 );

  • Missing Menu for "Decomposition Tree"

    I built a PPS Analytic Chart all works well but it is missing the "Decomposition Tree" Menu Item from the options menu.
    I'm not sure what i am missing.
    This is for SharePoint 2013/SQL Server 2012

    Hi,
    I agree with Prasath.
    For your issue, Microsoft Silverlight 3 is required for the option.
    Refer to the blog about "Decomposition Tree":
    http://blogs.msdn.com/b/performancepoint/archive/2009/11/19/decomposition-tree-contribution-analysis-presentation.aspx
    To download the Silverlight 3:
    http://www.microsoft.com/silverlight/
    Best Regards,
    Lisa Chen
    Forum Support
     Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Lisa Chen
    TechNet Community Support

  • JTree: How to set different cell editor for different tree Nodes.

    I have a JTree and I want to set different cell editors for different node depending on some condition. E.g. I want to set ComboBox as editor for leaf node but each leaf node will have its own set of data.
    Any help or pointer?
    Thanks in advance
    Sachin

    take there:
    http://www.mutualinstrument.com/Easy/FAQ/Tree/tree.html

  • Setting Background Color for a tree node

    I have the following code
    ====================================================================================
    public class IconNodeRendererClass extends DefaultTreeCellRenderer {
    //* getListCellRendererComponent
    /**Return a component renderer based on the passed in components*/
    public Component getTreeCellRendererComponent(JTree tree, Object value,
    boolean sel, boolean expanded, boolean leaf,
    int row, boolean hasFocus) {
    Component c = super.getTreeCellRendererComponent(tree, value,
    sel, expanded, leaf, row, hasFocus);
    ImageIcon icon = ((IconNodeClass)value).getIcon();
    if (((IconNodeClass)value).isRoot()) {
    c.setBackground(Color.blue);
    setIcon(null);
    return c;
    if (icon != null) {
    setIcon(icon);
    return this;
    }// end getTreeCellRendererComponent
    }// end IconNodeRendererClass
    ====================================================================================
    I would like to have a gray color to the root node before even I selected the root node.
    Can I do that by setting the background color?
    With the below code I am unable to set the background color to the root node even when I selected it. what else can i write to set the color to the root node?
    if (((IconNodeClass)value).isRoot()) {
    c.setBackground(Color.blue);
    setIcon(null);
    return c;

    I gave the following on your advice. But the background color is set to all the nodes. I want it to be set it to only the root node. How can I do that? Thanks.
    if (((IconNodeClass)value).isRoot()) {
    setOpaque(true);
    c.setBackground(Color.gray);
    updateUI();
    setIcon(null);
    }

  • Popup Menu(F1- Help values) is not diaplying for a char at selection screen

    Hi,
    After executed the query, we are trying to get help (F4) values for info object Employee Group (EMPLGROUP) in the selection screen but it is taking long time nearly 1 hr and getting timed out. And for other Chars we are getting the help popup menu.
    for your info...     
    There are only 6 values are there in Employee Group master data table.
    And the characteristic settings in Business Explorer tab are as the following,
    Display u2013 Text
    Text type u2013 Default
    BEx description u2013 Short description
    Selection u2013 No selection Restriction
    Query Def. Filter Value Selection u2013 Only values in Infoprovider
    Query Execution Filter Val. Selection u2013 Only Posted Values for Navigation
    Can any one please suggest us which settings we needs to change to get the popup menu (help values) for Employee Group at selection screen and what is the reason for not displaying the help popup menu?.
    and can any one explain us about the setting "Query Execution Filter Val. Selection u2013 Only Posted Values for Navigation"
    Thanks & Regards,
    Raju. E

    Hi,
    I am getting the data aslo for Employee Group in the query when I drill down that char.
    But I dont know why it is taking long time and getting time out to display the popup menu for help values at selection screen.
    I think this is due to the below setting only at char level,
    Query Execution Filter Val. Selection u2013 Only Posted Values for Navigation
    and there are 3 opstions for the above seeting as below,
    1. Only values in master data
    2. Only values in Infoprovider
    3. Only Posted Values for Navigation
    Can any one help me, which opstion will solve the issue and can any one explain me what is the difference between 2 & 3
    Thanks,
    Raju. E

  • Developing a Sorted Popup Menu

    Hello Folks;
    How would I go about developing / scripting a sorted popup menu for Numbers in iWork 09?
    Thank you,
    vic

    Hi Vic,
    Welcome to Apple Discussions and the Numbers '09 forum.
    The bad news is that popup menus in Numbers aren't sortable, except by heavy handed editing. You can add items—but only to the bottom of the list, you can delete items—from anywhere in the list, and you can rename items.
    You can use Fill down or Fill right to copy a popup menu into a range of cells, but if these are edited popups replacing older versions, the previously set values will be replaced by the value set for the original being pasted in.
    For some flexibility, you might want to use a technique involving a Slider, a LOOKUP table and the VLOOKUP function. Jerrold Green wrote about it and provided some examples in discussion of Working with Pop-up menus in this forum back in April. The link will take you to that discussion.
    Regards,
    Barry

  • Disable Right Mouse Button Popup Menu

    How can I disable right mouse button popup menu for a LabVIEW control to use
    my custom popup menu?
    Alessio Colzi

    Sorry for the stupid question but I forgot that option.
    Thank you Gorka
    Alessio
    "Gorka Larrea" ha scritto nel messaggio
    news:[email protected]..
    > Not sure if can be made under LV 6 but under LV 5.0 you can disable
    > runtime popup menu for all the vi under VI setup right clicking the
    > icon in the right part of the front panel.
    >
    > Another option is to put a transparent decoration over your control,
    > to avoid right clicking.
    >
    > Hope this helps

  • Please help- Fireworks CS3 popup menu displaying wrong positions on live page

    Greetings all,
    I am new to Fireworks and my knowledge of html and dreamweaver is pretty basic, So i am learning as I go here. My problem is this: I have created a popup menu for the site http://www.theatricalprojections.com I used Fireworks to edit a .png and position the menus and links that I want. I had everything set up the way I wanted it to look except that when I published the code, the menus are showing up in the wrong postions on the live site, while it works fine when I preview it locally. You'll notice that the menu popping up for the word "consoles" isn't next to the word where it should be.
    I exported the png to an htm file. I then copied this code and I had to paste it into a box in the Able Commerce system we have for managing the site. I suspect the fact that I am insterting the code into a box within this software makes things different though I really have no idea.
    Please help me!
    Ill be glad to post any other info to make this isse more clear
    Jonny

    the design will stay, but thank you. When I left work I uploaded the old version that had menus aligned correctly. right now the new one is up and the some of the menus are way of out place I've been trying to fix this and I have no Idea what to do!

  • Empty popup menu

    Hi,
    we implemented an excel-download function according blog "Creating a BSP Extension for Downloading a Table" (/people/thomas.jung3/blog/2004/09/02/creating-a-bsp-extension-for-downloading-a-table). This creates a menu-entry using the standard popup menu function.
    It worked fine but after several patches (SAP BASIS SPs ) we figured out, the the BSP now is showing an empty span without the menu-items in it (although the menu entries are in the HTML-Code).
    We think, that this is a problem with the called Java-Script method onclick="sapUrMapi_PopupTrigger_openMenu('EXCEL_INTERFACE__popupTrigger','EXCEL_INTERFACE__popupMenu',event);
    Do you have any experience at this or face the same problem?
    Thanks for help.
    Best regards
    Katrin

    I have some kind of workaround for my problem. I changed my Handler to search for all MParts matching my Part-ID. I check all Parts for there setup and possible update it. But when I decide I need a new Part, I clone the Part using the cloneElement-Method of the EModelService and activate it with the EPartService.
    With this method the popup menu also shows on the newly created Part.
    There is still a Problem, removing the second Plugin which contains the HandledItems for the Parts results in an error for the active part and a disabled popup menu for the other parts. I also don't known what will happen if I later add a new Plugin with new HandledItems.
    So still it would be nice if anyone can lead me to the right direction.

  • Tree and Tree Node Components - Threadinar7

    Hi All,
    This is the seventh in the "Threadinar" series , please see Threadinar6 at
    http://forum.sun.com/jive/thread.jspa?threadID=100601 for details
    In this Threadinar we will focus on the
    "Tree" and "Tree Node" Components
    Let us begin our discussion with the Tree Component.
    Tree Component
    You can drag the Tree component from the Palette's Basic category to the Visual Designer to create a hierarchical tree structure with nodes that can be expanded and collapsed, like the nodes in the Outline window. When the user clicks a node, the row will be highlighted. A tree is often used as a navigation mechanism.
    A tree contains Tree Node components, which act like hyperlinks. You can use a Tree Node to navigate to another page by setting its url property. You can also use a Tree Node to submit the current page. If the the Tree Node's action property is bound to an action event handler, selecting the node automatically submits the page. If the Tree Node's actionListener property is bound to an action listener, opening or closing the node automatically submits the page. You set Tree Node properties in the Tree Node Component Properties window.
    * If you use this component to navigate between pages of a portlet, do not use the url property to link to a page. Instead, use the Navigation editor to set up your links to pages.
    * Events related to tree node selection do not work correctly in portlets because the component uses cookies to pass the selected node id back and forth, and cookies are not correctly handled by the portlet container. You cannot handle tree node selection events in portlet projects.
    Initially when you drop a tree on a page, it has one root node labeled Tree and one subnode labeled Tree Node 1. You can add more nodes by dragging them to the tree and dropping them either on the root node to create top level nodes or on existing nodes to create subnodes of those nodes. You can also right-click the Tree or any Tree Node and choose Add Tree Node to add a subnode to the node.
    Additionally, you can work with the component in the Outline window, where the component and its child components are available as nodes. You can move a node from level to level easily in the Outline window, so you might want to work there if you are rearranging nodes. You can also add and delete tree nodes in the Outline window, just as in the Visual Designer.
    The Tree component has properties that, among other things, enable you change the root node's displayed text, change the appearance of the text, specify if expanding or collapsing a node requires a trip to the server, and specify whether node selection should automatically open or close the tree. To set the Tree's properties, select the Tree component in your page and use the Tree Component Properties window.
    The following Tutorial ("Using Tree Component") is very useful to learn using Tree components
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/sitemaptree.html
    See Also the Technical Article - "Working with the Tree Component and Tree Node Actions"
    http://developers.sun.com/prodtech/javatools/jscreator/reference/techart/2/tree_component.html
    Tree Node Component
    You can drag the Tree Node component from the Palette's Basic category to a Tree component or another tree node in the Visual Designer to create a node in a hierarchical tree structure, similar to the tree you see in the Outline window.
    The tree node is created as a subnode of the node on which you drop it. If you drop the node on the tree component itself, a new node is created as a child of the root node. You can see the hierarchical structure clearly in the Outline window, where you can also easily move nodes around and reparent them.
    You can also add a tree node either to a Tree component or to a Tree Node component by right-clicking the component and choosing Add Tree Node.
    A Tree Node component by default is a container for an image and can be used to navigate to another page, submit the current page, or simply open or close the node if the node has child nodes.
    * If you select the Tree Node component's node Tree Node icon in the Outline window, you can edit its properties in the Tree Node Properties window. You can set things like whether or not the Tree Node is expanded by default, the tooltip for the Tree Node, the label for the tree node, and the Tree Node's identifier in your web application.
    * You can use a Tree Node to navigate to another page by setting its url property. You can also use a Tree Node to submit the current page. If the the Tree Node's action property is bound to an action event handler, selecting the node automatically submits the page. If the Tree Node's actionListener property is bound to an action listener, opening or closing the node automatically submits the page.
    - Note: If you use this component to navigate between pages of a portlet, do not use the url property to link to a page. Instead, use the Navigation editor to set up your links to pages. In addition, events related to tree node selection do not work correctly in portlets because the component uses cookies to pass the selected node id back and forth, and cookies are not correctly handled by the portlet container. You cannot handle tree node selection events in portlet projects.
    * If you select the image in the Tree Node, you can see that its icon property is set to TREE_DOCUMENT. If you right-click the image on the page and choose Set Image, you can either change the icon to another one or choose your own image in the Image Customizer dialog box. For more information on working with an image in a tree node, see Image component.
    - Note: The image used in a tree node works best if it is 16x16 or smaller. Larger images can work, but might appear overlapped in the Visual Designer. You can right-click the component and choose Preview in Browser feature to check the appearance of the images.
    Please share your comments, experiences, additional information, questions, feedback, etc. on these components.
    ------------------------------------------------------------------------------- --------------------

    One challenge I had experience was to make the tree
    always expanded on all pages (I placed my tree menu
    in a page fragment so I can just import it in my
    pages).Did you solve this problem. It would be interesting to know what you did.
    To expand a node you call setExpanded on the node. Here is some code from a tutorial that a coworker of mine is working on.
    In the prerender method:
           Integer expandedPersonId = getRequestBean1().getPersonId();
             // If expandedPersonId is null, then we are not coming back
            // from the Trip page. In that case we do not want any trip
            // nodes to be pre-selected (highlighted) due to browser cookies.
            if (expandedPersonId==null) {
                try {
                    HttpServletRequest req =(HttpServletRequest)
                    getExternalContext().getRequest();
                    Cookie[] cookies = req.getCookies();
                    //Check if cookies are set
                    if (cookies != null) {
                        for (int loop =0; loop < cookies.length; loop++) {
                            if (cookies[loop].getName().equals
                                    ("form1:displayTree-hi")) {
                                cookies[loop].setMaxAge(0);
                                HttpServletResponse response =(HttpServletResponse)
                                getExternalContext().getResponse();
                                response.addCookie(cookies[loop]);
                } catch (Exception e) {
                    error("Failure trying to clear highlighting of selected node:" +
                            e.getMessage());
            }                  ... (in a loop for tree nodes)...
                      personNode.setExpanded(newPersonId.equals
                                    (expandedPersonId));In the action method for the nodes:
           // Get the client id of the currently selected tree node
            String clientId = displayTree.getCookieSelectedTreeNode();
            // Extract component id from the client id
            String nodeId = clientId.substring(clientId.lastIndexOf(":")+1);
            // Find the tree node component with the given id
            TreeNode selectedNode =
                    (TreeNode) this.getForm1().findComponentById(nodeId);
            try {
                // Node's id property is composed of "trip" plus the trip id
                // Extract the trip id and save it for the next page
                Integer tripId = Integer.valueOf(selectedNode.getId().substring(4));
                getRequestBean1().setTripId(tripId);
            } catch (Exception e) {
                error("Can't convert node id to Integer: " +
                        selectedNode.getId().substring(4));
                return null;
    It would also be great if I can set the tree
    readonly where the user cannot toggle the expand
    property of the tree (hope this can be added to the
    tree functionality).

Maybe you are looking for

  • Opening & closing balance for Multiple Vendors

    Hi Friends, I have an issue. This is my code. *& Report  ZVEN_OPEN_CLOSE_BAL REPORT  ZVEN_OPEN_CLOSE_BAL. *& Report  ZVEN_OPEN_CLOSE_BAL TABLES:lfa1,bsik. TYPES: BEGIN OF ty_bsik,        bukrs TYPE bsik-bukrs,        lifnr TYPE bsik-lifnr,        aug

  • Where did my adobe printer go ??

    I have a Vista machine presenty but have used this program with other computers.  The error I am receiving is called StartDocPrinter. I have read about this on several forums but no one has listed a cure.. I cannot remove this printer.. Can anyone he

  • How to disable direct forms access in Oracle E-Business Suite R12.1.3

    @Hussein Sawwan Hi Hussein, I don't know if I have well formulated the title of this discussion. But I will try to explain. I have a problem on my TEST Oracle E-Business Suite R12.1.3 instance. After login into the homepage, some forms automatically

  • Best way to delete a .plist item?

    Hi everyone! I have found similar topics on this...but maybe someone can clear it up for me? I want to delete an item within a .plist, specifically to remove an item from the Dock by scripting. (See com.apple.dock.plist) If I use System Events I can

  • How to read some files inside the jar

    Hi, I have an applet that runs with JWS. The user can input some information and then I need to show this information in a web page. As the application can be run offline, I cannnot use JSP�s to generate the web page. The information is saved in a xm