Friday May 17, 2013

Simpler Partial Page Refresh (PPR) with Dependent Fields

This entry might seem a bit trivial, but from experience I know that sometime new features that are added to the product are not detected by developers who just continue working in the "traditional way". Well here is a quick update on such a feature - PPR:

Way back in 2009 I did a blog entry that showed how to implement partial page rendering (PPR) in ADF by setting the partialTrigger attribute of a field to depend on another.

Somewhere along the way* ADF got more advanced, and today there's a simpler way to do this without the need to define the partialTrigger property for your calculated field. Instead you just define dependency between fields in the model layer (ADF BC) and your View layer automatically handles the update to the screen. This is driven by the default use of the "ppr" mode for the ChangeEventPolicy of iterators in your page's binding layer.

Here is a quick demo that shows you how to define a calculated field that depends on the values of two other fields, and have it automatically display the value when the other fields are set.

For the record here is the bit of groovy code used in the calculated field:

if (CommissionPct != null)
{return Salary * (1+CommissionPct);}
else
return Salary

* - I'm not exactly sure in which version of JDeveloper this became the default behavior, but I just looked in 11.1.1.7 and the default changeEventPolicy is not PPR for a page - but it seems like you can change it to ppr to get it working.

Tuesday May 14, 2013

ADF Mobile Logging on Android

I posted before on how to do code level debugging in your ADF Mobile application, but sometimes debugging is an overhead and you would rather just put out some log messages that will allow you to track what's going on where.

ADF Mobile has built in support for a logging framework and it is documented in this chapter in the ADF Mobile Developer Guide.

You can use a line of code like this in your code:

Logger.getLogger(Utility.APP_LOGNAME).logp(Level.INFO, this.getClass().getName(), "Shay","We invoked the button");

Then don't forget to set the right level of logging (and possibly the log message format) in the logging.properties file under your META-INF directory.

The logging chapter in the doc, doesn't mention where to actually see the messages being logged.

One utility that you can use to see your log messages comes with the Android SDK - look into the tools directory there and you'll find the ddms.bat file - run it and you'll be able to see the log messages from your application.

On the side of that utility you can also define filters to just show you the messages you are interested in.

Here is a quick demo showing how this all works together:

By the way - a comment I got pointed out that ddms is old school and you should be using the new monitor.bat at the same locaiton. This will basically work just the same and will look like this:

 More tips on debugging and logging in this blog entry by Joe

Friday May 10, 2013

Simpler Development with the new List ADF Faces component in 11.1.1.7

A new component that showed up in the JDeveloper 11.1.1.7 release is the af:listView component. This component will become more and more popular as more people target tablet devices with ADF Faces UI. The component allows you to create a scrollable list from a collection of data, and it also does fetching with ranges so you don't get too much network traffic. If you ever used a contacts list on a smart phone you'll recognize the list view source of inspiration - check out the runtime demo of the component here.

The component was actually backported into 11.1.1.7 from the 12c version - and while in the 12c version of JDeveloper there is better design time support for adding and binding a listview to a page, in the current release the work will mostly be manual.

However, for the lazy developer there are some shortcuts you can take to create the list component faster.

Here is a short video that shows you how to leverage an existing table component on your page to make the creation of the list component easier and with more functionality.

Thursday May 09, 2013

Improved Dial Gauge in Oracle ADF Mobile 11.1.2.4

The dial gauge is a very visual way to show data in an application - and it has been there in Oracle ADF Mobile since 11.1.2. However in that release you could only use a range of 0-100 - well now you can do better with the new ADF Mobile version.

But there is one little trick to how this works compared to the way it works in the regular web ADF Faces gauge component, and if you don't notice it you might think you are still stuck in the 0-100 days - The trick is the new background property.

If you are working in the property inspector you can right-click in the property to see explanation and the available values.

Or if you work in the code editor just use the code insight to choose the value you want.

For defining your own range you'll want to use the costum options.

Then you can get something that looks like these:

Also note that you can control the indicator type with the indicator property.

<dvtm:dialGauge background="circleAntiqueCustom" indicator="needleLight" value="7000" minValue="4000" maxValue="9000"/>

Happy visualization.

Friday May 03, 2013

Star Rating in ADF Mobile Applications

The new Oracle JDeveloper 11.1.2.4 just went out with a bunch of new features for ADF Mobile developers. Read more about it here - or watch this video.

One small feature that somehow got left out from the above two links is that there is a new UI component offered in ADF Mobile now - Star Rating.

The official tag name is dvtm:ratingGauge - and you can find it in the DVT Mobile AMX component palette under the Gauge section.

You can configure how many stars you want to show for your rating in the data section of the property inspector, and you can even specify to advance in half steps.

The component supports multiple shapes that you can choose from - star, diamond, circle, rectangle

You can also specify a different shape to be displayed for the unselected spots.

The code for the above 3 components is:
      <dvtm:ratingGauge id="ratingGauge1" value="2.5" maxValue="3" shape="circle"/>
      <dvtm:ratingGauge id="ratingGauge2" unselectedShape="dot" inputIncrement="half"/>
      <dvtm:ratingGauge id="ratingGauge3" shape="diamond"/>

About

me
I'm a Director of Product Management for the Oracle Java Development Tools.
Follow me:
Search

Archives
« May 2013 »
SunMonTueWedThuFriSat
   
1
2
4
5
6
7
8
11
12
13
15
16
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
       
Today