Frank Nimphius' Blogbuster http://thepeninsulasedge.com/frank_nimphius About Oracle JDeveloper, Oracle ADF, ADF Faces, ADF Swing, J2EE Security and Oracle Forms Tue, 22 Jul 2008 09:44:29 +0000 http://wordpress.org/?v=2.0.2 en ADF Faces RC: How-to pass additional arguments to a JavaScript function using the af:clientAttribute element http://thepeninsulasedge.com/frank_nimphius/2008/07/22/adf-faces-rc-how-to-pass-additional-arguments-to-a-javascript-function-using-the-afclientattribute-element/ http://thepeninsulasedge.com/frank_nimphius/2008/07/22/adf-faces-rc-how-to-pass-additional-arguments-to-a-javascript-function-using-the-afclientattribute-element/#comments Tue, 22 Jul 2008 09:41:43 +0000 frank.nimphius ADF Faces RC http://thepeninsulasedge.com/frank_nimphius/2008/07/22/adf-faces-rc-how-to-pass-additional-arguments-to-a-javascript-function-using-the-afclientattribute-element/ In JDeveloper 11, JavaScript events like onClick, onFocus etc. are handled through the ADF Faces RC client framework using the af:clientListener component. The signature of the af:clientListener is defined such that the developer provides the name of a method to call and the JavaScript event to trigger this method call. The clientListener signature however doesn’t foresee a mechanism for the developer to pass additional arguments - like a rowKey - to the JavaScript method. Here client attributes come to the rescue.

[Read More]

]]>
http://thepeninsulasedge.com/frank_nimphius/2008/07/22/adf-faces-rc-how-to-pass-additional-arguments-to-a-javascript-function-using-the-afclientattribute-element/feed/
How-to build a reusable Glasspane in ADF Faces RC http://thepeninsulasedge.com/frank_nimphius/2008/07/15/how-to-build-a-reusable-glasspane-in-adf-faces-rc/ http://thepeninsulasedge.com/frank_nimphius/2008/07/15/how-to-build-a-reusable-glasspane-in-adf-faces-rc/#comments Tue, 15 Jul 2008 16:41:26 +0000 frank.nimphius Uncategorized ADF Faces RC http://thepeninsulasedge.com/frank_nimphius/2008/07/15/how-to-build-a-reusable-glasspane-in-adf-faces-rc/ Ever met a patient application user? If not, don’t worry, they just don’t exist. Users work with an application to get their job done in the shortest time possible. So clicking a button and then sit and wait for a response to show is not their kind. If an application is busy with a background process - e.g. querying the database for a complex query - then after a certain amount of waiting time, users tend to use their mouse to click somewhere in the application, just to show that they are still waiting or to force the application to come back to him. User activity like this can lead to many unwanted effects: double form submission or queued events that the user didn’t want. The only way out of this is to “disable” the user interaction for the time the background process takes. While the ADF Faces RC command button exposes a blocking property that - when set to true - prevents users from double submitting an action, it doesn’t prevent him from clicking anywhere else in the application. Users want entertainment while they wait, so ideally while blocking them from working in the application, they see something animated. A Glasspane is a transparent overlay that prevents users from interacting with a screen during the time of background processing. In ADF Faces RC there is no native Glasspane component available, like for example in Swing, but with a few on-board functionality and components, this component can be built as a declarative custom component. This how-to document explains the principles of building a reusable Glasspane component in ADF Faces RC.

