Monday Nov 30, 2015

Developing with Oracle MAF and Oracle ADF Business Components - The REST Edition

When Oracle ADF Mobile was released over 3 years ago, one of the first blogs I created on this topic showed how to leverage Oracle ADF Business Components to access a server database and create a mobile front end on top of it.

Since then both frameworks have matured, and we learned some best practices doing implementations internally and for customers. Today I'm going to show you a better way to build this type of applications, specifically leveraging REST as the communication protocol between the ADF backend and the Oracle MAF front end. REST based integration performs much better than SOAP for this mobile scenario, and as you'll see development is as simple.

Specifically I'm leveraging the Oracle A-Team Mobile Persistence Accelerator (AMPA) JDeveloper Extension- this extension simplifies MAF's interacting with REST backends, and has some cool extra features if your  REST services are based on ADF BC.

I used JDeveloper 12.2.1 to expose REST services from my ADF Business Components.  If you are not familiar with how to do that, see this blog on exposing ADF BC as REST services, and then this blog about enabling CORS for ADF Business Components.

The video below picks up the same application (Application14) and continues from where the previous two ended. 

Now let's see the MAF development part:

As you can see, it is quite easy to create your MAF UI. The AMPA extension does a lot of work for you making the access to the REST backend as easy as possible. (thanks goes out to Steven Davelaar).

The AMPA extension can also generate a complete UI for you - so you can give that wizard a try to if you are  looking for even more productivity. 

Wednesday Apr 22, 2015

Dynamically refresh a part of a page (PPR) in Oracle MAF

A common question for developers who are just starting with Oracle MAF, especially if they have a background in Oracle ADF, is how do you do a partial page refresh in Oracle MAF.

Partial Page Refresh basically means that I want to change something in my UI based on another event in the UI - for example hide or show a section of the page. (In ADF there is a partialTrigger property for components which is not there in MAF).

In MAF the UI behaves differently - it is not based on JSF after all - the UI directly reflects changes in managed beans as long as it knows about changes there. How does it know about changes? For this you need to enable firing change event notifications. This is actually quite easy to do - just turn on the checkbox in JDeveloper's accessors generation and it will do the job for you.

Here is a quick demo showing you how to achieve  this:

Here is the code used.

in AMX page:

     <amx:tableLayout id="tl1">

      <amx:rowLayout id="rl1">

        <amx:cellFormat id="cf2">

          <amx:listView var="row" showMoreStrategy="autoScroll" bufferStrategy="viewport" id="lv1">

            <amx:listItem id="li1">

              <amx:outputText value="ListItem Text" id="ot2"/>

              <amx:setPropertyListener id="spl1" from="#{'true'}" to="#{viewScope.backingPPR.showIt}"


              <amx:setPropertyListener id="spl2" from="#{'false'}" to="#{viewScope.backingPPR.showIt}"






      <amx:rowLayout id="rl2" rendered="#{viewScope.backingPPR.showIt}">

        <amx:cellFormat id="cf1">

          <amx:commandButton text="commandButton1" id="cb3"/>




in managed bean:

     boolean showIt = false;

    public void setShowIt(boolean showIt) {

        boolean oldShowIt = this.showIt;

        this.showIt = showIt;

        propertyChangeSupport.firePropertyChange("showIt", oldShowIt, showIt);


    public boolean isShowIt() {

        return showIt;


    public void addPropertyChangeListener(PropertyChangeListener l) {



    public void removePropertyChangeListener(PropertyChangeListener l) {



Friday Jan 30, 2015

Getting started with iOS development using Eclipse and Java

Want to use Eclipse to build an on-device mobile application that runs on iOS devices (iPhones and iPads)?

No problem - here is a step by step demo on how to do this:

Oh, and by the way the same app will function also on Android without any changes to the code :-)  

This is an extract from an online seminar that I recorded for one of Oracle's Virtual Technology Summits - and I figured people who didn't sign up for that event might still benefit from having access to the demo part of the video.

In the demo I show how to build an on-device app that access local data as well as remote data through web services, and how easy it is to integrate device features too.

If you want to try this on your own, get a copy of the Oracle Enterprise Pack for Eclipse, and follow the setup steps in the tutorial here.

And then just follow the video steps.

The location of the web service I accessed is at:

And the Java classes I use to simulate local data are  here.

Friday Aug 08, 2014

Required Field Validation in Oracle MAF

A short entry to explain how to do field validation in Oracle MAF. As an example let's suppose you want a field to have a value before someone clicks to do an operation.

To do that you can set the field's attribute for required and "show required" like this:

  <amx:inputText label="label1" id="it1" required="true" showRequired="true"/>

 Now if you run your page, leave the field empty and click a button that navigates to another page, you'll notice that there was no indication of an error. This is because you didn't tell the AMX page to actually do a validation. 

 To add validation you use an amx:validationGroup tag that will surround the fields you want to validate.

For example:

     <amx:validationGroup id="vg1">

    <amx:inputText label="label1" id="it1" required="true" showRequired="true"/>


Then you can add a amx:validateOperation tag to the button that does navigation and tell it to validate the group you defined before (vg1 in our example).

       <amx:commandButton id="cb2" text="go" action="gothere">

        <amx:validationBehavior id="vb1" group="vg1"/>


Now when you run the page and try to navigate you'll get your validation error.


I'm a Director of Product Management for Oracle's Cloud Development Tools and Frameworks.
Follow me:

« May 2016