Getting ADF Data in a Jet Component (1)

0 0
Read Time:4 Minute, 33 Second

Oracle JET has been around for a while, and at this moment we are investigating what it would take to integrate JET with our existing ADF Application. In the current ADF application we want to make a dashboard in JET, however we still need to know for what project we need the data from. Therefore I am researching on how to get data from our ADF application into our JET part. In this blog I will show you how you can in an easy and quick way get your ADF BC data into your JET Components without using REST services.

I used the blog of Andrejus1 to set up JET within my ADF Application.

Add the JET libraries to the public_html folder of the ViewController project.

(Final) Structure of the project:

Make a jsf page and use af:resources to get to the css and requireJS and add the main.js

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html>
<f:view xmlns:f="" xmlns:af="" xmlns:dvt="" xmlns:ui="">
    <af:document title="main.jsf" id="d1">
        <af:messages id="m1"/>
        <af:resource type="css" source="jet/css/alta/2.2.0/web/alta.min.css"/>
        <af:resource type="javascript" source="jet/js/libs/require/require.js"/>
        <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-wp-preserve="%3Cscript%3E%0A%20%20%20%20%20%20%20%20%20%20require.config(%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20baseUrl%20%3A%20%22jet%2Fjs%22%0A%20%20%20%20%20%20%20%20%20%20%7D)%3B%0A%0A%20%20%20%20%20%20%20%20%20%20require(%5B%22main%22%5D)%3B%0A%20%20%20%20%20%20%20%20%3C%2Fscript%3E" data-mce-resize="false" data-mce-placeholder="1" class="mce-object" width="20" height="20" alt="&lt;script&gt;" title="&lt;script&gt;" />
        <af:form id="f1">

Then I added my composite component folder to the js folder of JET. My component is named amis-person and will show the name of the person in capital letters and the emailadress within a blue box. You can read more about composite components in the blog series of Duncan2

Put the metadata directly in the loader.js instead of via a json file, otherwise it will not work!. When you do it via the .json file and you console.log the in the function, you will see it does not print out the metadata from the .json file.

  function (oj, ComponentModel, view, css) {
        'use strict';
         var metadata = '{ "properties": { "amisPersonName": { "type": "string"}, "amisPersonEmail": { "type": "string"}} }';

      metadata: { inline: JSON.parse(metadata) },
      viewModel: { inline: ComponentModel },
      view: { inline: view },
      css: { inline: css }

Import the component in main.js to make it available.

require(['ojs/ojcore', 'knockout', 'jquery', 'ojs/ojknockout', 'jet-composites/amis-person/loader'],
function (oj, ko, $){
function ViewModel() {
    var self = this;</code>
    ko.applyBindings(new ViewModel(), document.body);

Create a page fragment where you will put the html to show your component, in this case it is just the composite component.

<?xml version='1.0' encoding='UTF-8'?>
  <ui:composition xmlns:ui="">
    <amis-person amis-person-name="NAME" amis-person-email="EMAIL" />

In the jsf page, create an iterator for the viewmodel and put the page fragment within the iterator

 <af:iterator id="iterator" value="#{bindings.EmployeesVO.collectionModel}" var="item">
    <ui:include src="/fragments/amis-person-fragment.jsff"/>

Change the bindings in the page fragment to match the output of the iterator

 <amis-person amis-person-name="#{item.bindings.FirstName.inputValue}" amis-person-email="#{item.bindings.Email.inputValue}" />

That’s it, you are done. When I now run the project I see the data from the Employee Viewmodel in the Jet Component I made:



  2. (and the other blogs)
  3. ADFJetDemo Application or Github

Versions used

JDeveloper 12.1.3,
OracleJet V2.2.0


The information is based on my personal research. At the moment, Oracle does not support or encourage integrating ADF and Jet. Oracle is working on JET Composite Components in ADF.

There is also a second part, on how to this, but then with DVT’s

About Post Author

Cindy Berghuizen

Cindy studied Software Engineering in Amsterdam. After university she starting working as an ADF developer at AMIS. Then webdevelopment happened and has since been the main focus. When not coding she is stopping balls as a goalkeeper.
0 %
0 %
0 %
0 %
0 %
0 %

Average Rating

5 Star
4 Star
3 Star
2 Star
1 Star

2 thoughts on “Getting ADF Data in a Jet Component (1)

  1. Very important to mention – JET Composite is getting data directly from ADF Bindings, there is no REST layer here. This simplifies JET implementation in ADF Faces significantly.

  2. Thanks for sharing this information ,very clean presentation every user can understand it easily.
    Keep posting useful articles like this.
    Thank you

Comments are closed.

Next Post

Getting ADF Data in a Jet Component (2)

In my previous blog I explained how to get ADF Data in a Jet Component, this was done by iterating through a ViewObject and rendering a component per element in the View Object. When you want to use the DVT’s from Oracle Jet, this won’t do the thing, because you […]
%d bloggers like this: