JDeveloper 11.1.1.7.0 about to go public

First signs of the new version of JDeveloper 11.1.1.7.0 are popping up on the web.
Edwin Biemond, Luc Boer and Wilfried vander Deijl posted some new features and components like code editor, new DVT components, and new SOA stuff.
I like to point out a feature we, or at least me, where waiting on for a long time:
inputFile in multi file mode

Multi File Upload in Action

Multi File Upload in Action


this comment allowed uploading multiple file at once using a nice modern looking canvas.
As there is no official download available on the official JDeveloper page at the time of writing, you can
explore the new components and features using the Component demo yourself.
This new version looks very promising. Can’t wait to install it and try out some of the new stuff like InsertTextBehavior and Code Editor, even if I’m not  sure of a use case right now.
This will be a fun Easter weekend!

UPDATE 30-03-2013:
Look like there is no GIT support bundled in this (unofficial) version JDEVADF_11.1.1.7.0_GENERIC_130226.1400.6493

Advertisements

Creating Variables and Attribute Bindings to Store Values Temporarily in the PageDef

In the last couple of weeks I often saw questions on OTN JDev & ADF Forum which I answered in a way that the problem can be solved by using a page variable to store the value e.g. from a dynamic list selection or the status of a check box.
Most users don’t use this feature which, or don’t know how to define a page variable. This post show in pictures how to do this.

Update:
It was mentioned to me that Andrejus Baranovskis did almost exactly a post like this back in 2011 (Page Definition Variables to Store Temporary Page Values). This slipped the search I did, so please take a look at Andrejus Baranovskis’s post too.

When you first create a page or a fragment there doesn’t exist a page definition file for the page:

Empty New Page

Empty New Page


If you switch to the ‘Bindings’ tab you don’t see any binding
Empty Binding

Empty Binding


The pagedef file will be created if you drag e.g. a view object from the data control onto the page or if you right click on hte page in design view and select ‘Go to Page Definition’
Create Page Def

Create Page Def


You then get this dialog which you accept with OK
Safety Dialog

Safety Dialog


Now the page def file is created. The only thing we see is the ‘variables’ in hte ‘Executables’ section
Freshly created Page Def

Freshly created Page Def


The variable iterator in the executable section is generated automatically. A quote from the docs (12.6 Working with Page Definition Files)about this iterator helps to understand how it can be used to store variables temporarily on a page:

Variable Iterator: Binds to an iterator that exposes all the variables in the binding container to the other bindings. While there is an iterator binding for each collection, there is only one variable iterator binding for all variables used on the page. (The variable iterator is like an iterator pointing to a collection that contains only one data object whose attributes are the binding container variables.)

Page variables are local to the binding container and exist only while the binding container object exists. When you use a data control method (or an operation) that requires a parameter that is to be collected from the page, JDeveloper automatically defines a variable for the parameter in the page definition file. Attribute bindings can reference the page variables.

A variable iterator can contain one of two types of variables: variable and variableUsage. A variable type variable is a simple value holder, while a variableUsage type variable is a value holder that is related to a view object’s named bind parameter. Defining a variable as a variableUsage type allows it to inherit the default value and UI control hints from the view object named bind variable to which it is bound.

Now let’s think about a use case where we can make use of the variable iterator. We can e.g. store the selection of a selectOneChoice component in a variable for later use or use a booleanCheckBox to make some other parts of the page visible.
OK, let us setup a demo page showing hoe to do this. First we define some variables in the variable iterator. We start with a Boolean variable for the checkBox to hide/show the ‘Demo Panel’.

1) right click on the variables in the executables section and choose ‘Insert Inside Variables’->’variable’

Create new Variable Inside Variable Iterator

Create new Variable Inside Variable Iterator


2) in the dialog set a name e.g. ‘toggleDisplayDemoPanel’ with type java.lang.Boolean
Define Name and Type

Define Name and Type


3) Now we define an attribute binding. Click the green ‘+’ sign in the Bindings section, select attributeValues
Add attribute Binding

Add attribute Binding


Select AttributeBinding

Select AttributeBinding


4) cklick OK to get the dialog where you select the iterator and the variable from it
Select the 'variable iterator'

Select the ‘variable iterator’


Select the Variable Name

Select the Variable Name


5) cklick OK to get the final binding
Final Binding

Final Binding


This will create a variable of type Boolean in the bindings of the page. This can be used to store the value of the booleanCheckBox component. For this select the booleanCheckBox in the page and in the property inspector we use the expression builder to set the value like we do with attributes from the data control.
In this case ‘#{bindings.toggleDisplayDemoPanel1.inputValue}’ and set the autoSubmit property to true for the checkBox
Expression Builder

Expression Builder


to show/hide the ‘Demo Panel’ we setthe same EL to the visible property of the ‘Demo Panel’ and add a partial trigger pointing to the selectBooleanCheckbox
Demo Panel

Demo Panel


Now, when we run the application
Start of Application

Start of Application


select the check box to show the panel
Showing the 'Demo Panel'

Showing the ‘Demo Panel’


One other thing we can do is to define a variable of type Integer and store the selected value of a selectOneChoice showing a dynamic lov in it. This will be shown below the selectOneChoice component. Via a button ‘Reset Selection’ the selection of the selectOneChoice can be cleared by setting the variable back to null.
Select a location from the selectOneChoice
Select a Value

Select a Value


Click the ‘Reset Selection’ button
Click 'Reset selection'

Click ‘Reset selection’


This is don without any java code by using a setPropertyListener defined on the button

        <af:commandButton text="Reset Selection" id="cb1">
          <af:setPropertyListener from="#{null}" to="#{bindings.varDepId1.inputValue}" type="action"/>
        </af:commandButton>

You can download the sample, which is using the HR DB schema, from ADF EMG Samples Project BlogVariableIterator.zip. The sample was built with JDeveloper 11.1.1.6.0

JDeveloper 11.1.1.6.0: Self Closing Popup

Based on Frank’s (Frank Nimphius) article How to auto-dismiss af:popup dialogs and the sample 105, a user on OTN JDev & ADF forum tried to get this running on JDeveloper 11.1.1.6.0. Franks sample was built using JDeveloper 11.1.2.3.0 and can’t be run without changes in JDeveloper 11.1.1.6.0.
However, it’s easily possible to build a sample using 11.1.1.6.0 showing how to use the af:poll to close a popup using an af:noteWindow or an af:dialog inside the popup. The technique is described in Frank’s article, so I spare repeating it here.
Let’s look at the running application

Running Sample

Running Sample

Clicking on the link “Show Popup NW” or the button “Popup NW” shows the location of the department in a note window

Location in Note Window

Location in Note Window

Clicking on the link “Show Popup DW” or the button “Popup DW” shows the location of the department in a dialog window (modal)

Location in Dialog

Location in Dialog

You can download the sample, which is using the HR DB schema, from ADF EMG Samples Project

UPDATE 2013-03-25:
as it turned out there is a problem with the af:poll component and the timeout setting. This timeout setting should cancel the poll component after the given period of time (which should work in 11.1.2.3). This was one key feature in Frank’s original article. Using 11.1.1.6.0 it turned out, that hte af:poll remains active even after the timeout period should have canceled any further events to the poll listener.
I implemented a fix for this behavior. The popup uses a fetch listener which sets the interval (5000 ms in the sample) and the poll listener cancel the poll by setting the interval to -1 after hiding the popup.
The code is written in a generic way to allow handling of different popups. Please download the new sample from ADF EMG Samples Project