[Read More]

]]>
http://thepeninsulasedge.com/frank_nimphius/2008/07/15/how-to-build-a-reusable-glasspane-in-adf-faces-rc/feed/
ADF Faces RC: How-to Conditionally Prevent Dialogs from Closing http://thepeninsulasedge.com/frank_nimphius/2008/07/01/adf-faces-rc-how-to-conditionally-prevent-dialogs-from-closing/ http://thepeninsulasedge.com/frank_nimphius/2008/07/01/adf-faces-rc-how-to-conditionally-prevent-dialogs-from-closing/#comments Tue, 01 Jul 2008 15:29:37 +0000 frank.nimphius ADF Faces RC http://thepeninsulasedge.com/frank_nimphius/2008/07/01/adf-faces-rc-how-to-conditionally-prevent-dialogs-from-closing/ ADF Faces Rich Client provides in browser popup dialogs and panels. Compared to the still existing and still good to use ADF Faces dialog framework, the popups are lightweight dialogs that have their content defined within the parent page. At runtime these popups render as DHTML dialogs on the parent page. The available categories of popups include inline selectors, dialogs, note windows and menus. A dialog component, added as the first child of af:popup, may contain buttons like ok, cancel, yes and no. Each of the buttons allow the developer to respond to the user selection in a managed bean method before the dialog is closed. And this is where this how-to comes in. How can closing a dialog made conditional ?

Read More…

Frank

]]>
http://thepeninsulasedge.com/frank_nimphius/2008/07/01/adf-faces-rc-how-to-conditionally-prevent-dialogs-from-closing/feed/
How to Access Attributes of a Declarative Component from a Managed Bean http://thepeninsulasedge.com/frank_nimphius/2008/06/26/how-to-access-attributes-of-a-declarative-component-from-a-managed-bean/ http://thepeninsulasedge.com/frank_nimphius/2008/06/26/how-to-access-attributes-of-a-declarative-component-from-a-managed-bean/#comments Thu, 26 Jun 2008 17:23:57 +0000 frank.nimphius ADF Faces RC http://thepeninsulasedge.com/frank_nimphius/2008/06/26/how-to-access-attributes-of-a-declarative-component-from-a-managed-bean/ In an earlier how-to document I explained how to build and work with declarative components in ADF such that it displays data passed from the containing page. As you would have guessed to this time already, there are more usecases to cover for declarative components. The usecase in this article describes how to access an attribute within a declarative component from a managed bean that is part of it. For example, to write a generic component that allows the containing page to pass in e.g. a download URL to process, the attribute of the declarative component doesn’t need to be bound to a UI component. This however means that developers need to find a way to access the hidden attribute programmatically - and of course there is.

[Read More]

]]>
http://thepeninsulasedge.com/frank_nimphius/2008/06/26/how-to-access-attributes-of-a-declarative-component-from-a-managed-bean/feed/
How-to find and set control hints on POJO entities in bean Data Controls http://thepeninsulasedge.com/frank_nimphius/2008/06/25/how-to-find-and-set-control-hints-on-pojo-entities-in-bean-data-controls/ http://thepeninsulasedge.com/frank_nimphius/2008/06/25/how-to-find-and-set-control-hints-on-pojo-entities-in-bean-data-controls/#comments Wed, 25 Jun 2008 15:00:35 +0000 frank.nimphius ADF http://thepeninsulasedge.com/frank_nimphius/2008/06/25/how-to-find-and-set-control-hints-on-pojo-entities-in-bean-data-controls/ A very useful feature that ADF brings to Java EE application development is the ability to specify control hints for enitities in a central place for all UI component to use. A common usecase for this are labels that appear as prompts on a web page, e.g. in a ADF Faces form layout. Users of ADF Business Components know this feature for as long as ADF Business Components is around, but users of EJB, JPA and POJO may not have tried this feature yet.

This how-to document explains how to find an entity for a given UI component and how to set its control property. Its a reverse development as usually you should define labels as soon as you created the data control. However, you will see how this can be done as well.

