Tuesday 15 May 2007

Follow-up: Programmatic ADF Faces Tree in JDev 11g

As follow-up to my recent post "Back to programming: Programmatic ADF Faces Tree component" I mentioned as a final caveat that the JDev 11g class stack for the ADF Faces components has changed from that in JDev 10.1.3. Thanks to Frank Nimphius's reply on the OTN JDeveloper forums to a question about the deprecation of the TreeModel class, it's now obvious that the org.apache.myfaces.trinidad.model.TreeModel class is the appropriate replacement (assuming you're replacing ADF Faces with Apache Trindad in JDev 11g -- Apache Trinidad is the natural successor to JDev 10.1.3's ADF Faces component set).

As such in my previous example, within the custom TreeModelAdapter class, you simply have to replace the following 2 import lines:


import oracle.adf.view.faces.model.ChildPropertyTreeModel;
import oracle.adf.view.faces.model.TreeModel;


.... with ....


import org.apache.myfaces.trinidad.model.ChildPropertyTreeModel;
import org.apache.myfaces.trinidad.model.TreeModel;


Enjoy.

5 comments:

Mourado said...

Hi,
it is really a very important tuto,
but how to proceed if the data is taken from data base

Thanks

Gopal Rao said...

Hi,

I am new to ADF and I would like simulate the Windows Explorer sort of thing on the collection that has a tree hierarchy.

I am able to successfully display the list of folders and sub-folders in a ADF Tree component on one side of the Splitter panel.

I want to display the the folder contents ( when a folder is selected on the tree ) on the right side in a ADF Table component. I could not find info on how to achieve this.

Could someone help me?

Gopal

Chris Muir said...

Hi Gopal

Can I suggest you take your question to the OTN JDev forums as it is the best place to get technical assistance and fast results.

Good luck.

Regards,

CM.

Unknown said...

Hi there,

I want to use the same trick for treetable, i.e. a list of java beans, each of the bean has a list of java beans.

I can't seem to make it work. How can I make the hierarchy binding working?

Chris Muir said...

Under JDev 11gR1 it's no longer necessary to use JavaBeans in this case. See the following blog post, and follow the Steve Muench link at the bottom:

http://one-size-doesnt-fit-all.blogspot.com/2009/09/jdev-11gr1-aftree-mashup-using.html

CM.