Monday, November 30, 2009

Issues after migrating our application from jdeveloper 11.1.1.1.0 to 11.1.1.2.0

1. In windows XP pro, when the integrated weblogic is running we get the following exception about adrci.exe . Yet after that everything seems to be working ok.


2. We call many task Flows by url, in order to open them in new window. After migration they gave 403 error.

There is a new property added in Task Flows definition URL invoke that we needed to set it to url-invoke-allowed in all task flows called like that.

The only documentation I found about that is in

15.6.4 How to Call a Bounded Task Flow Using a URL

…The default value (calculated) allows a URL to invoke the bounded task flow if the bounded task flow does not specify an initializer and it has a view activity as its default activity. If the bounded task flow does not meet these conditions, a HTTP 403 status code is returned…

Yet even though we had no initializer and we had default activity we still got HTTP 403 and had to change to url-invoke-allowed

3. We have many tables that have check box based on a view object Boolean attribute. After migration the attribute value was always set to null no matter checked or unchecked.

The workaround was to remove in view objects from those attributes the control type ‘check box’ as Tilemahos in oracle forums found

http://forums.oracle.com/forums/thread.jspa?threadID=985720&tstart=30

Test case
http://adfbugs.googlecode.com/files/TestCheckBox.zip



Saturday, November 28, 2009

ActionListener and showPopupBehavior

Many times developers complain that actionListener of a button is not invocked when they add a showPopupBehavior. Yet that is not a bug.

By default showPopupBehavior the action type is Action that is a client event and does not invoke server actions. That is described in af:showPopupBehavior documentation:

The af:showPopupBehavior tag is a declarative way to show a af:popup in response to a client-side event. The client event is specified using the triggerType attribute. The "action" event is the default triggerType if one is not provided.
....

All actionListener method bindings and associated action listeners will not be invoked when the triggerType of "action" is used.

So the solution is to just set the triggerType of ShowPopupBehavior to click.



Then the actionListener and popup are invoked.



Edit 19/12/12:
As posted in the comments bellow, this is not the best possible workaround. It is more like a quick and dirty solution. With this solution even if the button is disabled the popup is still opened without the Action listener invoked.
A better solution if you need an action listener on buttons that opens a popup is not to use the showPopupBehavior but to open the popup from within the action listener by binding the popup to the managed bean and use popup.show() method.

Tuesday, November 24, 2009

Setting value programmatically on required field.

It is common requirement when you set a value in one field to also set a value to a second field.

This we usually do on setter of view object of the first field or the valueChangeListener also by adding a partialTrigger on the second field.

Yet if the second field is required and the previous value is null then nor the setter nor the valueChangeListener are invoked because of validation error.

This is because the partialTrigger is trying to refresh the second field before even submitting the first field.

Is this a bug or intended behavior?

The workaround we found is to remove partial trigger from second field and on valueChangeListener of the first field to use addPartialTarget

In the test case when you select department we want to set manager also, so in the setter of department id there is:
public void setDepartmentId(Number value) {
setAttributeInternal(DEPARTMENTID, value);
this.setManagerId(new Number(100));
}

Also managerId field is set required=true

Test case:
http://adfbugs.googlecode.com/files/TestRequired.zip

Sunday, November 22, 2009

Carousel does not make the selected row current

Carousel is a realy nice new component in jdeveloper 11 patch1
When you create a data binded carousel item it just uses an iterator and a tree model as a table.
Every item in carusel is from a diferent row of the iterator.
Yet when you select a new item the current row of the iterator is not changed.
So if you want to have other fields of the same iterator in the page or detail view objects iterators the data are not refreshed while navigating in Carousel.
I think a selectionListener as in the table component is missing.

In order to achieve the above behaviour i did the following:
I binded carouselSpinListener property to a backing bean method where
i get the carusel event NewItemKey and i find the Key of the row and i set iterator current row to the carusel selected row.
public void caruselSpin(CarouselSpinEvent event) {
List l =(List)event.getNewItemKey();
Key k = (Key)l.get(0);
DCIteratorBinding iter = getDCBindingContainer .findIteratorBinding ("DepartmentsView1Iterator");
iter.setCurrentRowWithKey(k.toStringFormat(true));


}


Now Every time you select new item in carusel the iterator has the selected row.

Test case:
http://adfbugs.googlecode.com/files/TestCarousel.zip

Sunday, November 15, 2009

Still reproduced bugs in jdeveloper patch 1

Yet there are still a lot of bugs that can reproduced in jdeveloper 11.1.1.2.0.

