Wednesday, April 28, 2010

A new version of JDeveloper is out: JDeveloper (Build 5660)

A new version of JDeveloper is out: JDeveloper (Build 5660)
You can download it from OTN.
New features and bugs fixed list is available [Here]

It is mostly a bug fixing release.
some bugs reported as fixed seems to be related to bugs of this blog:




I will walk through the bugs reported till now and try to reproduce them in new release and i will post a list of fixed and still reproduced bugs

Wednesday, April 21, 2010

Inserting new rows as last row of table

By Default when you add a new row on table (or view object) it is added before the current selected row.

End user requirement was that when we press Insert the new row should be added as last row no matter which is the current row.

This is implemented by overriding the View Object method insert(row).
* Insert new Rows at the end of RowSet.
* @param row
public void insertRow(Row row) {
//go to the end of Rowset if it has rows
Row lastRow = this.last();
if (lastRow != null) {
//insert new row at the end and make it current
int indx = this.getRangeIndexOf(lastRow) + 1;
this.insertRowAtRangeIndex(indx, row);
} else { // empty Rowset

Note: This could cose performance issue when inserting new rows on very large tables.

Don’t forget in table components to always set displayRow="selected" so that the new row to be visible no matter how many rows there are.

Test Case:

Friday, April 16, 2010

Auto Submit does not set the value in bindings if you navigate with mouse (Fixed in

Auto Submit does not set the value in bindings if you navigate with mouse.

You can test that by debuging an input field by typing a value and go to an other field using mouse, the setter of the field is not called. Yet the value change listener is invoked.

This causes problem in dependent components also since they will be recalculated with the old value.

For example in dependent LOV by navigating away from the dependant field with the mouse it does not cause the LOV to re-execute with the new value so you may have validation error even if the value of LOV field is correct, or you may have wrong filter in LOV.

Test Case:

The workaround we use in such cases is since the value change listener of DepartmentId is invoked to explicity set also the binding field value there. Like:

ADFUtils.setBoundAttributeValue("DepartmentId", valueChangeEvent.getNewValue());

Monday, April 12, 2010

Unique Key Validator on Entity does not work correctly

Unique Key Validator on Entity does not work correctly. Even if you have valid data in your entities, since it checks also database values it shows validation error.
Also after that in table components validations messages does not show after a refresh of browser, data change automatically to database values without showing an error.

For example in simple department Entity i create an alternative Key for DepartmentName to be unique.

Then i add an entity Unique Key Validation for this key:

I run a page with departments table and i create 2 departments
1 Dep1
2 Dep2

If i change department 1 name to dep2 then i correctly get the validation error:

But if i change department 2 to dep1 then i get unique validation errors even if both values in entities would be unique.

This could be logical for the developer since he knows that each row is validated seperately but not for the user.

Also if i refresh page in browser then if i do the same thing i dont get validation errors.
If i commit new values are not saved and database values are displayed back.

Is this working as expected?
Test Case:

Tuesday, April 6, 2010

Type Map change corrupt project metadata.

According to Type Map description :For an application running against an Oracle database, you can usually accept the default. Note: You can select the type map only when you first initialize your business components project.

Yet the developer still can change it at any time. At first it shows disabled but if you click something else and click Bussiness Components tab again then you can change it.

If you change it to java, then Entity attributes are generated with types like (BigDecimal instead of oracle.domain.Number, java.sql.Date instead of oracle.domain.Date)
If you change them to oracle types then at some adf components you get ClassCastExceptions.

If you try to chance Type Map to ‘Oracle’ again then you cannot. Even though it shows in project properties changed if you close and re-open it is still ‘Java’.

The only way to change it back to ‘Oracle’ is to open .jpx project file and to manually remove the xml entry --Attr Name="_jbo.TypeMapEntries" Value="Java" –