ADF Faces programmatic tree component

JDeveloper version - 11.1.1.7.0


Hi, I just follow this post (http://one-size-doesn) with a slight variation. The code for the creation of the tree that you specified in the constructor, I moved to the action the button event click. But the tree is not rendered on the click of the button. I tried refreshing the component of the tree programmatically and also applied the model once again at the end of the action method, but no permit.



public void addChildAnimalAction() {
        ArrayList<TreeItem> rootTreeItems = new ArrayList<TreeItem>();
        TreeItem treeItem1 = new TreeItem("Fish", "http://www.someurl1.com");
        TreeItem treeItem2 = new TreeItem("Dog", "http://www.someurl2.com");
        TreeItem treeItem3 = new TreeItem("Cat", "http://www.someurl3.com");
        TreeItem treeItem4 = new TreeItem("Tiger", "http://www.someurl1.com");
        TreeItem treeItem2_1 = new TreeItem("Blue Heeler", "http://www.someurl4.com");
        TreeItem treeItem2_1_1 = new TreeItem("Rover", "http://www.someurl5.com");
        TreeItem treeItem2_1_2 = new TreeItem("Ruffus", "http://www.someurl6.com");
        rootTreeItems.add(treeItem1);
        rootTreeItems.add(treeItem2);
        rootTreeItems.add(treeItem3);
        rootTreeItems.add(treeItem4);
        ArrayList<TreeItem> treeItem2Children = new ArrayList<TreeItem>();
        ArrayList<TreeItem> treeItem2_1Children = new ArrayList<TreeItem>();
        treeItem2Children.add(treeItem2_1);
        treeItem2.setChildren(treeItem2Children);
        treeItem2_1Children.add(treeItem2_1_1);
        treeItem2_1Children.add(treeItem2_1_2);
        treeItem2_1.setChildren(treeItem2_1Children);
        this.setListInstance(rootTreeItems);
 adfContext.addPartialTarget(this.getTreeRoot());
       if (_model == null) {
            _model = new ChildPropertyTreeModel(_instance, "children");
            System.out.println("--Inside getModel()if _model null -->   " + _model);
        }
    }

From the u mentioned link, after your changes to code to the action shift, check if your variable _instance still maintains the value until the tree goes.

Tags: Java

Similar Questions

  • Combination of ADF Faces and JSTL is advisable or trap?

    Dear all,

    Our applications(ADF/Webcenter) of fusion using JSTL and ADF Faces inside is advisable or pitfall. ADF Faces features are enough or do we need to rely on the JSTL functions? I prefer to use ADF Faces/JSF functions without the combination with others.

    for example 1


    < 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".
    xmlns:fn = "http://java.sun.com/jsp/jstl/functions" >

    for example 2

    < jsp:root xmlns:jsp = "http://java.sun.com/JSP/Page" version = "2.1".
    xmlns:af = "http://xmlns.oracle.com/adf/faces/rich".
    xmlns:f = "http://java.sun.com/jsf/core".
    xmlns:h = "http://java.sun.com/jsf/html".
    xmlns = "http://java.sun.com/jsp/jstl/core" >


    Best regards
    KT

    Hello

    Our applications(ADF/Webcenter) of fusion using JSTL and ADF Faces inside is advisable or pitfal?

    To suggest a rule: feature edge try ADF Faces before reaching out to the JSTL. The difference between JSTL and JSF in general, is that the JSTL expressions are evaluated in compiling page while JSF expressions are evaluated deferred. This difference can have an impact on the PPR updates and data rendering (which, in many cases I guess you can fix by defining the ADF Faces, content delivery component immediate instead of deferred). On a light background, I scored with a JSTL alert 'heads up' for this reason

    Frank

  • How should I do side tabs in ADF Faces?

    A common component in the web pages of today is an element, similar to the af: panelTabbed, but with the tabs on the side (start, end) for the position, instead of above and below only as panelTabbed. I also see this in JDeveloper in the property inspector and other void signs during their layout is horizontal. For example, ADF Faces has a component that does this? How would I do that. Any suggestions?

    The tab item can be on top or below.
    If you want to have the side tabs, you could use af:commandImageLink with an image of the tab. When you press it, you can switch the content on the right, for example by using an af:switcher or a dynamic region.

  • Compatibility ADF Faces and jQuery

    ADF Faces and jQuery is incompatible? In some of my pages I used jQuery to improve my drawing. Since ADF Faces has no component such as p or h1 or if I use these tags and ADF behaves unexpectedly. So by jQuery, I can wrap some components like div generated by af:panelGroupLayout. If I specify a styleClass to this pgl I can easily the warp by p as $('.cls').wrap ("< p..."). Are their any risk of error or of bad behavior to do? In one thread, I see as jQuery is not integrated into the life cycle of ADF so it can be difficult to tell whether or not it behaves by mistake. Y at - it no risk to deal with a problem of PPR?

    Hello

    In ADF Faces active JSF 2.0 use of things like JQuery would be more affordable, I would suggest that you test this last integration using Facelets and Jdeveloper 11.1.2.0. However you perception is right, using a lot of JQuery on your page in ADF faces, could potentially break some of the life cycle. There are, however, examples:
    http://codingwithpassion.blogspot.com/2011/01/using-jQuery-in-Oracle-ADF-faces.html
    http://George.maggessy.com/2010/08/ADF-and-jQuery-working-together.html

    What kind of JQuery components are you trying to use?

    -Juan Camilo

  • Get ClassCastException in programmatic tree of ADF

    Hello

    I am tracking Frank Nimphius Blog

    https://blogs.Oracle.com/jdevotnharvest/entry/how_to_programmatically_disclose_a

    to create a programmatic tree. I use no BC and DC. I'm only using ADF faces. I wrote this code as shown in the blog and I'm getting ClassCastException.

    {handleRowDisclosure}

    RichTree tree = (RichTree) event.getSource ();

    RKS = tree.getSelectedRowKeys ();

    If (rks! = null) {}

    rowKey = rks.iterator ();

    tree.setRowKey (rowKey);

    JUCtrlHierBinding treeBinding = null;

    CollectionModel collectionModel = (CollectionModel) tree.getValue ();

    treeBinding = (JUCtrlHierBinding) collectionModel.getWrappedData ();

    While (rowKey.hasNext ()) {}

    Key list = (List) rowKey.next ();

    JUCtrlHierNodeBinding nodeBinding = treeBinding.findNodeByKeyPath (key);

    If (nodeBinding! = null) {}

    Line = nodeBinding.getRow ();

    String rowType = row.getStructureDef () .getDefName ();

    If (IvsConstants.RULETYPE_Company.equals ((String) row.getAttribute ("type"))) {}

    setupPlanSelectItems ((String) row.getAttribute ("guid"));

    } ElseIf (IvsConstants.RULETYPE_Plan.equals ((String) row.getAttribute ("type"))) {}

    setupTransactionSelectItems ((String) row.getAttribute ("guid"));

    }

    }

    }}

    Getting exception:

    java.lang.ClassCastException: org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$ NodeIterator can not be cast as java.util.List

    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)

    at oracle.adf.view.rich.component.rich.data.RichTree.broadcast(RichTree.java:308)

    at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:157)

    at org.apache.myfaces.trinidad.component.UIXTree.broadcast(UIXTree.java:244)

    at oracle.adf.view.rich.component.rich.data.RichTree.broadcast(RichTree.java:308)

    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:112)

    to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:130)

    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)

    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)

    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:106)

    at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:159)

    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:112)

    to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:130)

    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)

    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)

    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:106)

    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1137)

    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:361)

    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)

    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)

    to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)

    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)

    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)

    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)

    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:468)

    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)

    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:468)

    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)

    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)

    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:119)

    at java.security.AccessController.doPrivileged (Native Method)

    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)

    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)

    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)

    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)

    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.wrapRun (WebAppServletContext.java:3715)

    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3681)

    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)

    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)

    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)

    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)

    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)

    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

    Caused by: java.lang.ClassCastException: org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$ NodeIterator can not be cast as java.util.List

    at org.apache.myfaces.trinidad.model.ChildPropertyTreeModel.setRowKey(ChildPropertyTreeModel.java:167)

    at org.apache.myfaces.trinidad.component.UIXCollection.setRowKey(UIXCollection.java:513)

    at com.adminserver.ui.search.BusinessRulesSearch.nodeSelected(BusinessRulesSearch.java:335)

    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    ... more than 61

    to

    Key list = (List) rowKey.next ();

    Any help on this will be really useful.

    Thanks in advance.

    Thank you all. Sorry for the late reply.

    It worked. I add the code below-

    Iterator rowKey = null;

    Object rowData = null;

    RichTree tree = (RichTree) rowDisclosureEvent.getSource ();

    RKS RowKeySet = rowDisclosureEvent.getAddedSet ();

    If (rks! = null) {}

    rowKey = rks.iterator ();

    While (rowKey.hasNext ()) {}

    Key of the object = rowKey.next ();

    tree.setRowKey (key);

    Get tree node by using tree.getRowData (), type cast to the node and do the treatment. On the basis of the treatment, you can call a method.

    Not type cast in JUCtrlHierNodeBinding because I do not use DC of the ADF and the province of British Colombia.

    }

    }

  • ADF Faces calendar component - error

    Hello

    I implemented a schedule ADF Faces component in my application by following this tutorial: http://docs.Oracle.com/CD/E12839_01/Web.1111/b31974/web_adv.htm#ADFFD19868 but when I run my page, I got the following error:

    Try to set a parameter name that does not intervene in the SQL: start

    .

    I thing, perhaps, there are some missing steps in the tutorial.

    Thank you for your help.

    Leslie

    Hello

    I found the solution through My Oracle Support.

    It was because my bind variables have been defined in the display of the Entity object request page, if necessary, instead of in the view to see criteria Page for entity object, to be not not required.

    Thank you.

    Leslie

  • How to conditionally bind the declarative component custom ADF ADF Faces

    Hi gurus,

    I created the custom declarative component called "Historical Record", following the article of Frank Nimphus Oracle ADF Code corner: How to bind custom declarative ADF Faces components and it works perfectly find.

    But I want to strengthen further to make more generic, as in Oracle EBS we can go to all the blocks and choose Tools-> history of the record and it shows WHO columns to the currently selected record.

    The intention is conditionally bind the attributes of the component with columns of WHO bodies VO.

    The scenario is:

    * all tables have Created_Date, Modified_Date for columns of the WHO.

    * the page containing the 2 instances of VO with different source (for example:-> emp dept)

    * whenever I have navigate dept records it should display columns WHO selected dept and the same thing then to move through the records of the emp.

    Kind regards

    Ferrere

    Well as I said, you shouldn't try to rebuild the Oracle Forms technology-specific behavior in some other technologies such as ADF (because it is not usually possible).

    It is probably best to have a separate button for each shape (square to a coherent position on all pages - as some form, toolbar header...)

    If you want to rebuild the behavior of forms, then you can use the combination of af: clientListener / af:serverListener to set a flag (as the name iterator) see scope that can be used by your 'global' button to retrieve the correct data. Therefore, add af:clientListener to each component entry...

    Dario

  • ADF Faces component can be used to represent parking garage

    I would like to have a jsf page that shows the location of the cars in a garage.

    So, I would draw a picture of a car in busy for a garage places.

    Any ideas on what ADF Faces view component, or any other component, could be used to represent the locations for a garage?

    I think you can add some HTML5 features in your ADF area app multiple using drawing beans

    http://www.html5rocks.com/en/tutorials/canvas/integrating/#sketchy

    Jhon

  • Question about the mix of Trinidad component with ADF Faces

    Dear all,

    I have a requirement for complex layout that I can't do with just ADF Faces component.
    I found this blog nice wfrom Jobinesh http://jobinesh.blogspot.com/2010/11/layout-tips-organizing-page-content.html
    and I quickly realize that this will solve my problem.

    Please note that components of Trinidad has not all client components peer as we have for the ADF Faces. You may need to be measured while choosing this guy

    I'm just concerned about this line. I can't really understand what it means and how it will impact my programming of the ADF.

    Thank you

    Neliel,

    Which, in my view, that Jobinesh says it's that you will not be able to use the HTML elements of the Trinity as targets for partial triggers. As far as I know, using HTML of Trinidad (trh :) components with ADF is OK, but using 'clean' Trinidad (tr :), you can have problems.

    John

  • Refer to the ADF faces RC component of programming client-side

    Hello
    One tried to access component customer adf in a taskflow-ADF using javaScript with its id
    I have an ADF taksflow including a pagefragment. The taskflow is encapsulated by a region r1 in a jspx page.
    I'm trying to access the component of

    document.getElementById("r1:componentName"); or
    AdfPage.Page.findComponent ("r1:componentName");
    AdfPage.Page.findComponent("::componentName");

    None works. The only way that works is to use
    var firingComp = event.getSource ();
    ...
    firingComp.findComponent ("componentName");

    However, as I call the function javascript from an Applet, I get entry to the event of shooting. So if I have to do it this way, I need to define a global varibale, assign him when another JS function called during an event of the ADF is triggered (for example, adf button click...)
    Then use this variable in the JS function called from cmdlet to locate the required component. It is quiet that annoying the user needs to interact with the adf page before that.
    Any suggestion?

    Hello

    ADF faces has an API on the client side. Please take a look at

    http://download.Oracle.com/docs/CD/E15523_01/Web.1111/b31973/af_event.htm#BABIDEGA
    http://download.Oracle.com/docs/CD/E14571_01/apirefs.1111/e12046/TOC.htm

    The starting point for a search is AdfPage.PAGE.findComponentByAbsoluteId (namingcontainer_id:component_id);

    Frank

  • [Table ADF Faces component] How to save the current state?

    Hello

    the ADF faces table component is great!
    You can drag-and - drop columns, sort columns...

    Now, we have an obligation to save the State of the table for subsequent sessions.
    The return of the user wants to get the same State as last time (order requirement or sort of column), even if he comes back a few days later.
    Is this possible?

    I discovered, that this information is stored in the session cookie. But this cookie is discarded in a few minutes...

    Any tips?

    fschulze,

    If you use 11 GR 1 material - you can read about MDS in chapters 33 and 34 of the Fusion for the ADF Developer's Guide - it does exactly what you ask... an update, don't know if it will save the sort order, but the documentation specifically mentions column reorganization as being recorded.

    John

  • ADF BC working with libraries of components of UI (except ADF Faces)

    Hello world

    I use JDev + ADF version: 12.1.2.0.0.

    I was wondering and also try to create an application of Fusion (using jsf, jsp pages not) but with other libraries of components, PrimeFaces and RichFaces rather than ADF faces. You could probably ask "why?" I'm really interested to integrate all the benefits that come from the ADF BC and use of a comprehensive library of user interface components (which could compensate for some missing components of the ADF Faces). My first choice would be on PrimeFaces, since it is entirely compatible JSF 2.0 and is the market leader. But my question is: is it still possible? If Yes, how can I do this? Note that my problem is not to put a simple component in a jsp page as in this tutorial: https://www.youtube.com/watch?v=-wHKWYwgr4o . But instead the exposure of data with these components controls, through the link layer (or the only possible way does all this programmatically?).

    PS: I tried to do the same procedure that Shay has shown on the tutorial above for PrimeFaces, but it seems that the pots of primefaces-4.0/3.5 do not have a definition of taglib included. AM I missing something or is it just that the community primefaces version does not include it?

    Thank you in advance!

    I managed to make it work. I had actually left behind the use of the taglib, but there are other problems with PrimeFaces. It seemed that there was some sort of conflict of the lifecycle when used in a merger application. For example, a simple submit button could not run its binded action, and all components with built-in ajax functionality had issues like this.

    The solution: I had to create another object of ViewController and remove all the adf associated configuration files (in my case, just adfc-config. XML). so I have an application with both a project for the "web" version and another for mobile. Of course, while deploying I include only one of them.

    NOTE: This method above works fine when you deploy in WLS. But another step is necessary in the event of deployment in Glassfish.

    1. After you have created an ear, I have to manually change the file "web.xml" in the package of the war, because while that JDev packages include some filters are specific for the ADF. In fact, I replace this file with the one used during development.

    2. starting at the war, remove all the libraries, with the exception of: jsf - api .jar, jsf - impl.jar, primefaces.jar and welding - integration.jar (if there are others).

    Hope this helps someone else.

  • How to test applications ADF Faces automatically?

    Hello

    I use JDEV 11.1.2.3 - but in fact, my question ist depends on the JDEV version.

    How to test the different layers of the stack of the ADF, in an automatic way?

    1. How can we test business services layer - using business components? I don't mean using the component browser...

    2. How can a test the ADF faces layer? Is there a list of best practices for selenium or so?

    3. is it possible to test the ADF controller layer? Would be a great thing to call the different taskflows programmatically...

    Thx for the answers!

    Marc greetings

    Test with JUnit.

    http://download.Oracle.com/otndocs/OTNVDD-rea/ppt/ADF_VDD_Testing.PDF

  • Problem with ADF expand/collapse tree

    Hi all

    I have a customer that has problems using the af:tree on a deployed application component. When he tries to expand or collapse a node in the tree, the icon just flashes. This happens not only on our request, but also the Oracle ADF Rich Client demo on http://jdevadf.oracle.com/adf-richclient-demo/faces/components/tree.jspx. It uses Internet Explorer v7.0.5730.13. As far as I know, our browser settings are the same, but I can use the tree without problem.

    Any ideas as to what could be the problem?

    Thank you

    Brad

    Make sure that under Advanced settings, they have Enable native XMLHTTP support under tension.

  • ADF faces components internationalization

    Hello

    I need customize my jspx on common language runtime page to show the content of the page in different languages. I need internationalization ADF faces component level as well. For example, I need the recovery message from table, the components panel menus in the indicated language at run time. I am able to do this for languages like french, German etc by doing two simple steps,

    1. in the JSPX page, set the view label to the locals as < f: view local = "fr" >

    2. register the local in the file faces - config.Xml.

    And I am able to see the languages changed in these components.

    But if I put the Chinese < f: view local = "zh_Ch" >... I am not able to see the changes. Please let me know how I can fix it.

    User, tell us your version of jdev, please!

    Should we not locale 'zh_CN '?

    There is no location for a language "zh_Ch".

    Timo

Maybe you are looking for