Those bugs are:

Attribute Validation on Input List of Values attribute
http://adfbugs.blogspot.com/2009/11/attribute-validation-on-input-list-of.html

Page Fragment Design view is messed up when using resource bundle
http://adfbugs.blogspot.com/2009/10/page-fragment-design-view-is-messed-up.html

Workaround for Page Fragment Design view when using resource bundle
http://adfbugs.blogspot.com/2009/11/workaround-for-page-fragment-design.html

Number precision and scale bug
http://adfbugs.blogspot.com/2009/10/number-precision-and-scale-bug.html

unexpected error on graph preview when security enabled
http://adfbugs.blogspot.com/2009/10/unexpected-error-on-graph-preview-when.html

Tab selection and Enable User Customization on Session bug.
http://adfbugs.blogspot.com/2009/09/tab-selection-and-enable-user.html

Unsaved changes uncommittedDataWarning bug
http://adfbugs.blogspot.com/2009/09/unsaved-changes-uncommitteddatawarning.html

ExecuteEmptyRowSet and Range Paging.
http://adfbugs.blogspot.com/2009/09/executeemptyrowset-and-range-paging.html

LOV execute query many times ***Improved but not fixed
http://adfbugs.blogspot.com/2009/08/lov-execute-query-many-times.html

Range Paging in Master Detail bug.
http://adfbugs.blogspot.com/2009/08/range-paging-in-master-detail-bug.html

Table Filter Bug
http://adfbugs.blogspot.com/2009/08/table-filter-bug.html

Af:Query bind variable bug
http://adfbugs.blogspot.com/2009/08/afquery-bind-variable-bug.html

LOV view object Tuning: 'Only up to row number' bug
http://adfbugs.blogspot.com/2009/08/lov-view-object-tuning-only-up-to-row.html

Returning from dialog to a page that has f:verbatim tag bug
http://adfbugs.blogspot.com/2009/08/returning-from-dialog-to-page-that-has.html

Range paging and Table Selected Row Bugs
http://adfbugs.blogspot.com/2009/07/range-paging-and-table-selected-row.html
*** even though related metalink bug 8673654 is marked as fixed for this version

Partial Page Rendering ChangeEventPolicy="ppr" bug.
http://adfbugs.blogspot.com/2009/07/partial-page-rendering.html

Performance Tuning, LOVs and Range Paging bug
http://adfbugs.blogspot.com/2009/07/performance-tuning-lovs-and-range.html
*** now LOV with Range paging opens but when you return value you get exception.

ADF input list of values AutoSubmit bug.
http://adfbugs.blogspot.com/2009/07/adf-input-list-of-values-autosubmit-bug.html

Query Component Required Criterion bug ( r1 Bug)
http://adfbugs.blogspot.com/2009/07/query-component-required-criterion-bug.html

Query Component Focus bug
http://adfbugs.blogspot.com/2009/07/query-component-focus-bug.html

Fixed bugs in jdeveloper patch 1

So i tried to reproduce bugs posted in this blog to the new patch 1 of jdeveloper 11.

Many on them are not reproduced any more and i consider them fixed.

Fixed bugs are:

Returning Multiple values from LOV in af:query with bind variables bug
http://adfbugs.blogspot.com/2009/11/returning-multiple-values-from-lov-in.html

No inconsistency check after any Exception during posting data
http://adfbugs.blogspot.com/2009/10/no-inconsistency-check-after-any.html

Af:Query bind variable bug
http://adfbugs.blogspot.com/2009/08/afquery-bind-variable-bug.html

Region and dialog return bug
http://adfbugs.blogspot.com/2009/08/region-and-dialog-return-bug.html

Page with Region Validations bug
http://adfbugs.blogspot.com/2009/08/page-with-region-validations-bug.html

LOV criteria bug.
http://adfbugs.blogspot.com/2009/08/lov-criteria-bug.html

Table Validations Bug.
http://adfbugs.blogspot.com/2009/08/table-validations-bug.html

Jdeveloper 11 r1 An unexpected severe error has ocurred in Jdeveloper
http://adfbugs.blogspot.com/2009/07/jdeveloper-11-r1-unexpected-severe.html

LOVs Dont return Values when there is any validation error on page
http://adfbugs.blogspot.com/2009/07/lovs-dont-return-values-when-there-is.html

JDeveloper 11 r1 Cascading LOV bugs
http://adfbugs.blogspot.com/2009/07/jdeveloper-11-r1-cascading-lov-bugs.html

