Posts

Showing posts from 2007

An ADF Faces ProgressIndicator Example for File Upload

Image
This post demonstrates how an ADF Faces ProgressIndicator can be used to display the progress of a file upload.

The sample application is built in JDeveloper 10.1.3.2. You can download the sample workspace from here. The workspace does not need a database connection to run.
Sample Application

The sample application consists of one page that allows the user to upload files to the server. When the upload starts, a progress indicator displays the current status of the upload operation. The uploaded files are not stored anywhere.
Controlling the progressIndicator
<f:view> <afh:html> <afh:head title="FileUpload"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/> <afh:script source="progressIndicator.js"/> </afh:head> <afh:body onload="deactivateProgressIndicators();"> <af:messages/> <af:form usesUpload="true"> <af:inputHidden id="fileUploadSt…

A Custom ShowDetailFrame that does not require a WebCenter License

Image
This post demonstrates a custom showDetailFrame that is built using regular ADF Faces components. Hence no additional license is needed to use it. (You need a WebCenter license if you use the new showDetailFrame component. The issue is explained in this OTN thread )

The sample application is built in 10.1.3.2. It does not require a database connection to run. You can download the workspace from here.
Sample Application

The application contains a page built with custom ShowDetailFrame and another page built with the original component.
Custom ShowDetailFrameOriginal ShowDetailFrame
Below is the JSP and the JavaScript code of the custom showDetailFrame.
<f:view> <afh:html> <afh:head title="Show Custom Detail Frame"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/> <script type="text/javascript" src="customFrame.js"></script> </afh:head> <afh:body onload="onLoad();&…

A Programmatic SelectOneChoice Example

Image
This sample application demonstrates how to add/delete selectitems in a selectOneChoice component programmatically. The JDeveloper 10.1.3.2 workspace can be downloaded from here. The sample application does not need a database connection to run.Sample Application

The application displays a list box and an input field. The user can add new items to the list box by typing a new value to the input field and clicking the “Add Item to List” button. Pressing the “Remove Selected Item From List” button will remove the current selected value from the list box.Below is the source code for the JSP Page and the managed bean used to provide the functionality.<h:panelGrid columns="2" cellpadding="10" cellspacing="15">
<af:inputText label="New Item Name"
binding="#{MyTestBean.newItemNameComponent}"/>

<af:selectOneChoice label="List"
binding="#{MyTestBean.myTestListComponent}"&…

Online Diagram Drawing

This post demonstrates a simple online diagramming tool developed with FLEX. You can download the FLEX Project from here.

FLEX and other RIA technologies such as Laszlo enable us to develop online diagramming /drawing tools that are just as rich as their desktop counterparts.

Currently, we are building an online survey tool that lets its users specify the flow of a survey in a diagram. The sample application below is a small subset of this diagramming tool.

Filtering Nodes in an ADF Faces Tree Component

Image
This post describes a method to filter nodes in an ADF Faces Tree. You can download the sample application from here. The application is developed in JDeveloper 10.1.3.2.0 and requires a connection to the HR schema.Sample Application

In the sample application, Regions are the root nodes of the tree. Countries appear as child nodes under the Region they belong.

Each Region node in the tree has an inputText component. The value entered into the inputText is used to filter the countries in the Region.Building the Sample Application

Please refer to the post “ADF Faces Tree Example” in this blog for more information on how to build a JSF page with an ADF Faces Tree Component.

Once you create your page with the tree component follow the steps below to implement the filter functionality.Create a HashMap object and its accessor methods in the ApplicationModuleImpl class. This object is going to store the Region-Filter Value pairs entered by the user.private HashMap filters = new HashMap();

public …

Referencing processScope values for Back button compatibility

Image
Events initiated by JSF Components placed inside a switcher tag might be overlooked by the framework, if the scope of the value referenced in the facetName attribute of the switcher is not set correctly.

In this post, we are going to demonstrate how to use the ADF processScope to solve this problem.

You can download the sample application from here. The application is a JDeveloper 10.1.3.2 workspace. It does not need a database connection to run.

Sample Application

The sample application contains 3 pages. Each page attempts to perform the same tasks.

“Button 1” is displayed when the application is run the first time. Clicking “Button 1” hides it and displays “Button 2” with a timestamp (System.currentTimeInMilis()) next to it, indicating the time the “Button 1” is pressed.

Pressing “Button 2” performs a similar action; “Button 2” is hidden and only a timestamp is displayed, showing the time “Button 2” is pressed.


All three pages utilize the same bean, named MyBean, to provide their func…

Using FLEX in ADF / JSF Applications

Image
JDeveloper 11g is going to introduce JSF components with built-in rich client capabilities. However 11g is not out yet. This does not mean that you cannot incorporate rich client components to your application today. One of the alternatives is to embed FLEX components into ADF/JSF applications. (FLEX is a Rich Internet Application technology developed by Adobe)
In this post we are going to demonstrate how to achieve this.

The sample application is fairly straightforward. It contains two input boxes, and two buttons. One of the input boxes is implemented in JSF and the other in FLEX. The application which is a JDeveloper 10.1.3.1 workspace, demonstrates how these two components can pass information to each other. Communication between the two technologies is a critical requirement if both technologies are used in the same application. There are two buttons on the screen to start the communication between the two input boxes. The “from JSF to FLEX” button assigns the value of the JSF Comp…

ADF Faces Tree Component Example

Image
There are a number of questions on OTN regarding the Tree Component. We hope this post will be helpful in answering some of them.

You can download the sample application from here. The application is developed in JDeveloper 10.1.3.1.0 and uses the HR schema.

The sample application contains four simple examples on how to use the ADF Faces tree component;

1) How to set the focus of the tree to the node that is clicked.

2) How to detect the type of the node that is clicked.

3) How to use the polymorphic restriction functionality.

4) How to change the tree state in a managed bean.


Sample Application

The application contains a tree that is showing the regions, countries and locations in a hierarchical order.



Polymorphic Restriction
This hierarchy is altered only for the Americas region to showcase the polymorphic restriction capability of the tree binding. Polymorphic Restriction is used if the nodes from the same Data Collection Definition should have different child nodes. In the sample tr…