Tuesday, May 14, 2013

(Automatic) Partial Page Rendering across Taskflows

One of the great features of ADF is the easy out-of-the-box support for Partial Page Rendering (PPR) using the partialTriggers, autoSubmit and partialSubmit properties. And when things get a bit more complex there is a very easy API to do it programmatically. But what if

  • you don’t know beforehand what attribute or column will change, or
  • you don’t want to replicate this “Model logic” in the View layer (e.g. because you want to adhere to the Model-View-Controller pattern), or
  • components are scattered across Taskflows (in which case you cannot use the declarative support and the programmatic approach is suddenly very hard)?

Fortunately, ADF has a solution: Automatic Partial Page Rendering (or Auto PPR). If you have used ADF with Business Components, you might have seen or used it already, but it is less obvious that you can also use it with ordinary Beans or Bean DataControls.

Friday, December 21, 2012

Continuous Scrolling in ADF Tables

One of the more promising patterns in Web UI development is Continuous Scrolling. Popular sites such as Twitter and Facebook use it. With Continuous Scrolling, new data is automatically retrieved as the user has scrolled to the bottom of the page.

I recently discovered that this is already a (not so well-known) feature for the af:table component in ADF 11g! And it is so very easy to implement! Simply set RowCountThreshold="-1" on your iterator in your bindings. Done!

Coincidentally it also helps performance, because now the table doesn’t need to know the exact number of rows that are available, it will discover new rows when the user scrolls to the bottom of the page. This means that getEstimatedRowCount() will not be called anymore. This might save you another query to the database. You should try it sometime.

(this post originally appeared on the AMIS Technology blog)

Monday, May 28, 2012

Google-like Search and LOVs using Oracle Text and ViewCriteria

Do you know the Google Advanced Search page? Very few people have ever seen the page, let alone used it. Now, why is that? It is simply because the "normal" single-field quick-search (that what we normally just call Google) is so incredibly effective.

OK, that's nice, but how can we create a Google-like search experience in ADF? I created a simple sample application that contains Google-like quick-search and LOVs (using Oracle Text). You will find the application below, including a step-by-step guide how to reproduce it.

Wednesday, March 7, 2012

Extending the Groovy support in ADF BC

If you have worked with ADF Business Components in ADF 11g, chances are you have used the very powerful Groovy support. Perhaps you used it to create an entity validation rule, as a default value for a (transient) attribute or to calculate the value of a bind variable, etc. As part of this Groovy Support you get a number of aggregate functions that are not available in "normal Java-code". See this whitepaper or the chapter on Groovy support in the ADF developers guide. This post describes how to expose (comparable, but slightly more powerful) aggregate functions to Java code.

Wednesday, December 1, 2010

Calling a database procedure with table input and output parameters from Java

In my previous blog post I explained how to call a database procedure using only a few lines of Java code. I already hinted that it is possible to use custom types and tables, etc. Let's see an example of that in more detail.

Wednesday, November 24, 2010

Calling an Oracle database procedure from Java with only ONE line of code

About a year ago I was working on an ADF application for one of our clients. One of the problems they faced was that they needed to call a lot of database procedures. It is not very hard to call a database procedure if you are familiar with the JDBC API, but somehow they were able to mess it up. And even if you do it right, you have to write quite a few lines of Java code for one database procedure call. How can we simplify this?

Wouldn't it be nice if you could copy the specification of a PL/SQL procedure or function and then... just call it? That is exactly how my DatabaseProcedure class works.