Tree in Jdeveloper

Hi all,
do you have any idea of how can i get a hierarchial tree in a web application made by using Jdeveloper as a develpment tool

http://www.oracle.com/technology/products/jdev/101/tutorials/e2etopfaces/e2etopfaces.htm#t3

Similar Messages

  • Query on ADF Tree rendering - Jdeveloper 11g

    Hi,
    Am facing issues with Tree component rendering. Please find details below.
    Am using Jdeveloper 11g and have created data controls using plain java objects.
    Issue 1:
    I have a method getEmployees() which contains hierarchical data. Upon dragging this onto UI and on creating tree binding, i am able to see the tree.
    However i can expand only the parent node. Upon clicking on any of the child nodes (i.e Level 1 nodes), i get a blinking icon forever.
    Note that upon selecting the context menu option on root node and on selecting "Expand all", i get the complete tree in expanded format.
    Can anyone suggest as to what might be the issue with node expansion here ?
    Approach 2
    I tried creating Treemodel programatically.
    Please see snippet below:
    public TreeModel getModel() throws IntrospectionException {
    if (_model == null) {
    model = new ChildPropertyTreeModel(instance, "children")
    public boolean isContainer() {
    return ((T)getRowData()).hasChildren();
    return _model;
    By creating tree model in this way, tree node expansion issue is resolved. But i noticed that upon clicking on node for expansion,
    the getChildren() method (i.e the childProperty method) gets invoked multiple times and not once for the specifically expanded node.
    Can anyone please suggest as to why this is happening/possible solution?
    Thanks
    Navin

    Thanks for the reply. I can see the facets in the structure window and can seemingly add components there, but this is not reflected in the Design view for the page. Very strange. When the page is run, none of these components in the Accordion panel facets are displayed...
    I'm using JDeveloper version 11.1.2.1.0.

  • 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

  • [SOLVED] Trying to get ADF Tree to show Distinct results only

    Hello,
    I am trying to make an ADF Tree in JDeveloper 10.1.3.3.0.4157.
    I have it show two levels, each level is from one column of my table.
    For example, if I had columns
    Sec_1
    1
    1
    2
    2
    and
    Sec_2
    4
    5
    6
    7
    I want it to show a tree that has
    1
    ---4
    ---5
    2
    ---6
    ---7
    But instead it shows as
    1
    ---4
    ---5
    1
    ---4
    ---5
    2
    ---6
    ---7
    2
    ---6
    ---7
    Is there any way I can fix this? I've tried changing my view objects to specify SELECT DISTINCT but that doesn't work because I need to include a primary key in each view object and the primary keys are of course already distinct.
    Sorry for the poor diagrams but I couldn't think of a better way to explain it.
    Thanks
    Message was edited by:
    TheNelson

    I guess I sould clarify a bit:
    I have a dropdown menu elsewhere on the form that chooses something from a separate column (main_column). When that is selected, the tree appears and shows the columns I mentioned. Sorry, I didn't think this other one might be relevant.
    So I have
    main_column
    a
    a
    a
    a
    b
    b
    b
    b
    Sec_1
    1
    1
    2
    2
    3
    3
    4
    4
    Sec_2
    3
    4
    5
    6
    3
    4
    5
    6
    The Master VO is for the main_view, and it then had a detail Sec_1 and in that is a detail Sec_2.
    I've made view links between all of them.
    The problem happens like I said in my above post is that the main_column (and a few others) are primary keys and need to be included. Especially main_column needs to be included in my view object because it is used in the view link with the dropdown box.
    Does that make sense? Sorry for not describing this well earlier, I was trying to simplify it.
    Basically the problem is:
    A view object needs to have a primary key
    A primary key has every value distinct
    using SELECT DISTINCT therefore selects every row.
    Message was edited by:
    TheNelson

  • Jsf VS wcm servlet- combine JSF & WCM tags in the same page

    Hey all,
    I wanted to get to you a problem I've encountered and see if you can direct me.
    Note: I found a way to work around the problem, we will see later -
    but this will not bring me to full integration.
    The problem arises when I create a region\page template file in the ucm system and make use
    of - (Jsf component (for example: h: outputpanel.
    In this situation, there are two servlets in the web.xml file that mapping of
    url which comes.
    1. wcm site template servlet that maps tree placement (that is when I
    went in url to the servlet
    http://localhost/application-name/context-root/section1/index.html
    know to map the url to the template defined tree under the same
    section.
    2. jsf servlet - when i used jsf components.
    When I turn to the page for wood and is defined in the UCM, the jsf
    servlet does not handle the request and therefore I get an error: Can
    not find facesContext.
    The problem: Can we find a way to make 2 the servlets work together
    and perform this mapping for us? Is there a way or example of a jsf
    page which can be combined with the ucm system defined tree (this
    detail is important, because if I just set up a page in application
    and came back to it, not through the tree can I combine Jsf -It's
    important for me to do it in the form submitted by the link mentioned
    above).
    Note: I found a roundabout solution like I mentioned, working with the
    iframe as separate jsf pages and read them from a page in the system.
    While this solution meets the requirements but still ran into some
    combinations between the two issues resolved was not trivial.
    I'd appreciate it if somebody could help \ guide me to resolve the problem.

    Thanks a lot for your answers.
    I just want to clear my point, the real problem is when i want to define in my site's tree(at jdeveloper) page X for Section SX
    but page X should include jsf tags.
    When we defined page(region template) in section properties placeholder, meaning at the site's tree, the explorer will show the page as http://machinehost:7001/context-root-site/sectionX/index.html.
    Each page in the site tree will had this pattern, therefor when we add a jsf tags to our page there is a conflict between the servlets (Faces VS WCM)
    because that jsf servlet could'nt map this url to faces url and i got faces context Error.
    I am just trying to clean my point, so it's not relevant to contributor mode...
    i just want to know for sure that there is no way to define region template at site tree for section X with jsf tags.
    I will very glad to know yours opinion about my solution- working with iframe, meaning that the page at site tree will include iframe to jsf page which exsit in the application. this solution solved the conflict problem because i have now two pages.
    thanks you again,
    Regards
    Eran zizler

  • Can't connect to database with jdev-no more data to read from socket

    I have installed database 10g XE and everything was working fine(connecting from sql plus,forms builder etc.).Yesterday i opened jdeveloper for the first time(i am a total newbie in the world of oracle) and as being said in the tutorial i tried to connect to the database.So i was trying to connect to the hr sample schema and my first error message was ora-12505,this is an error that is sid related.Ok,i said and went to the forums and found a few solutions to this problem.After configuring my sid and local host i clicked on test connection button and got this message:NO MORE DATA TO READ FROM SOCKET! I tried finding solutions but they all seem java related and i can't really understand it.I am sure that i have configured everything(sid,host name,etc.) good because i am not getting error messages like before.Any help would be highly appreciated!!
    p.s. sorry for my english it's not my first language
    regards

    You now have two different ORACLE_HOME folders; 1 for DB & other for JDeveloper.
    You neglected to specify OS name & version.
    Make sure at the OS level that ORACLE_HOME is equated to the DB tree (not JDeveloper).

  • Creating Tree Model in JDeveloper 11.1.2

    hi!
    I tried the steps written in blog below but it didn't work. The output was 'no data to display'. Can anyone suggest me where I can find full procedure according to JDeveloper 11.1.2 for creating our own Tree model.
    [http://www.yonaweb.be/creating_your_own_treemodel_adf_11g_0]
    Thanks in advance!!
    Edited by: 886029 on Sep 22, 2011 4:51 AM

    You can check the tree demos here:
    http://www.oracle.com/technetwork/developer-tools/adf/documentation/adf-faces-rc-demo-083799.html
    for examples of beans with tree model.
    Of course if you are just accessing a database, then using ADF BC or JPA/EJB will get you there without any code needed.

  • Read Selected Tree Node value.  Jdeveloper Jdeveloper 11.1.2.1.0 11.1.2.1.0

    Version: Jdeveloper 11.1.2.1.0
    how to get programmatically tree node value.
    i have tried but cann't read value from selected node.
    please help me.
    here is my application creation steps:
    1. New Application
    2. Fusion Web Application (ADF) Template
    3. Create View Object VOTreeMst
    Query:
         Select Department_Name,Department_Id
         From Departments
    4. Create View Object VOTreeChd
    Query:
         Select Last_Name,Employee_Id,Department_Id
         From Employees
    5. Create View Link VLTreeMstChd
         VOTreeMst.DepartmentId=VOTreeChd.DepartmentId
         And Add to Application Module
    6. Create page page1 in ViewController
         New-->Web Tier-->JSF/Facelets-->Page
         Selected Document Type JSP XML
    7. Drag VOTreeMst1 From Data Controls into page1
    and select Tree-->ADF Tree
    8. ADD java Code into selection Listener
    public void nodeSelect(SelectionEvent selectionEvent) {
    //original selection listener set by ADF
    String adfSelectionListener = "#{bindings.VOTreeMst1.treeModel.makeCurrent}";
    //make sure the default selection listener functionality is preserved.
    //you don't need to do this for multi select trees as the ADF binding
    //only supports single current row selection
    /* START PRESERVER DEFAULT ADF SELECT BEHAVIOR */
    FacesContext fctx = FacesContext.getCurrentInstance();
    Application application = fctx.getApplication();
    ELContext elCtx = fctx.getELContext();
    ExpressionFactory exprFactory = application.getExpressionFactory();
    MethodExpression me = null;
    me = exprFactory.createMethodExpression(elCtx, adfSelectionListener, Object.class,
    new Class[] { SelectionEvent.class });
    me.invoke(elCtx, new Object[] { selectionEvent });
    /* END PRESERVER DEFAULT ADF SELECT BEHAVIOR */
    RichTree tree = (RichTree)selectionEvent.getSource();
    TreeModel model = (TreeModel)tree.getValue();
    //get selected nodes
    RowKeySet rowKeySet = selectionEvent.getAddedSet();
    Iterator rksIterator = rowKeySet.iterator();
    //for single select configurations, thi sonly is called once
    while (rksIterator.hasNext()) {
    List key = (List)rksIterator.next();
    JUCtrlHierBinding treeBinding = null;
    CollectionModel collectionModel = (CollectionModel)tree.getValue();
    treeBinding = (JUCtrlHierBinding)collectionModel.getWrappedData();
    JUCtrlHierNodeBinding nodeBinding = treeBinding.findNodeByKeyPath(key);
    Row rw = nodeBinding.getRow();
    //print first row attribute. Note that in a tree you have to determine the node
    //type if you want to select node attributes by name and not index
    String rowType = rw.getStructureDef().getDefName();
    if(rowType.equalsIgnoreCase("VOTreeMst")){
    System.out.println("This row is a department: " + rw.getAttribute("DepartmentId"));
    else if(rowType.equalsIgnoreCase("VOTreeChd")){
    System.out.println("This row is an employee: " + rw.getAttribute("EmployeeId"));
    else{
    System.out.println("Huh ????");
    // ... do more usefuls stuff here
    9. when i click on first node it is working but i click on second node it is not working
    error message::
    <LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase INVOKE_APPLICATION 5
    javax.el.ELException: java.lang.NullPointerException
         at com.sun.el.parser.AstValue.invoke(Unknown Source)
         at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1589)
         at org.apache.myfaces.trinidad.component.UIXTree.broadcast(UIXTree.java:237)
    <RegistrationConfigurator> <handleError> ADF_FACES-60096:Server Exception during PPR, #1
    javax.el.ELException: java.lang.NullPointerException
    I have also tried using following code but same problem
    public void onTreeSelect(SelectionEvent selectionEvent) {
    //original selection listener set by ADF
    String adfSelectionListener = "#{bindings.VOTreeMst1.treeModel.makeCurrent}";
    //make sure the default selection listener functionality is preserved.
    //you don't need to do this for multi select trees as the ADF binding
    //only supports single current row selection
    /* START PRESERVER DEFAULT ADF SELECT BEHAVIOR */
    FacesContext fctx = FacesContext.getCurrentInstance();
    Application application = fctx.getApplication();
    ELContext elCtx = fctx.getELContext();
    ExpressionFactory exprFactory = application.getExpressionFactory();
    MethodExpression me = null;
    me = exprFactory.createMethodExpression(elCtx, adfSelectionListener, Object.class,
    new Class[] { SelectionEvent.class });
    me.invoke(elCtx, new Object[] { selectionEvent });
    /* END PRESERVER DEFAULT ADF SELECT BEHAVIOR */
    RichTree tree = (RichTree)selectionEvent.getSource();
    TreeModel model = (TreeModel)tree.getValue();
    //get selected nodes
    RowKeySet rowKeySet = selectionEvent.getAddedSet();
    Iterator rksIterator = rowKeySet.iterator();
    //for single select configurations, thi sonly is called once
    while (rksIterator.hasNext()) {
    List key = (List)rksIterator.next();
    JUCtrlHierBinding treeBinding = null;
    treeBinding = (JUCtrlHierBinding)((CollectionModel)tree.getValue()).getWrappedData();
    JUCtrlHierNodeBinding nodeBinding = treeBinding.findNodeByKeyPath(key);
    Row rw = nodeBinding.getRow();
    //print first row attribute. Note that in a tree you have to determine the node
    //type if you want to select node attributes by name and not index
    System.out.println("row: " + rw.getAttribute(0));
    But
    If i create .jspx page From
    Web Tier->Jsp->page Then it is working fine
    when i create .jspx page From
    Web Tier->JSF\Facelets->page Then it is not working
    i need to get value from "Web Tier->JSF\Facelets->page"
    is there any help please?

    You should try Franks generic selectionListener http://www.oracle.com/technetwork/developer-tools/adf/learnmore/25-generic-tree-selection-listener-169164.pdf. For help on hoe to get the selected tree node data check http://www.oracle.com/technetwork/developer-tools/adf/learnmore/26-get-selected-tree-node-data-169165.pdf
    Timo

  • Setting Dialog, Tree Node and Menu Font in JDeveloper 11.1.1.4/11.1.1.5

    Hi,
    I'm near sighted and thus dependent on being able to choose larger fonts. For the code editor, this poses no problem. For the widgets in the views surrounding the editor (containing tree nodes) and dialogs (with the Preferences dialog being one example), the font is very small at high screen resolutions (I don't want to resort to a lower resolution since I would like the fonts to appear as detailed as possible).
    Is there any way to override the menu, tree node, and dialog font via command line switches and/or property/config files during JDeveloper startup in a platform independent way?
    If it can't be done platform independently, what are the necessary steps on Linux (probably for the GTK lib) and Windows?
    Thanks in advance!
    Kind regards,
    Holger

    I previously developed under full screen option and my PC resolution was 1600x1200. But when the application was ran on other screens it was displaying with some page contents being cut out. It was due to other machines running on lower resoultion. I will need now redesign the pages to run on user defined lower resolution of 1280x1024. How do I setup Jdeveloper design tab to show for 1280x1024.
    Thanks
    Edited by: user5108636 on Feb 14, 2011 5:23 PM

  • Af:tree skin selectors in JDeveloper 10.1.3.3

    Hi,
    i've read that in JDeveloper release 10.1.3.3 the af:tree component can now be skinned. Does anyone know of any documentation or examples in relation to this? The af:treeTable component is documented in http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/skin-selectors.html and i've attempted to use these skin selectors for the af:tree component. However the only ones that seem to have any effect are af|tree::expanded-icon and af|tree::collapsed-icon. Are these the only skin selectors available for the af:tree component? Or are there others?
    Thanks,
    Michael.

    Hi Frank,
    i was going by what was said in Re: ADF &CSS :overriding the default ADF:tree icons and CSSs (In the fix list it is listed as bug number 5682799). After re-reading this, i guess it just mentions the tree icons. So does this mean the only part of the af:tree component we can customize is the af|tree::expanded-icon and af|tree::collapsed-icon?
    Thanks,
    Michael.

  • JSP ADF Tree Binding in JDeveloper 10g

    I am attempting to create a JSP hierarchical tree structure in JDeveloper 10g. I can successfully create the tree structure for two levels only. I need to be able to create a tree 5 or more levels deep. I have created an ADF Master Detail structure using the sample OE schema for three levels and to the best of my knowledge, I have set up the rules correctly using the Tree Binding Editor accessed by a creating a new binding under Create Binding > Input > Tree for the UIModel of the test web application I created. However, in the JSP page, I can only access the first two levels. The code I'm using is as follows:
    <c:forEach var="masterRow" items="${bindings.CustomerOrdersTree.rootNodeBinding.children}">
    <c:out value="${masterRow.CustomerId}"/> -
    <c:out value="${masterRow.CustFirstName}"/>
    <c:out value="${masterRow.CustLastName}"/><br>
    <c:forEach var="ordersChildRow" items="${masterRow.children}">
    <c:out value="${ordersChildRow.OrderId}"/><br>
    <c:forEach var="Row2" items="${ordersChildRow.children}">
    </c:forEach>
    </c:forEach>
    </c:forEach>
    The first two levels display fine, but the third level is not displaying. What syntax should I be using to traverse further levels of the tree binding? Is it even possible? Thanks.
    Note: I didn't connect any event handlers for collapsing or expanding data. I'm just trying to display everything right now.

    I have the nodeExpanded attribute on the second level, set up exactly as the first level. I have a toggleSelection method on the second level (View Object) as well. I've stepped through this method and the arguments are passed correctly and the transient attribute is updated correctly. I'm calling this method through a second DataAction like treeHandler, and this works as far as calling the correct method with the correct argument values.
    The breakdown occurs back on the JSP. Even though the transient attibute gets populated accurately according to the toggleSelection method, when accessing that attribute on the JSP, it returns a null value. I can access all the other attributes from the same View Object, except for the transient attribute. I'm not sure what else to try.
    I'm starting to doubt this is even the best solution for a tree structure. With the way Oracle's example is set up, you would have to nest so many if-then structures in order to keep track of all the nodeExpanded attributes and which data to display or not, and I anticipate view state issues and caching problems.

  • "walking" through a tree in javascript. JDeveloper 11g tp3

    Is there a way (or some sample code) for walking down a tree and seeing which rows are disclosed (or expanded); in general getting the TreeState() on the client side using javascript?
    Thanks Larry
    Message was edited by:
    glmason

    Thanks Frank
    Yes, I've read every bit of documentation that you have on the JavaScript API... there is a flaw with you short answer... The default selection mode is none and in our case the row selection is kept unenabled, we use a check box on the node instead for displaying choice, so where one could get a set of row keys from the selection listener... and the disclosure listener... there seems no way get a "complete" set of row keys from the tree. So if the program does not "know" the number of rows there is no way to check each row to see if it is an expanded path or not. And even if one could find the number of rows (which can be done in the RichTree java class), according to the documentation one can not just assume that RowKeys are going to be 0,1,etc... rather "explicit" row keys are needed because the system creates row keys by some magic.
    Hence my question is there some way to get the tree state from the RichTree javascript object?
    I would "love" it if you told me I was full of it and that if I wanted to know the state of a tree all I'd have to do is...
    Larry

  • Tree/TreeTable component development in Oracle JDeveloper

    Hi
    I am newbie for building JSF components using Oracle ADF. We have some data from other application which needs displayed in hierarchical fashion - Tree structure. Can I sample application in this regard.
    Thanks
    sunder

    Thanks for the information, it was helpful.
    Can you provide similar startup where we need to display data from web services in tree table format. We will also require to render the cell with as a radio button/text.
    Thanks
    sunder

  • Can not see the menu of New Business Components Package in jdeveloper

    I am just follow the developer guide.
    and when I create the Business Components Package, the guide said that
    ========================================
    In the JDeveloper Navigator, select the OA Project where you want to create your package.
    From the main menu, choose File > New to open the New Object Gallery.
    In the Categories tree, expand the Business Tier node, and select Business Components (BC4J).
    In the Items list, select Business Components Package to open the Business Components Package Wizard. You can also right-click on the OA Project and select New Business Components Package to navigate directly to the Business Components Package Wizard.
    =====================================
    In fact I can not see the menu about Business Components (BC4J) in the File/new/buisness tier/Business Components (BC4J).
    I can only see the File/new/buisness tier/ADF Business Components.
    And can not find the "Business Components Package" under ADF Business Components either.
    I am using the JDev Extension for OA (p5856648_R12_GENERIC.zip) and EBS 12.0.0.
    And I create an OA Workspace and OA Project.
    can anyone help?

    James,
    Use search facility on forum. Chk thread Re: OAF Toolbox Tutorial Help - Search
    --Shiv                                                                                                                                                                                                                                                                       

  • Tree Table is not getting refreshed properly in Jdev 11.1.2.0

    Hi,
    I am seeing a peculiar issue with tree table not getting refreshed in Jdev 11.1.2.0.
    Let me explain you my use case.
    I have a tree table in a page, where the first column is displayed as selectBooleanRadio component. When user selects this selectBooleanRadio component, that treetable node should get expanded and at the same time all the child records(I have a select boolean check box component(transient attribute) at the child level) for that node should get selected. This is to allow user to unselect the child records, which he/she does not want to process further(some functionality).
    Now when the user selects any radio button, the tree table node is not expanded, but the arrow beside the radio button for that node can be seen as expanded.
    I thought it may be a partial trigger issue, so i tried refreshing the tree table programatically as well. But it was of no use.
    Then I set the partial triggers wrt to SelectBooleanRadio component on the parent container of the TreeTable. After which somehow the node got expanded but the tree table shrinks in width and the actual disclosure functionality of a tree table is lost.
    The same use case works perfectly fine in Jdev 11.1.1.5.
    For reference:
    I created a sample test case(Dept/Emp) in jdev version 11.1.1.5, which works fine. Workspace: http://adf-use-cases.googlecode.com/files/TreeTable1.rar
    But the same test case, when i created in jdev version 11.1.2.0, gives issues. Workspace: http://adf-use-cases.googlecode.com/files/TreeTableUseCase.rar
    If you download the application and run in respective jdev version, you will get to know more about the issue.
    Please let me know, If I am doing anything wrong in the implementation of this use case.
    Any help/suggestions are appreciated.
    Thanks
    Umesh
    Note: My complete application is in Jdev 11.1.2.0, so I can't degrade my jdev version to 11.1.1.5.

    Thanks Frank for the reply.
    But upgrading the jdeveloper to 11.1.2.2 is not an ideal solution for us now, because of the size of the project.
    Some how, the issue of refreshing the tree table is resolved. I am using a command button with clientComponent to true and causing a full page refresh.
    I am not sure, if this is a perfect solution.
    As you said, that this behavior may be an issue with the Jdev version 11.1.2.0, I am using. I am going with the above said approach.

Maybe you are looking for