Selecting node of tree

Hello thanks for anyone before..
I have a problem with selection of my Tree. my tree nodes contains of ItemFormat like :
class ItemFormat
private String code;
private String description;
..... mutator and accessor methods......
when i have displayed my tree successfully i can print on screen about selected itemFormat to display description instance variable.
but after I edit my node and then i selected again the selected node can't be casted to ItemFormat to display its description...
please help me...
thanks before....

Thanks Tony,
The application I have is a means of commercial seafood dealers recording what species they have purchased/landed. The page is designed with a tree listing all of the species and their sizes and then the tabular report of landings. The current application uses a collection to display the landings....I was trying to get rid of the collection and populate the table directly.
thanks for getting back to me. Sounds like I will need to keep the collection....just looking for examples.

Similar Messages

  • Auto scrolling to a selected node in Tree

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

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

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

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

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

  • Save selected node in Tree control

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

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

  • Highlight selected node in tree

    I have a tree in the left, representing my company´s departments structure and in the right, when clicked, I show the employees that are subject to that department.
    I´ve noticed there´s no visual nor code (id, class, nothing) difference between the currently selected node of a tree and the others.
    There´s a way to do that? I thought about using js, but the only way a see to do that is using a regex in the link text of that node, comparing to the variable that that was passed to the page.
    Someone?
    Thanks

    Trees currently don’t have a concept of a “current” node. You could try using lists instead; though they won’t be query based, they would have to have static values. And in the current 1.6 version you can’t have hierarchical lists, though that will be added in 2.0.
    Marc

  • Is there an example of populating a tabular form by selecting node in tree

    Hi, I am using apex 4.1. I have created a tree region, and would like to click on a child node and have it populate a tabular form. My tree attribute has the following query:
    select case when connect_by_isleaf = 1 then 0
    when level = 1 then 1
    else -1
    end as status,
    level,
    "NODE_LABEL" as title,
    null as icon,
    "SEQ_NBR" as value,
    null as tooltip,
    'f?p=&APP_ID.:900:'||:APP_SESSION||'::::P900_SELECTED_NODE:'||"SPECIES_QC_ID" as link
    from "#OWNER#"."SPECIES_TREE"
    where partner_id = :G_ISSUING_AGENCY and nvl("SPECIES_TREE"."DISPLAY_FLAG",'Y') <> 'N'
    start with "NODE_PARENT" is null
    connect by prior "SEQ_NBR" = "PID"
    order siblings by "NODE_PARENT"
    I am not certain how to set up the tabular form....are there any examples out there? thanks! Karen

    Thanks Tony,
    The application I have is a means of commercial seafood dealers recording what species they have purchased/landed. The page is designed with a tree listing all of the species and their sizes and then the tabular report of landings. The current application uses a collection to display the landings....I was trying to get rid of the collection and populate the table directly.
    thanks for getting back to me. Sounds like I will need to keep the collection....just looking for examples.

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

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

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

  • How to display the path of selected node of a tree table.

    Hi,
    I have one use case where I have to display the path of node of tree table which is selected one.
    e.g.
    Suppose the tree table is like this.
    Folder1(root)
              ->folder2
              ->folder3
                        ->folder4
    Now when I select this folder1 then path display should be "/folder1(root)"
    when i select the folder4 then path should be "/folder1(root)/folder3/folder4"
    Hope this one will help to understand my use case..
    Thanks

    Hello,
    try this:
    jsp page:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1">
          <af:messages id="m1"/>
          <af:form id="f1">
            <af:tree value="#{bindings.RootNodes.treeModel}" var="node"
                     rowSelection="single" id="t1" expandAllEnabled="true"
                     rowDisclosureListener="#{Test.testDisclosureListener}"
                     selectionListener="#{Test.SelectionListener}">
              <f:facet name="nodeStamp">
                <af:panelGroupLayout id="pgl0">
                  <af:outputText rendered="#{empty node.Link}" value="#{node.Edesc}"
                                 id="ot1"/>
                  <af:goLink rendered="#{!empty node.Link}" targetFrame="_blank" text="#{node.Edesc}" destination="#{node.Link}"  id="gl1"/>
                </af:panelGroupLayout>
              </f:facet>
            </af:tree>
            <af:outputText value="#{bindings.Id.inputValue}" id="ot2"
                           partialTriggers="t1">
              <af:convertNumber groupingUsed="false"
                                pattern="#{bindings.Id.format}"/>
            </af:outputText>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>
    code:
    package testing;
    import java.util.Iterator;
    import java.util.List;
    import model.businessObjects.view.ZamerTreeMenuViewRowImpl;
    import oracle.adf.view.rich.component.rich.data.RichTree;
    import oracle.jbo.Row;
    import oracle.jbo.uicli.binding.JUCtrlHierBinding;
    import oracle.jbo.uicli.binding.JUCtrlHierNodeBinding;
    import org.apache.myfaces.trinidad.event.RowDisclosureEvent;
    import org.apache.myfaces.trinidad.event.SelectionEvent;
    import org.apache.myfaces.trinidad.model.CollectionModel;
    import org.apache.myfaces.trinidad.model.RowKeySet;
    public class Test{
        public Test(){
        public void testDisclosureListener(RowDisclosureEvent rowDisclosureEvent){
            RichTree tree1=(RichTree)rowDisclosureEvent.getSource();
            CollectionModel model = (CollectionModel)tree1.getValue();
            JUCtrlHierBinding treeBinding = (JUCtrlHierBinding)model.getWrappedData();
            JUCtrlHierNodeBinding start = null;
            List focus = (List)tree1.getFocusRowKey();
            tree1.setRowKey(rowDisclosureEvent.getAddedSet().iterator().next());
            System.out.println("testing.Test.testDisclosureListener>>"+treeBinding.getPath());
            start = (JUCtrlHierNodeBinding)tree1.getRowData();
    //        ZamerTreeMenuViewRowImpl temp = (ZamerTreeMenuViewRowImpl)start.getRow();
            JUCtrlHierNodeBinding parent=start.getParent();
            String path="";
            ZamerTreeMenuViewRowImpl  r = (ZamerTreeMenuViewRowImpl)start.getRow();
            path+="/"+r.getAdesc();
            while(parent!=null){
                r = (ZamerTreeMenuViewRowImpl)parent.getRow();
                if(r==null){
                    break;
            System.out.println("testing.Test.testDisclosureListener>>"+path);

  • How to select more than one node in tree

    Hi
    plz any one know how to select multi nodes in tree components ??
    i wana select two employees or more from tree in order to know their informations how can i do that
    10nx for help

    i can select them from different parents that depends on what i want to select Like:
    Admin-Sam
    -Dinda
    Users-David
    -Marylinn
    -Sandra
    for ex: i wana choose Sam , Sandra & David to view thier times and OT on selecting them

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

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

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

  • Dynamic tree selected node property id issue...

    hi -
    I'm successfully building a two-tier tree dynamically, but when a node is selected, it isn't consistently giving the correct property id for that node... sometimes it's correct, sometimes it's null, sometimes I have to select the node twice to get a value, or it shows the value from the previous selected node...
    I've tried tree1.getSelected() and tree1.getCookieSelectedTreeNode() but it's still the same result... it acts as though the cookie isn't getting updated each time... I've tried it with and without setting 'immediate' with the same result... below is the relevant part of my code... does anyone see why it's not getting the selected property id each time? help and suggestions welcome... Thanks
    try {
    java.util.List newNodeChildren = newNode.getChildren();
    while (srs.next()){
    TreeNode newNode2 = new TreeNode();
    newNode2.setTarget("_blank");
    newNode2.setText(srs.getString( "issue_title"));
    newNode2.setId("x" + issue_id);
    //Setup action event
    Hyperlink nodelink = new Hyperlink();
    nodelink.setText(newNode2.getText());
    nodelink.setId(newNode2.getId());
    Class[] signatures = {ActionEvent.class};
    MethodBinding mb1 = FacesContext.getCurrentInstance().getApplication().createMethodBinding("#{Page2.treeNodeActionListener}", signatures);
    nodelink.setActionListener(mb1);
    newNode2.getFacets().put(newNode2.CONTENT_FACET_KEY, nodelink);
    newNodeChildren.add(newNode2);
    srs.release();
    } catch(SQLException ex) {
    / error("SQL Error StatusTree Retrieval: " + ex);
    public void treeNodeActionListener(ActionEvent event) {
    String id = tree1.getCookieSelectedTreeNode();
    String actualId = id.substring(id.lastIndexOf(":")+2);
    info("treeNodeActionListener actualId = " + actualId);
    }

    Hi,
    1 I dropped Tree component from Palette. I deleted TreeNode1.
    <ui:tree binding="#{Navigator.tree1}" expandOnSelect="false" id="tree1" immediate="true" style="left: 0px; top: 0px; position: absolute" text="Sometext"/>
    2 In the init() method I called paintTree()
    It works fine.
    I use action method because I need only the id of selected node but I tested also listener method and it works
    Here is my code
    public void paintTree(){
    ArrayList conturi=new ArrayList();
    TreeNode nodN1 = new TreeNode();
    TreeNode nodN2 = new TreeNode();
    TreeNode nodN3 = new TreeNode();
    TreeNode nodN9 = new TreeNode();
    String Id;
    int lga=0;
    int lgc=0;
    try {
    conturi=getSessionBean1().getSes01FacadeRemoteClient1().getMyEjbMethod();
    } catch (Exception ex) {
    log(".....", ex);
    Iterator iterator=conturi.iterator();
    while (iterator.hasNext()) {
    detalii.Conturi cont=(detalii.Conturi)iterator.next();
    lgc=cont.getConts().length();
    if (lga < lgc) {
    if (lgc == 1) {
    nodN1=new TreeNode();
    Id= "Node_"+cont.getId();
    nodN1.setId(Id);
    nodN1.setText(cont.getDenumire());
    tree1.getChildren().add(nodN1);
    if (lgc == 2){
    nodN2=new TreeNode();
    Id= "Node_"+cont.getId();
    nodN2.setId(Id);
    nodN2.setText(cont.getConts()+"-"+cont.getDenumire());
    nodN2.setStyleClass("leftAligned");
    nodN1.getChildren().add(nodN2);
    if (lgc == 3){
    nodN3=new TreeNode();
    Id= "Node_"+cont.getId();
    nodN3.setId(Id);
    nodN3.setText(cont.getConts());
    nodN3.setStyleClass("leftAligned");
    FacesContext context=FacesContext.getCurrentInstance();
    MethodBinding mb1 = context.getApplication().createMethodBinding("#{Navigator.treeNode_action}", null);
    nodN3.setAction(mb1);
    nodN2.getChildren().add(nodN3);
    } //end-if
    } //end while
    public String treeNode_action() {
    try {
    clientId=tree1.getCookieSelectedTreeNode();
    String id =clientId.substring(clientId.lastIndexOf("_")+1);
    getSessionBean1().setContId(id);
    info("clientId = "+ clientId);
    } catch (Exception ex) {
    log("Error Description", ex);
    return null;
    }

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

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

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

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

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

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

  • Programatically select a different tree node.

    I have constructed the tree using ChildPropertyTreeModel. How do I programatically select another node in the tree? Also, after programatically selecting the tree node, does the model get reflected so that model.getRowKey() returns the newly selected node?

    In order to programatically select another node in the tree, you can use the following:
    tree.getSelectedRowKeys().clear();
    tree.getSelectedRowKeys().add( newKey );In order to have the tree point at the newly selected node, use the following:
    tree.setRowKey( newKey );If you do this tree.getRowKey() will point to the new one. If you don't do this I'm pretty sure tree.getRowKey() will just point at whatever it was pointing at before. Also it's important when you make changes like this to refresh the content of the tree, which can be done using RequestContext.getCurrentInstance().addPartialTarget( tree ).

  • ADF Tree 10.1.3.1, not highlighting the selected node.

    Hi,
    I'm having a problem highlighting the selected node in the ADF CoreTree.
    I use the treehandler and model as described in the link: http://technology.amis.nl/blog/2116/much-faster-adf-faces-tree-using-a-pojo-as-cache-based-on-read-only-view-object-showing-proper-leaf-nodes-again
    I use this objects because my tree was showing leaf node with the image to collapse.
    The tree now looks great, the only problem is that when i click on a node the focusRowKey is set accordingly(debugging the getter and setter) but is not show as the selected node.
    The tree jspx code looks the follow:
                   <!--TREE-->
                                     <af:tree value="#{ActosTreeHandler.treemodel}" var="node"
                                               focusRowKey="#{ActosTreeHandler.focusRowKey}"
                                               id="treeActos"
                                               varStatus="nodeStatus" binding="#{ActosTreeHandler.jsfTree}">
                                        <f:facet name="nodeStamp">
                                          <af:commandLink text="#{node.description}" partialTriggers="treeActos"
                                                          action="#{backing_documentos_detalhesDocumento.treeAction}">
                                            <!--disabled="#{node.nodeType != 'ACTO'}"-->
                                            <af:setActionListener from="#{ActosTreeHandler.jsfTree.rowKey}"
                                                                  to="#{ActosTreeHandler.focusRowKey}"/>
                                            <af:setActionListener from="#{node}"
                                                                  to="#{ActosTreeHandler.selectedNode}"/>
                                            <af:resetActionListener/>
                                          </af:commandLink>
                                        </f:facet>
                                      </af:tree>Does anyone know how this can be solved?
    Best Regards.

    Hi,
    is this the same as
    Re: Facing a problem in programmatically setting focus on a node in <af:tre
    Frank

Maybe you are looking for

  • How do I convert a WORD doc to pdf on my Mac

    How do I convert a WORD doc to pdf

  • Connect hdtv to mac mini

    Hi Is there any way of connecting an hdtv to a g4 mac mini? And is there any difference beteween a lcd tv with a resolutioin of 1366 x 768 and an hdtv with the same resolution?

  • Photosmart C6280 Not Printing Black Ink

    HI. I have 3 of the HP Photosmart C6280 All-in-One Printers and they have now all got the same problem. When I print or scan anything no black ink is printed. I have tried 3 different ink caritriages including the official hp ones  with no luck. When

  • Advice on export settings (codecs, sizes, etc.)

    I have a 1-minute iMovie, non-HD, 720x480. It was shot with a basic camcorder. I exported it using the Share > QuickTime > Web preset, and it came out as a 1MB movie, 320x240, and is REALLY grainy and kind of hard to watch. So I tried to experiment w

  • Credit managmenet

    Dear All, i have an open  sales order with a value 41677,8 this sales order  was supposed to be delivered on the date 20.03.2011 (but it did not happen) and its value calculated in the credit management as open sales order (which is true ) but as del