Read more

]]>
http://thepeninsulasedge.com/frank_nimphius/2008/06/25/how-to-find-and-set-control-hints-on-pojo-entities-in-bean-data-controls/feed/
ADF Faces: How-to use the table sort listener property to override sorts http://thepeninsulasedge.com/frank_nimphius/2008/06/11/adf-faces-how-to-use-the-table-sort-listener-property-to-override-sorts/ http://thepeninsulasedge.com/frank_nimphius/2008/06/11/adf-faces-how-to-use-the-table-sort-listener-property-to-override-sorts/#comments Wed, 11 Jun 2008 17:50:26 +0000 frank.nimphius ADF Faces http://thepeninsulasedge.com/frank_nimphius/2008/06/11/adf-faces-how-to-use-the-table-sort-listener-property-to-override-sorts/ Only a small code snippet to share, but for sure this might become handy if you need it. In ADF Faces 10.1.3 the table has a sort listener that allows you as the developer to intercept the user sort initiated by a click on the table header. You can use the sort listener to override the user sort criteria or to append to it. The following code snippet represents a managed bean with a sort listener method that changes the user sort criteria from DepartmentName to DepartmentId whenever the user tries to sort by DepartmentName.

I know, the example is not implementing a ground breaking usecase; but its the code that counts as it gets you started implementing your ow usecase

CODE:
  1. import java.util.ArrayList;
  2. import java.util.List;
  3.  
  4. import oracle.adf.view.faces.component.core.data.CoreTable;
  5. import oracle.adf.view.faces.event.SortEvent;
  6. import oracle.adf.view.faces.model.SortCriterion;
  7.  
  8.  
  9. public class Sortbean {
  10.     public Sortbean() {
  11.     }
  12.  
  13.     public void onSort(SortEvent sortEvent) {
  14.        
  15.         List sortList = sortEvent.getSortCriteria();
  16.         SortCriterion sc = (SortCriterion) sortList.get(0);
  17.        
  18.         //override sort by DepartmentName and make it sort by DepartmentId instead
  19.         if (((String)sc.getProperty()).equalsIgnoreCase("DepartmentName")){
  20.             System.out.println("You wanted to sort " +sc.getProperty());
  21.        
  22.             sortList = new ArrayList();
  23.             SortCriterion sc2 = new SortCriterion("DepartmentId",true);
  24.             System.out.println("This is what I want you to sort for "+sc2.getProperty());
  25.             sortList.add(sc2);
  26.        
  27.             CoreTable ct = (CoreTable)sortEvent.getComponent();
  28.             ct.setSortCriteria(sortList);
  29.         }
  30.     }
  31. }

Frank

]]>
http://thepeninsulasedge.com/frank_nimphius/2008/06/11/adf-faces-how-to-use-the-table-sort-listener-property-to-override-sorts/feed/
How-to build hierarchical Select Choices in ADF Faces RC http://thepeninsulasedge.com/frank_nimphius/2008/06/06/how-to-build-hierarchical-select-choices-in-adf-faces-rc/ http://thepeninsulasedge.com/frank_nimphius/2008/06/06/how-to-build-hierarchical-select-choices-in-adf-faces-rc/#comments Fri, 06 Jun 2008 18:44:02 +0000 frank.nimphius ADF Faces RC http://thepeninsulasedge.com/frank_nimphius/2008/06/06/how-to-build-hierarchical-select-choices-in-adf-faces-rc/ Apparently, in the JavaServer Faces you are able to build hierarchical select choice lists that display the list entries categorized by their parent records. For ADF Faces RC, hierarchical select choices are an enhancement request filed and wont be available in the initial production release of JDeveloper 11. However, with a bit of programming - where the emphasize clearly is on the "bit" word - you can achieve exactly the same behavior. This how-to document explains how you build hierarchical tree lists based on the Oracle Fusion stack, which is ADF Faces RC, ADF for the binding and ADF BC for the persistence layer.

Read on

