Perform a query on tree node click

This is probably very easy and I'm just having brain freeze..
I have an application that is using ColdFusion to provide
data for various controls. One control is a tree showing two levels
of data (main level shows the process/job number, then you open
that to see all the event numbers for that job). This all works
fine.
Now what I want to do is when you select an even number, flex
will use a coldfusion page I set up to perform a query on the
database using the event number and job number to get all the rest
of the data about htat particular job (description, run times, etc)
I have the click event from the tree control working fine, I
have the page in coldfusion working fine, it outputs an XML format
file with all the relevant details based on the parameters you send
it. Now the question is, how do I populate the fields on the form
with the data returned from the query?
I am using a HTTPService call to get the data to/from
ColdFusion (I have version 6.1 of Coldfusion).
Thanks for any help.

Well, I answered my own question... Here is what I did in
case anyone else wants to know. If there is a better way, please
advise.
I have a click event on the tree control. Since the tree will
only be two levels deep (parent and child) I test for whether the
item clicked has a parent. If it does, I know they clicked on a
child node. I then fire off the HTTPService with the parameters
from the child and parent nodes of the tree item that was clicked.
In the result parameter of the HTTPService, I populate the
various fields using the lastresult.root.fieldname syntax of the
HTTPService.
It works as expected, but perhaps there is a better
way?

