Thursday, December 17, 2015

Improved JET Rendering in ADF

Method and information outlined below describes my personal research and doesn't define best practice. Such approach is not recommended/supported by Oracle and should be used at your own risk. Oracle is working on JET Composite components for ADF, to be available in the future. Limitations and caveats for this approach are described by Duncan Mills:

1. No session sharing between ADF and JET 
2. ADF and JET can’t use the same cache 
3. No shared transaction 
4. Separate timeouts 
5. Geometry management 
6. Drag&drop not possible between ADF and JET 
7. Different maintenance and different libraries 
8. Different popup’s and glasspane

This post is supposed to provide improved solution for the approach described previously - ADF and Oracle JET - Integration Pattern with ADF Regions. Many thanks to John Brock, Product Manager for Oracle JET, for his proactive comments and suggestions.

I have changed it to JET rendering in ADF, instead of integration. Perhaps word 'integration' is too strong in this context. You should not mix two frameworks together, like trying to render data from ADF bindings in JET components. Oracle doesn't encourage mixing ADF and JET, there is no support for this.

But still there are valid business requirements to create JET islands inside ADF. For example, fast data entry or displaying data from WebSocket. We could use JET table on top of REST within ADF page and allow users to type and save data really fast. There will be no integration between ADF and JET features, simply JET UI rendering inside ADF page. Similar as ADF DVT components currently work, they are based on JET libs (at least I heard such talks on OOW).

Here you can download improved sample application (you must download JET separately and copy into public_html folder) - DashboardApp_v3.zip. Improvements:

1. No need to use ADF region, it works to isolate JET code into JSF fragment


2. We can use simple JSF include to include fragment with JET into ADF page


3.CSS stylesheet is loaded once in the main page. Using af:resource, instead of script:


4. This is how it looks, chart is rendered by JET component. Obviously we could render same chart with ADF DVT, but here is only simple example. In the future I will post more advanced use cases. ADF UI built with Masonry layout, including JET island tile:

3 comments:

Subhash Chandra said...

Hi Andrejus

My use case involves showing the JET UI inside a 2nd level popup(which is a jsff based BTF). I was able to render the UI using the approach you specified in the sample application. Though the functionality looks to be ok, I have an issue with respect to CSS. I'm trying to render the JET charts inside the popup and it is rendered without any proper css styles. It works fine when I try to do the same thing in a sample application where a popup is opened from a jspx page. I suspect that the JET specific css initialization is not done properly in my case.

This is the flow.

Application home page -> 1st level popup(jsff based BTF containing only ADF content) -> 2nd level popup(jsff based BTF containing ADF+ JET charts UI)

I put the below code in the 1st level popup BTF jsff.



require.config({
baseUrl: "js"
});

require( ["main"]);


Do you see any issue with this approach. Can you please provide any pointers to fix this issue. Thank you in advance for your help.

Andrej Baranovskij said...

Hi,

I would need to take a look into app, hard to guess.

Regards,
Andrejus

Adf Developer said...

Hello Andrejus,

You are just awesome,Keep doing the good work.

please help me out with few questions.

1.You have included the jet code(ojet-chart) in the main.jsf file, which is independent of the existing adf code in the page.Can we merge both the adf code and jet code,i mean can we use the jet features in adf table or adf form.

2.In order to make an application by using jet front end and ADF Back-end,Is exposing the ADF BC as Rest services in Oracle Visual Builder the only way to do?Are there any alternatives to it.

one more point to share,because of you i am finding ADF easy.