Frank

]]>
http://thepeninsulasedge.com/frank_nimphius/2008/06/06/how-to-build-hierarchical-select-choices-in-adf-faces-rc/feed/
ADF Faces RC - How-to use the Client and Server Listener Component http://thepeninsulasedge.com/frank_nimphius/2008/06/04/adf-faces-rc-how-to-use-the-client-and-server-listener-component/ http://thepeninsulasedge.com/frank_nimphius/2008/06/04/adf-faces-rc-how-to-use-the-client-and-server-listener-component/#comments Wed, 04 Jun 2008 14:06:25 +0000 frank.nimphius ADF Faces RC http://thepeninsulasedge.com/frank_nimphius/2008/06/04/adf-faces-rc-how-to-use-the-client-and-server-listener-component/ One of the most interesting features in Ajax is the ability of an application to send user information to the server without user recognition. A positive use of this feature is the auto suggest feature, which provides the user with a list of possible select values based on the user input into a text field. Another positive use is auto completion of strings, in which case the user enters a shortcut into a text field e.g. "NY" for the system to complete the field with New York. This how-to document shows how this Ajax functionality is achieved in ADF Faces RC using the client and server listener component.

Read more

Frank

]]>
http://thepeninsulasedge.com/frank_nimphius/2008/06/04/adf-faces-rc-how-to-use-the-client-and-server-listener-component/feed/
ADF Faces: Building tree structures from rekursive queries in ADF BC http://thepeninsulasedge.com/frank_nimphius/2008/06/02/adf-faces-building-tree-structures-from-rekursive-queries-in-adf-bc/ http://thepeninsulasedge.com/frank_nimphius/2008/06/02/adf-faces-building-tree-structures-from-rekursive-queries-in-adf-bc/#comments Mon, 02 Jun 2008 14:41:11 +0000 frank.nimphius ADF Faces http://thepeninsulasedge.com/frank_nimphius/2008/06/02/adf-faces-building-tree-structures-from-rekursive-queries-in-adf-bc/ Another lost example: The workspace linked by this blog entry shows how to build a tree from a rekursive query in a ViewObject. You will notice that the tree model has been build manually and that this functionality isn't provided for declarative use.

Setup Instructions

Make sure you have the HR schema accessible (the workspace uses “hrconn” as a connect configuration). Also, the workspace comes without the jsf-impl.jar and adf-faces-impl.jar to reduce the download size. Both files need to be copied from the JDeveloper jsf-ri and jlib directory to the view project’s public_html/web-inf/lib directory before running the sample

Download Sample

Frank

]]>
http://thepeninsulasedge.com/frank_nimphius/2008/06/02/adf-faces-building-tree-structures-from-rekursive-queries-in-adf-bc/feed/
How-to Refresh a Bound Taskflow that is added as a Region to an ADF Faces RC Page and that is displayed in a Popup Dialog http://thepeninsulasedge.com/frank_nimphius/2008/05/29/how-to-refresh-a-bound-taskflow-that-is-added-as-a-region-to-an-adf-faces-rc-page-and-that-is-displayed-in-a-popup-dialog/ http://thepeninsulasedge.com/frank_nimphius/2008/05/29/how-to-refresh-a-bound-taskflow-that-is-added-as-a-region-to-an-adf-faces-rc-page-and-that-is-displayed-in-a-popup-dialog/#comments Thu, 29 May 2008 17:20:30 +0000 frank.nimphius ADF Faces RC ADF http://thepeninsulasedge.com/frank_nimphius/2008/05/29/how-to-refresh-a-bound-taskflow-that-is-added-as-a-region-to-an-adf-faces-rc-page-and-that-is-displayed-in-a-popup-dialog/ Every technology seems to have its superstar; a feature that developers love and use more than any other feature. Though in ADF Faces RC, there seem to be more than one super star feature, the clear winner of Oracle ADF Faces RC pop idol feature contest is a bound taskflow that is added to a page in a region that is displayed in a popup dialog on demand. The most frequent question asked on the JDeveloper help forum on OTN is how to refresh such a bound taskflow - and this indeed doesn't seem to be obvious until you have a look at the developer guide documentation.

Read on

Frank

]]>
http://thepeninsulasedge.com/frank_nimphius/2008/05/29/how-to-refresh-a-bound-taskflow-that-is-added-as-a-region-to-an-adf-faces-rc-page-and-that-is-displayed-in-a-popup-dialog/feed/