Similar Messages

  • ALV-Tree Node click not working

    Hi All,
    I am displaying the data in ALV tree. When the user click on the node i want to capture some event and method in which i have to do some coding. Can you tell me which method and  event i should use to achieve this functionality. its bit urgent.
    Immediate response will be apprecited.
    Regards,
    Ranjan

    Hi ,
    I have gone through the link. I have done the below part in my coding even though when i double click on the node, the event node_double_click is not getting triggered. Kindly suggest me what i have missed.
    1) Register event with tree instance:
    Register event for NODE_DOUBLE_CLICK
    l_event-eventid = cl_gui_column_tree=>eventid_node_double_click.
    APPEND l_event TO lt_events.
    (2) Set handler for event:
    SET HANDLER l_event_receiver->handle_node_double_click FOR tree1
    (3) Define and implement event handler method:
    METHODS handle_node_double_click
    FOR EVENT node_double_click OF cl_gui_alv_tree
    IMPORTING node_key.
    ENDCLASS. "lcl_tree_event_receiver DEFINITION
    CLASS lcl_tree_event_receiver IMPLEMENTATION
    CLASS lcl_tree_event_receiver IMPLEMENTATION.
    METHOD handle_node_double_click.
    break-point.
    ENDMETHOD. "handle_node_double_click
    Regards,
    Ranjan

  • How to programmatically click a tree node(make it selected)?

    in my program, i want to make a tree node "clicked" by codes, so that the valueChanged(TreeSelectionEvent tse e) method of the TreeSelectionListener can be invoked.
    thanks a lot!!

        private Robot robot;
        private void triggerMouseClick(TreePath treePath) {
            if (robot == null) {
                try {
                    robot = new Robot();
                    robot.setAutoDelay(60);
                catch (AWTException e) {
                    e.printStackTrace();
            Rectangle rect = this.getPathBounds(treePath);
            Point point = new Point(rect.x+1, rect.y+1);
            SwingUtilities.convertPointToScreen(point, this);
            robot.mouseMove(point.x, point.y);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
        }

  • Disabling the tree nodes.

    hi,
    Can anyone tell me , Is it possible to disable the tree nodes?How??so that user cannot perform any action
    on tree nodes i.e, expanding the tree node or double clicking the tree node.
    Thankx in advance,
    Manish.

    hi,
    Can anyone tell me , Is it possible to disable the tree nodes?How??so that user cannot perform any action
    on tree nodes i.e, expanding the tree node or double clicking the tree node.
    Thankx in advance,
    Manish.

  • How to display a search(query) on a report clicking on a tree node to open

    I need to know how can I do with that when I press on the link(on a tree node(leaf)), open on the other region in the same page a classic or interactive report with my results(passed by parameter, example: ID).
    One example are present on web site posted below:
    http://apex.oracle.com/pls/apex/f?p=36648:34:1599336964673301::NO:::
    I have tried this to composite my tree:
    select case when connect_by_isleaf = 1 then 0 when level = 1 then 1 else -1 end as status, level, "NAME" as title, null as icon, "ID" as value, null as tooltip, decode(level, 1, 'f?p=&APP_ID.:106:'||:APP_SESSION||'::::P106_MAQ_ID:'||ID, 2,'f?p=&APP_ID.:106:'||:APP_SESSION||'::::::::P106_MAQ_ID:'||(ID-1000), 3,'f?p=&APP_ID.:104:'||:APP_SESSION||'::::P106_MAQ_ID:'||(ID-10000), 4,'f?p=&APP_ID.:105:'||:APP_SESSION||'::::P106_MAQ_ID:'||(ID-100000)) as link from "#OWNER#"."V_TREE1" start with "PID" is null connect by prior "ID" = "PID" order siblings by "NAME"
    But the parameter passed dont do with the report change your view to the one row with ID passed. I need to obtain the same results showed on website posted above.
    I obtained success on action to redirect to other page with Form with Report to edit, but dont to show. And i want to show and the same page.
    below the code that i obtained to redirect:
    select case when connect_by_isleaf = 1 then 0 when level = 1 then 1 else -1 end as status, level, "NAME" as title, null as icon, "ID" as value, null as tooltip, decode(level, 1, 'f?p=&APP_ID.:102:'||:APP_SESSION||'::::P102_MAQ_ID:'||ID, 2,'f?p=&APP_ID.:103:'||:APP_SESSION||'::::P103_SRV_ID:'||(ID-1000), 3,'f?p=&APP_ID.:104:'||:APP_SESSION||'::::P104_INS_ID:'||(ID-10000), 4,'f?p=&APP_ID.:105:'||:APP_SESSION||'::::P105_SIS_ID:'||(ID-100000)) as link from "#OWNER#"."V_TREE1" start with "PID" is null connect by prior "ID" = "PID" order siblings by "NAME"
    Thank you so much for your help.

    Muhammad,
    you can add a user parameter (p_count), which get the default value value 1 for example. Then add a field (with some source of type character like desname) for your footer with a format trigger like
    if :p_count=1 then
         srw.set_field_char(0,'Office Copy');
    elsif :p_count=2 then
         srw.set_field_char(0,'Shop Copy');
    else
         srw.set_field_char(0,'Account Dept Copy');
    end;
    return true;
    Or you build 3 boilerplates with format triggers like
    if :p_count=1 then return true; else return false; end if; for "Office Copy" .....
    In the After Report Trigger start the Report with same paramters using a higher value for p_count as parameter. If p_count=3, do nothing in the trigger.
    Regards
    Rainer

  • WHEN-TREE-NODE-SELECTED need 2 Execute-Query on Master-Detail data block

    I optimize tree using this link
    http://andreas.weiden.orcl.over-blog.de/article-29307730.html_+
    For huge amount of data (Accountings)
    All i need for now is
    WHEN-TREE-NODE-SELECTED need 2 Execute-Query on the data block
    DECLARE
    htree ITEM;
    node_value VARCHAR2(100);
    BEGIN
    IF :SYSTEM.TRIGGER_NODE_SELECTED = 'TRUE' THEN
    -- Find the tree itself.
    htree := FIND_ITEM ('BL_TREE.IT_TREE');
    node_value := FTREE.GET_TREE_NODE_PROPERTY( htree, :SYSTEM.TRIGGER_NODE ,  ftree.node_value  );
       GO_BLOCK ('GL_ACCOUNTS');
       set_block_property('GL_ACCOUNTS', DEFAULT_WHERE , 'ACCOUNT_ID ='|| node_value  );
    EXECUTE_QUERY;
    END IF;
    END;The above code is working fine 4 the detail block which is *'GL_ACCOUNTS'*
    when i substitute is Master block which is 'GL_ACCOUNTS_TYPES' it doesn't display all data
    Help is Appriciated pls.
    Regards,
    Abdetu...

    Hello
    In WHEN-TREE-NODE-SELECTED i modified the following code :_
    DECLARE
            htree ITEM;
           node_value VARCHAR2(100);
           parent_node FTREE.NODE;
    BEGIN
      IF :SYSTEM.TRIGGER_NODE_SELECTED = 'TRUE' THEN
      -- Find the tree itself.
      htree := FIND_ITEM ('BL_TREE.IT_TREE');
      -- Get the parent of the node clicked on. 
                  parent_node := FTREE.GET_TREE_NODE_PARENT ( htree, :SYSTEM.TRIGGER_NODE );
           GO_BLOCK('GL_TYPES');
                set_block_property('GL_TYPES', DEFAULT_WHERE , 'TYPE_ID ='|| parent_node  );
                  EXECUTE_QUERY;
      -- Get the detail of the parent node
          node_value := FTREE.GET_TREE_NODE_PROPERTY( htree, :SYSTEM.TRIGGER_NODE ,  ftree.node_value  );
               GO_BLOCK('GL_ACCOUNTS');
               set_block_property('GL_ACCOUNTS', DEFAULT_WHERE , 'ACCOUNT_ID ='|| node_value  );     
                   EXECUTE_QUERY;
          END IF;
    END;
    FRM-40350 : Query caused no records to be retrieved but i have records in the data base ...!
    Well, Do u think that's because in ur package i retrieve only the detail block ?
    Regards,
    Abdetu...

  • How to trigger an ActionListener in different class on click of a tree node

    Hi guyz,
    There are three panels inside my main Frame
    -->TopPanel,MiddlePanel and BottomPanel. I have a tree structure inside a panel. This panel along with couple more panels is in MiddlePanel. My main class is "mainClass.java". Inside that i have an actionListener for a specific button. I need to trigger that actionListener when i click one of the tree nodes in the panel i specified before. The problem is that my MiddlePanel is itself a different ".java" file which is being called in my "mainClass" when a specific button is clicked. There are different buttons in my "mainClass" file and for each one i am creating different MiddlePanels depending on the buttons clicked.
    So, if i click the tree node, i need to remove the MiddlePanel and recreate the MiddlePanel(One that will be created when a different button in the mainClass file is clicked). i.e., i need to trigger the actionListener for that corresponding button. Is there a way to do it?

    use this code to call different panel by selecting tree node.....ok
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.*;
    import java.sql.SQLException;
    import javax.swing.event.*;
    class MainTree extends JFrame
    private static final long serialVersionUID = 1L;
         CardLayout cl = new CardLayout();
         JPanel panel = new JPanel(cl);
    public MainTree() throws Exception
    JPanel blankPanel = new JPanel();
    blankPanel.setBorder(BorderFactory.createTitledBorder("Blank Panel"));
    panel.add(blankPanel,"0");
    panel.add(blankPanel,BorderLayout.CENTER);
         panel.setPreferredSize(new Dimension(800, 100));
         setSize(1000, 700);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    // getContentPane().setLayout(new GridLayout(1,2));
    getContentPane().setLayout(new BorderLayout());
    ConfigTree test = new ConfigTree();
    DefaultMutableTreeNode mainTree = (DefaultMutableTreeNode)test.buildTree();
    JTree tree = new JTree(mainTree);
    tree.setCellRenderer(new DefaultTreeCellRenderer(){
    private static final long serialVersionUID = 1L;
         public Component getTreeCellRendererComponent(JTree tree,Object value,
    boolean sel,boolean expanded,boolean leaf,int row,boolean hasFocus){
    JLabel lbl = (JLabel)super.getTreeCellRendererComponent(tree,value,sel,expanded,leaf,row,hasFocus);
    NodeWithID node = (NodeWithID)((DefaultMutableTreeNode)value).getUserObject();
    if(node.icon != null)lbl.setIcon(node.icon);
    return lbl;
    getContentPane().add(new JScrollPane(tree));
    loadCardPanels((DefaultMutableTreeNode)((DefaultTreeModel)tree.getModel()).getRoot());
    getContentPane().add(panel,BorderLayout.EAST);
         getContentPane().add(blankPanel,BorderLayout.WEST);
    // getContentPane().add(panel);
    tree.addTreeSelectionListener(new TreeSelectionListener(){
    public void valueChanged(TreeSelectionEvent tse){
    NodeWithID node =(NodeWithID)((DefaultMutableTreeNode)((TreePath)tse.getPath())
    .getLastPathComponent()).getUserObject();
    if(node.nodePanel != null)
    String cardLayoutID = node.ID;
    cl.show(panel,cardLayoutID);
    cl.show(panel,"0");
    public void loadCardPanels(DefaultMutableTreeNode dmtn)
    for(int x = 0; x < dmtn.getChildCount(); x++)
    if(((DefaultMutableTreeNode)dmtn.getChildAt(x)).isLeaf() == false)
    loadCardPanels((DefaultMutableTreeNode)dmtn.getChildAt(x));
    NodeWithID node = (NodeWithID)((DefaultMutableTreeNode)dmtn.getChildAt(x)).getUserObject();
    if(node.nodePanel != null)
    String cardLayoutID = node.ID;
    panel.add(cardLayoutID,node.nodePanel);
    public static void main(String[] args) throws Exception{new MainTree().setVisible(true);}
    class ConfigTree
    public Object buildTree() throws Exception
    NodeWithID n0 = new NodeWithID("HelpDesk","");
    NodeWithID n1 = new NodeWithID("Administrator",n0.nodeName);
    NodeWithID n2 = new NodeWithID("Report Form",n1.nodeName,new Tree().getContentPane());
    NodeWithID n3 = new NodeWithID("Create User",n2.nodeName,new JPanel());
    NodeWithID n4 = new NodeWithID("Unlock User",n2.nodeName,new unlockui().getContentPane());
    NodeWithID n5 = new NodeWithID("List User",n2.nodeName,new JPanel());
    NodeWithID n6 = new NodeWithID("Assign Role",n2.nodeName,new AssignRole());
    NodeWithID n9 = new NodeWithID("Operator",n1.nodeName,new JPanel());
    NodeWithID n10 = new NodeWithID("Create Ticket",n9.nodeName,new JPanel());
    NodeWithID n11 = new NodeWithID("My Ticket",n9.nodeName,new JPanel());
    NodeWithID n12 = new NodeWithID("All Ticket",n9.nodeName,new JPanel());
    NodeWithID n13 = new NodeWithID("Event Viewer",n1.nodeName,new JPanel());
    DefaultMutableTreeNode top = new DefaultMutableTreeNode(n0);
    DefaultMutableTreeNode branch1 = new DefaultMutableTreeNode(n1);
    top.add(branch1);
    DefaultMutableTreeNode node1_b1 = new DefaultMutableTreeNode(n2);
    DefaultMutableTreeNode n1_node1_b1 = new DefaultMutableTreeNode(n3);
    DefaultMutableTreeNode n2_node1_b1 = new DefaultMutableTreeNode(n4);
    DefaultMutableTreeNode n3_node1_b1 = new DefaultMutableTreeNode(n5);
    DefaultMutableTreeNode n4_node1_b1 = new DefaultMutableTreeNode(n6);
    branch1.add(node1_b1);
    branch1.add(n1_node1_b1);
    branch1.add(n2_node1_b1);
    branch1.add(n3_node1_b1);
    branch1.add(n4_node1_b1);
    DefaultMutableTreeNode node4_b1 = new DefaultMutableTreeNode(n9);
    DefaultMutableTreeNode n1_node4_b1 = new DefaultMutableTreeNode(n10);
    DefaultMutableTreeNode n2_node4_b1 = new DefaultMutableTreeNode(n11);
    DefaultMutableTreeNode n3_node4_b1 = new DefaultMutableTreeNode(n12);
    node4_b1.add(n1_node4_b1);
    node4_b1.add(n2_node4_b1);
    node4_b1.add(n3_node4_b1);
    DefaultMutableTreeNode node5_b1 = new DefaultMutableTreeNode(n13);
    branch1.add(node1_b1);
    branch1.add(node4_b1);
    branch1.add(node5_b1);
    return top;
    class NodeWithID
    String nodeName;
    String ID;
    JPanel nodePanel;
    ImageIcon icon;
    public NodeWithID(String nn,String parentName)
    nodeName = nn;
    ID = parentName+" - "+nodeName;
    public NodeWithID(String nn,String parentName,Container container)
    this(nn,parentName);
    nodePanel = (JPanel) container;
    nodePanel.setBorder(BorderFactory.createTitledBorder(ID + " Panel"));
    public NodeWithID(String nn,String parentName,JPanel p, ImageIcon i)
    this(nn,parentName,p);
    icon = i;
    public String toString(){return nodeName;}
    }

  • Help w/ clicking on leaves of tree node

    Hello,
    I am fairly new to Flex and coding in general, so please bare
    with me if my problems seems like a trivial one.
    I am trying to create a tree list, where the contents of the
    tree are actually links. For example, the top level of the tree
    node would be a category (companies), and the leaves of the tree
    would be the company names. In addition, I would like the user to
    be taken, in a new browser window, to a URL specified in the XML
    list when clicking on a company name.
    I am having problems resolving the click actions in the app.
    I can get the app to open and close the nodes of the tree cleanly,
    but when I try to add some code to take the user to a URL when
    clicking on a company name (leaf), I get errors.
    I am really stuck on how to read the click event in the tree
    list, run to the associated XML file to find the URL, then open up
    a new browser page to that URL.
    Can someone help me please? I've added a snippet of code to
    review.
    Thank you in advance!

    "hokudan" <[email protected]> wrote in
    message
    news:ghk08n$pdb$[email protected]..
    > Hi Amy,
    >
    > Thank you for your reply. Here are the errors that I'm
    getting in Flash:
    >
    > ReferenceError: Error #1069: Property source not found
    on mx.controls.Tree
    > and
    > there is no default value.
    > Two of the nodes in the tree also have a 'source' value
    that I've entered-
    > do
    > I need to make it a separate line instead of including
    it with the 'label'
    > field?
    Two things:
    1) I'm thinking the currentTarget of the itemClick event will
    be the tree
    itself, not the node. So you need to look at the selectedItem
    property to
    get the node. See the example under Handling Tree control
    events:
    http://livedocs.adobe.com/flex/3/html/help.html?content=dpcontrols_8.html
    2) To answer your question, you just need to reference it
    properly for
    however you set up the xml:
    http://dispatchevent.org/roger/as3-e4x-rundown/

  • JTree - Sometimes tree node is not selected, while clicking it using mouse

    Hi,
    I'm sure that it is a very rare scenario.But ,sometimes i couldnt select a tree node on mouse click.It happens very rarely and simulating the behaviour is not possible.If anyone have gone thru this,plz repond.
    Thanks,
    Kathir

    did you try debug with a breakPoint on mouseListener->mouseClick event, and see if the selectionModel changes?

  • Htmlb:tree differentiate between nodeclick and tree node expander click

    Hi,
    how can i differentiate between nodeclick and tree node expander (to get to its children) click in my event processing in htmlb:tree element.
    <u><b>What i am trying to achieve?</b></u>
    Onload just load root node and its immediate children.
    On node expand get the children of the current node and modify htmlb:tree table2 with additional node inofs.
    on node click  call some client function.
    But my issue is that i am not able to differentiate between node expander click and node click in my event handling. Any help on this is appreciated.
    (I am not using MVC)
    Thanks in advance.
    Regards
    Raja
    Message was edited by: Durairaj Athavan Raja

    After reading your weblog I think I understand better. I did some testing with my example.  I am using the toggle = "true", so that the page returns to the server each time an expander is selected.
    <htmlb:tree id          = "myTree1"
                  height      = "75%"
                  toggle      = "true"
                  title       = "<b><otr>EQI Reporting Tree</otr></b>"
                  width       = "90%"
                  onTreeClick = "myTreeClick"
                  table       = "<%= application->selection_model->itview                             %>" >
      </htmlb:tree>
    However I have not added any coding in my event handler to respond to the expander event.  I only respond to myTreeClick (which loads some data for the given selection).  The BSP tree element itself must be doing the hard work for me. 
      if event_id cs 'tr_myTree1'.
        data: tree_event type ref to cl_htmlb_event_tree.
        tree_event ?= htmlb_event.
        if tree_event->server_event = 'myTreeClick'.
          clear appl->message1.
          appl->selection_model->get_chart_data( appl = appl
                                                 node = tree_event->node ).
        endif.
      endif.
    I pass my entire tree defintion to the element.  It appears that it only sends visible nodes to be rendered. When the expander is selected, I don't have to do anything, the tree re-renders with only the newly visible rows. 
    I tested and turned off the toggle (toggle = "false") and my page took forever to load because it was sending all the nodes to the frontend on the first load.

  • Confirmation Dialog when clicking on Tree Node.

    I am working on Oracle Apex 4.2.0.00.27 and I have the following problem:
    The code below shows the definition of a tree. The tree displays records from the table ACTIVITIES in hierarchical structure.
    When user clicks on a leaf/node of the tree he will be redirected to another page where the details of each Activity/leaf/node are displayed.
    The tree is part of a page where I have established a functionality to check for changes on the input fields of the page and inform the user when he tries to redirect without first saving the changes he made.
    What I want to do is:
    WHEN user clicks on a node of the tree AND he hasn't saved any changes he made
    THEN
    trigger a confirmation dialog.
    IF
    he clicks OK he is redirected to the node details page as defined on the tree definition:
    f?p=&APP_ID.:10:'||:APP_SESSION||'::::P10_ID:'||"ID"
    ELSE if he clicks CANCEL
    he stays on the same page.
    The condition to trigger the confirmation box is:
    if (document.getElementById('P0_CHANGES_DETECTED').value == 1)
    where P0_CHANGES_DETECTED is a universal hidden text field that is set to +'1'+ every time a change is made.
    and here is the tree definition:
    select case when connect_by_isleaf = 1 then 0
    when level = 1             then 1
    else                           -1
    end as status,
    level,
    +"NAME" as title,+
    null as icon,
    +"ID" as value,+
    null as tooltip,
    decode(PARENT_ID,null,null, 'f?p=&APP_ID.:10:'||:APP_SESSION||'::::P10_ID:'||"ID") as link
    from "#OWNER#"."ACTIVITIES"
    where GROUP_ID = :P20_GROUP_ID
    start with "ID" in (select ID from "#OWNER#"."ACTIVITIES" where GROUP_ID = :P20_GROUP_ID and PARENT_ID is null)
    connect by prior "ID" = "PARENT_ID"
    order siblings by "ID"
    I hope it is clear what I want to achieve. Thanks in advance.

    So you'll want to bind an event to all tree nodes that checks for the value and then fires the confirmation if there value is 1.
    Try something like this:
    - first, give your static ID attribute in your tree the value of tree_static_id (or whatever you want. just replace the id selector below with what you choose).
    - In your Page Function and Variable Declaration Javascript:
    function confirmSave() {
    var changeDetected = jQuery('#P0_CHANGES_DETECTED').val();
    if(changeDetected == 1) {
    //only do this if change is detected
    if(confirm('You have unsaved changes. Do you want to leave this page?')) {
    window.location('[your url here]');
    jQuery(document).ready(function() {
    //bind function to the click event
    $('#tree_static_id').find('li a').bind('click', function() { confirmSave(); } });
    });Hope this helps

  • ADF Tree Component Iterating through all nodes upon ONE node click...

    Hi to all !. My name is Agustin and I live far away... In Cordoba Argentina to be specific !. My doubt would be the following one: I wanted the other day to build a af:tree component and put in the NodeStamp an commandLink with a setActionListener... So as to get the selected Node... In this case, I have category of books... Let say DataBase, Cloud Computing, Web Development and so on... But the misterious thing happens when I click on one node, and the action method in my backing bean is executed one time per each node the Tree has... I notices this coz I made a System.out.println()... My idea would be to detect the user click event so as to update a Table... My code is as follows !...
    <af:tree value="#{backManager.listaCategoria}" var="cat"
    binding="#{backManager.tree1}" id="tree1">
    <f:facet name="nodeStamp">
    <h:commandLink binding="#{backManager.outputText1}" action="#{backManager.outputText1_action}" >
    <af:setActionListener from="#{cat}" to="#{backManager.selectedItem}" />
    <h:outputText value="#{cat.label}"
    binding="#{backManager.outputText2}"
    id="outputText2"/>
    </h:commandLink>
    </f:facet>
    </af:tree>
    and my backing bean is:
    public String ejecutarSeleccion()
    Categoria cat = (Categoria) this.selectedItem.getValue();
    System.out.println("Nombre: " + cat.getNombre());
    return null;
    This method is the action attribute from the command link !.
    the selectedItem is an attribute of the type SelectItem !.
    Where I would be making the mistake ?... Or should I implement the thing in a different way ?... Thankx ! :D

    Hi,
    its strange when you say it executes the action per each node in the tree. One thing tough I would change is to go from h:commandLink to af:commandLink as it allows you to set partialSubmit=true in which case a click on the tree doesn't refresh the whole tree. I then would add an f:attribute tag to the command link
    <f:attribute name="cat" value="#{cat.id}"/>
    On the command link I had the actionListener property pointing to a managed bean with a method like
    public void onTreeNodeAction(ActioneEvent actionEvent){
    RichCommandLink link = (RichCommandLink ) actionEvent.getUIComponent();
    Object catId = link.getAttributes().get("cat");
    // ... cast the catalog id to its type and you are ready to go
    Another option would be to use the SelectListener of the tree and don't use a command link at all. You respond to tree node selection similar to here
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/83-bidi-synchronization-tree-form-401841.pdf
    Frank

  • 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

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

  • Tree Node SQL Query

    Hi
    Plz Help me to write tree node Query ... Like
    Trad_ID Cust_ID Parent_Trad_ID
    1 1001
    2 1002 1
    3 1003 2
    4 1004 3
    In my where clause i only allow to pass parent_trad_id=3 and i need all trad_id including null.
    Thanx in Advance
    Mani

    Suggest you have a look at Oracle's CONNECT BY syntax.

Maybe you are looking for

  • Can I embed an external web page?

    In Rapidweaver you can make a frame on a page and within the frame show an external web page. I would like to do the same in iweb. I'm trying to embed my Blogger page so that people will be able to access it from with in my web site. I want them to b

  • I want to install Windows XP on my new Macbook Pro

    I want to install Windows XP pro on my new macbook pro.  I followed bootcamp assistant until i got the driver disc saying I need windows 7.  oopppss i dont want windows 7.  Can I still use Windows xp?  I have only one professional software package th

  • Java canot find symbol class

    i have create 2 class this is the first class public class Book{ private String BookTitle; private String BookAuthor; private int yearPublished; public Book(String Title, String Author, int yr){ BookTitle = Title; BookAuthor = Author; yearPublished =

  • How do I managed audio preferences for lab machines?

    I am unable to get an audio preference to be a the default configuration for all users, local or network. I've created a user template that has all other configurations and preferences and this works great except for audio I/O. All lab machines have

  • HT1391 how to move itunes files  from mac to nonmac computer

    I have a macbook pro with 10.9.5 and I want to share some videos that I bought from Itunes with someone who does not have a macintosh computer.  Can I do this?  If yes, How?