Saturday, April 9, 2011

Sequences in an ADF Applications

  Two options for applying a sequence
  • In code using SequenceImpl
  • Using DBSequence
ADF applications based on database tables will have to manage assigning sequence numbers to unique and primary key attribute values. Find out how you can do this in ADF Business Components.

  • In code using SequenceImpl

  • Using DBSequence




Programatically iterating through rows of a view object

                                A common use case is to be able to programmatically access the rows in a view object. This ADF Insider Essentials shows you how.


Link Video: http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/ADF_Insider_Essentials/IterateRows/IterateRows.html

ADF Form Level Hiding Particular Field using javascript in ADF -– Example


Add below lines at the end of each page (Example AutoComplete Property). 

 <trh:script id="trh1">
function disableAutoCompleteFormData()
{
   for(i=0; i!=document.getElementByTagName('FORM').length;i++){
 document.getElementsByTagName("FORM")[i].setAttribute('autocomplete','off');
   }
}
 </trh:script>

JDeveloper and Oracle ADF cut development time and costs by 20%


                I’m often asked about productivity of ADF over other frameworks and one of the issues that comes up is looking for hard facts on productivity.   So it was great to hear one customer put a figure to their savings.  This is a great storyfrom a customer I’d been working with who said that Oracle ADF and JDeveloper cut their development costs and time by 20%….More details on this customer here as well.
Of course, one swallow doesn’t make a summer, so its good to hear we have others saying how ADF is more productive.  Maybe there is something in this after all! ;o) 


  • 1.   Chose Oracle Application Development Framework to build the upgraded MedNext+ and selected the Oracle product for its visual, business logic-based development tools, ideal for creating rich applications
  • 2.     Used Oracle Application Development Framework and the integrated development environment of Oracle JDeveloper to build enterprise applications based on industry standards, cutting development time and cost by 20%
  • 3.        Leveraged the speed, performance, and scalability of Oracle WebLogic Server to support rapid development 
  • 4.        Delivered low latency, faster application speed, and enhanced user performance with Oracle JRockit
  • 5.        Embedded Oracle Business Intelligence into MedNext+ to enable risk carriers to track revenue against key performance indicators and make fact-based forecasting, marketing, and strategy decisions
  • 6.        Migrated existing and new customers to enhanced MedNext+, which is set to boost end-user performance 20% and cut cost of ownership over existing implementations by up to 50%
  • 7.        Increased revenue growth expectations 100% with MedNext+
  • 8.        Planned to use Oracle SOA and Unified Business Process Management Suites to build MedNext+ on extensible, SOAbased, application grid for automated workflow-routing with client systems




Tuesday, April 5, 2011

Adding Boolean Checkbox to Table Component in Oracle ADF

Hi,

I have seen many people asked this question at OTN forums so i decided to blog it.

In Oracle ADF  af:selectBooleanCheckbox and af:selectBooleanRadio component has Boolean datatype which is not actually SQL supported data type (In Oracle we have Boolean in PL/SQL) and most of us stores boolean column values as Y/N or 1/0 in our tables.

Solution is pretty simple you have to add transient attribute in your ViewObject and set the values to your actual attribute based the values in transient attribute

Follow these steps:

1) Add a Transient Boolean attribute in your VO
2) Generate a Java class ViewRowImpl with Accessors of your VO
3) Set your attribute's values in Transient getter and setter method

Heres the example:
Create a table called checkboxer

create table checkboxer
(date_val timestamp,
 check_status varchar2(1 char));

- Create a ADF application and add checkboxer's EOs VO and AM

- Add a Transient attribute called StatusBoolean in VO

- Generate ViewRowImpl class replace the existing code with as shown in the slide


- Thats all Run the Business component browser and check the values
- Drop a collection as ADF table and right click the StatusBoolean column and choose Convert to.. and select Checkbox boolean.

Download the workspace 

Monday, April 4, 2011

Learn Oracle Jdeveloper and ADF




I am posting important links below that will help you get started on ADF and understand the articles to follow.

·         Oracle ADF Home Page - http://www.oracle.com/technology/products/adf/index.html
·         Oracle ADF Learning Center - http://www.oracle.com/technology/products/adf/learnadf.html
·         Oracle JDeveloper Home Page - http://www.oracle.com/technology/products/jdev/index.html
·         Fusion Developer's Guide for Oracle ADF - http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/toc.htm
·         Web User Interface Developer's Guide for Oracle ADF -http://download.oracle.com/docs/cd/E12839_01/web.1111/b31973/toc.htm
·         JDeveloper Discussion Forums on OTN - http://forums.oracle.com/forums/forum.jsp?forum=83

