Shay Shmeltzer
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.
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
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.
<span id="XinhaEditingPostion"></span>
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.
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"/>
Working with the Sunburst ADF Component
JDeveloper 11.1.1.7 just hit the streets and among the new features it contains are several new data visualization ADF Faces components including timeline, treemap, and sunburst.
I got to play with the sunburst component a while back while building some internal demos - so I thought I'll provide a quick overview of some of the things you can do with it, and how to work with it at design time.
The sunburst component is used to visually show numerical data along one or two axises relating to something. One axis of data will show as the size of slices and the other data will show as a color. You can think about it as a two axis pie chart. The sunburst also allow for drilling into detail levels.
In the below example I'm showing just one set of data that has to do with the total orders broken in several levels - region->country->customer.
So here is the demo:
For those interested in the actual JSF code it is below:
<dvt:sunburst id="s1" value="#{bindings.RegionSales1.treeModel}"
var="row" animationOnDataChange="alphaFade"
animationOnDisplay="fan" displayLevelsChildren="0"
styleClass="AFStretchWidth"
inlineStyle="height:620.0px;" legendSource="ag1"
colorLabel="Sales">
<af:switcher facetName="#{row.hierTypeBinding.name}" id="s2">
<f:facet name="RegionSales10">
<dvt:sunburstNode value="#{row.Total}" label="#{row.Name}"
id="sn3" drilling="insert">
<dvt:attributeGroups id="ag1" value="#{row.Total}"
label="#{row.Total}" type="color"
attributeType="continuous" minValue="0"
maxValue="3000000" minLabel="0"
maxLabel="3M">
<f:attribute name="color1" value="11AA55"/>
<f:attribute name="color2" value="44BB77"/>
<f:attribute name="color3" value="77DD99"/>
</dvt:attributeGroups>
</dvt:sunburstNode>
</f:facet>
<f:facet name="RegionSales11">
<dvt:sunburstNode value="#{row.Total}" label="#{row.Country}"
id="sn1" drilling="insert">
<dvt:attributeGroups id="ag2" value="#{row.Total}"
label="#{row.Total}" type="color"
attributeType="continuous" minValue="0"
maxValue="2800000" minLabel="0"
maxLabel="2.8M">
<f:attribute name="color1" value="11AA55"/>
<f:attribute name="color2" value="44BB77"/>
<f:attribute name="color3" value="77DD99"/>
</dvt:attributeGroups>
</dvt:sunburstNode>
</f:facet>
<f:facet name="RegionSales12">
<dvt:sunburstNode value="#{row.Total}" label="#{row.Name1}"
id="sn2" drilling="insertAndReplace"/>
</f:facet>
</af:switcher>
</dvt:sunburst>
Search Oracle ADF Blogs with a New JDeveloper Extension
With so many developers out there working with Oracle JDeveloper and Oracle ADF there is a lot of excellent technical content published about JDeveloper and ADF in blogs and other places on the net. But how do you find the information that is relevant for you? How do you track down the entry that will solve your specific ADF question?
Well we at the JDeveloper product management team have been hard at work over the past years tracking and tagging every blog entry that we found. This resulted in a repository that had close to 4,000 how-to's about Oracle ADF - all indexed and searchable with keywords.
However the site that hosted this repository (connotea) is closing, so we took the repository and moved it to a new location. In the process we cleaned it up, removed some non-working URLs, and fixed others, and did some cleaning on tagging as well.
The new repository is now live here : https://pinboard.in/u:OracleADF/
Note that you can sign up for the rss feed of this site to get notified when new blogs are being posted. Or if you prefer you can just track the same feed through our twitter account at http://twitter.com/JDeveloper
In parallel I created a small extension that will allow you to also search the repository and show the results for a keyword directly inside JDeveloper.
You can download this extension through help check for update. Or directly here.
If you want to improve this extension or learn how to build your own extension - you can get the workspace/project source code here.
Here is a small video showing how to use this extension.