Query Component Save bug
http://adfbugs.blogspot.com/2009/07/query-component-save-bug.html

Query Component validations bug
http://adfbugs.blogspot.com/2009/07/query-component-validations-bug.html

Friday, November 13, 2009

New Feature Closing a Popup can now be captured.

My first impression of patch 1 of jdeveloper11 is that it looks like a new IDE,
diferent screens for overview and for security,
diferent menus and lots of new properties.

One thing that was missing and I was complaining about in the oracle forums was the capturing of an event when a popup dialog is closed.
http://forums.oracle.com/forums/message.jspa?messageID=3898637#3898637

Now a new property in popup component popupCanceledListener solves this problem.


You can just assign a backing bean method on it and it works no mater how you close the popup (with Cancel, with 'x' button or with ESC key).


This was realy needed. Thanks oracle team for the new feature

The only little bug in this is that in design view the popup is not visible when you place it in button facet popup

Test Case
http://adfbugs.googlecode.com/files/TestPopup.zip

Wednesday, November 11, 2009

Patch set 1 of Oracle JDeveloper 11g is now available

Oracle JDeveloper 11g (11.1.1.2.0) (Build 5536) is now available for download at
http://www.oracle.com/technology/software/products/jdev/htdocs/soft11.html

I will try to reproduce all bugs posted until now in this blog and will log the results shortly.

Tuesday, November 10, 2009

returnListener from dialog page not invoke when pressing x button

In a button that opens an other page as dialog if you define a returnListener method in managed bean then when you return form dialog page by a button that has af:returnActionListener then it works fine.

But if you close the dialog page with explorer x button then return listener is not invoked!

i also noticed a worning in log:

WARNING: The application is running with the new window detect flag off. It is highly recommended that this flag be turned on to ensure proper functioning of your application when new browser windows are launched. In web.xml set the context parameter oracle.adf.view.rich.newWindowDetect.OPTIONS to 'on'.

But even when i did that there was no difference appart from no worning.

Is this a bug?

How can we ensure that when a dialog closes (no matter how) a method will be executed?

Test case:

Friday, November 6, 2009

Attribute Validation on Input List of Values attribute

If you have an attribute validation in an Entity Attribute that is used in a view object as Input List of values then validation does not work correctly.

For testing i added a simple validation in departmentId of Employees Entity that it should be less than 100:


I set departmentId as Input List of values and autosubmit.
When I run the page and i select an invalid department then the value is not set to the field and i have no validation Error


So in the page it looks that nothing have changed. But if i submit the page, the invalid value appears in department and the error message also.


So is this a bug?

The workaround we are using is to filter LOV to show only valid values to select, or to override the setter of the entity, which i do not consider as a good practice.

test case:
http://adfbugs.googlecode.com/files/TestLOVValidation.zip

Tuesday, November 3, 2009

Returning Multiple values from LOV in af:query with bind variables bug

We get nullPointerException when returning multiple values from LOV in view criteria with bind variables.

To reproduce it in EmployeesView for departmentId I added LOV that also return ManagerId.



It work fine for Forms (TestForm) and for tables(TestTable), but not for af:query with bind variables:

I created 2 view criteria with departmentId and ManagerId, 1 with bind variables and 1 with no bind variables. And 2 pages 1 for each
TestQuery1 with af:query with bind variables
TestQuery with af:query with no bind variables

When trying to select department in TestQuery1 we get:


Caused by: java.lang.NullPointerException
at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding$AdfCriterionValues.(FacesCtrlSearchBinding.java:2834)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding$AdfAttributeCriterion.(FacesCtrlSearchBinding.java:1732)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding$AdfConjunctionCriterion._loadCriterionList(FacesCtrlSearchBinding.java:2775)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding$AdfConjunctionCriterion._loadCriterionList(FacesCtrlSearchBinding.java:2725)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding$AdfConjunctionCriterion.getCriterionList(FacesCtrlSearchBinding.java:2633)
at sun.reflect.GeneratedMethodAccessor840.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)


Yet TestQuery return correctly departmentId and ManagerId.

So I guess the workaround is not to use bind variables in view criteria.

Test Case
http://adfbugs.googlecode.com/files/LOVReturn.zip

Sunday, November 1, 2009

Workaround for Page Fragment Design view when using resource bundle

Since the layout of the fragments i am working on was messed up due to bug:


I was working on the structure view and i noticed the following worning:


So i thought what will happen if i move c:set deeper inside the tree:

And then the Design view is back to normal! and no problems at runtime also.
Note: It must be above all components that use c:set.