How Do I Start Learning Oracle ADF and JDeveloper 11g


There are also a number of very good books on Oracle ADF and JDeveloper.
For example




ADF Training and Samples Link:


ADF Load Testing White Paper:


Building a dependent list of values Vedio :

Developer’s Guide

Developer’s Guide is a PDFs file:

1- Web User Interface Developer’s Guide.
2- Fusion Developer's Guide for Model layer.
3- Desktop Integration Developer's Guide.
4- Mobile Browser Client Developer's Guide.
5- Administrator's Developer's Guide.

You can find them in Oracle JDeveloper Documentation in
http://www.oracle.com/technology/documentation/jdev.html

 JDeveloper and ADF forum
http://forums.oracle.com/forums/forum.jspa?forumID=83

In this forum you can ask any question or answer any asked question (but first you should have an account in oracle web site).

 JDeveloper & ADF Blogs
- http://wiki.oracle.com/page/ADF+Blogs

This blogs one of the main references to learn oracle ADF which has a solution or a work around for any issue in ADF.

This is some of the great blogs:

1- http://sameh-nassar.blogspot.com/ :)
2- http://andrejusb-samples.blogspot.com/
3- http://andrejusb.blogspot.com/
4- http://blogs.oracle.com/shay/
5- http://frank.thepeninsulasedge.com/

- Searchable JDev/ADF Blog repository: Added by Shay as state in his comment

http://www.connotea.org/user/jdeveloper

Sunday, April 3, 2011

Floating Footer page layout in ADF


There was a request from a friend about a typical page layout this morning. In a page, there is the usual header, center area and the footer. The header and footer are of fixed height and the center is of variable height.


The requirement is: if the center area contain too many components, the footer should slide down. But if the centre area doesn't contain anything, the footer shouldnot squeeze into the header, it should stay at the bottom of the page.

For example, lets say the browser height is of 700px and both the header and footer are of 100px each. So now lets say the center area is of 800px, then a scrollbar appears on the page. But if the center is of only 300px,(making the whole content to be of 100+100+300=500px), then the footer should not come up towards the middle of the page, it should stay at the end of the page and the center area should show all its contents with the required space towards the end.

Solution: After wasting some time on a panelStretchLayout, i decided to go with the panelBorderLayout and some javascript. I am using a trick here to insert a spacer on the "start" facet of the panelBorderLayout. This spacer height is set using javascript on load of the page to get the required height of the center area when there are fewer components.
Below is the jspx source:
<?xml version='1.0' encoding='UTF-8'?>
<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">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="d1">
  <af:clientListener method="onDocLoad" type="load"/>
  <af:form id="f1">
    <af:panelGroupLayout id="pgl1" halign="left" valign="top"
                         layout="scroll">
      <af:panelBorderLayout id="pbl1">
        <f:facet name="start">
          <af:spacer width="10" height="10" id="dch1"
                     clientComponent="true"/>
        </f:facet>
        <f:facet name="bottom">
          <af:panelGroupLayout id="panelGroupLayout2" halign="left"
                               valign="top" layout="vertical"
                               inlineStyle="border-color:Black; border-width:2px; border-style:solid; height:100.0px;"/>
        </f:facet>
        <f:facet name="end"/>
        <f:facet name="top">
          <af:panelGroupLayout id="panelGroupLayout1" halign="left"
                               valign="top" layout="vertical"
                               inlineStyle="border-color:Black; border-width:2px; border-style:solid; height:100.0px;"/>
        </f:facet>
        <af:panelGroupLayout id="pgl2" layout="vertical" halign="left"
                             valign="top">
          <af:commandButton text="commandButton 1" id="cb1"/>
        </af:panelGroupLayout>
      </af:panelBorderLayout>
    </af:panelGroupLayout>
  </af:form>
  <af:resource type="javascript">
    function onDocLoad(){
      var defScrWidthComp = document.getElementById('dch1');
      var h = getWindowHeight();
      h = parseInt(parseInt(h) - parseInt(200));
      defScrWidthComp.style.height = h+'px';
    }

    function getWindowHeight() {
      var myHeight = 0;
      if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myHeight = window.innerHeight;
      } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myHeight = document.documentElement.clientHeight;
      } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
      }
    return myHeight;
  }

  </af:resource>
</af:document>
</f:view>
</jsp:root>


Try to put some more components on the panelGrouplayout inside the panelBorderLayout to see what happens when the center area exeeds the browser height.