Thursday, July 30, 2009

Range paging and Table Selected Row Bugs

In a default view object and default table in panel collection, when you scroll down and select a row and for any reason the table is submitted (button, reorder columns, detach), then the table returns to the first displayed page and the selected row was not visible.
But you could fix that if in the table properties you set displayRow="selected".
Except form the detach button that still reset the visible range to the start.

Bug1 :Yet when you set Range paging for tuning the view object the displayed (selected) row is lost many times (not always) when you submit page.


Bug2 :Also some times the selection listener of the table does not work and when you submit the previus selected row is selected


Bug3 : Last it seams that it execute many ranges in the query, not only when you scroll down, but also when you select a row.


So is this a bug?
or we should not use Range Paging in view objects used in table?

Test Case:

Tuesday, July 28, 2009

Iterating through View Object RowIterator Bug.(NOT ADF BUG, Development Bug)

The oldest bug in writing code is losing a row in an iterator.
This happens in ADF also.
I got embarrassed today saying to a developer 'RTFM' and been proven wrong. So I will first post some parts of the javadoc of RowIterrator and then a test case that proves it wrong.

When a Row Iterator is first opened or created, the currency is placed on an imaginary "slot" before the first row. This enables the user to invoke next() on a fresh new Row Iterator and retrieve the first row. For example, the following block of code will print attribute "Ename" for all employees (it does not miss the first row):
ApplicationModule myAM;
...
ViewObject myVO = myAM.findViewObject("MyEmpVO");
Row row;
while ((row = myVO.next()) != null)
{
System.out.println("Ename: " + row.getAttribute("Ename"));
}



void reset()
Moves the currency to the slot before the first row.
After this method, the current slot status will be SLOT_BEFORE_FIRST except in cases where this iterator is associated to an iterator binding in an ADF application which sets the currency to the first row in the iterator if available. A subsequent invocation of next() will cause the first row to become the current row.



So I created a View Object that only gets 3 rows and a method in application module that iterrates according to the above descriptions through the iterator and return the rows visited in a string:
public String checkIterations() {
String res = "Iterated through : ";
RowIterator view = this.getDepartmentsView1();
view.reset();
Row row;
while ((row = view.next()) != null) {
System.out.println("rownum: " + row.getAttribute("RowNum"));
res += row.getAttribute("RowNum") + " ";
}
return res;
}
When I run Application nodule and test this method, it goes through all rows as expected.


But if I open the view object (execute query) and then run this method again, the first row is never visited.


So is this a bug?

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

As my friends in the comments said its not a bug
Its a bad development practice (development bug) to do it as described above.

I should say RATFM (readh all the f... manual):

9.7.6 What You May Need to Know About Programmatic Row Set Iteration

Any time your application logic accesses a row set to perform programmatic iteration, you should use a secondary row set iterator when working with view object instances in an application module's data model, or view link accessor row sets of these view object instances, since they may be bound to user interface components.
To create a secondary iterator, use the createRowSetIterator() method on the row set you are working with. When you are done using it, call the closeRowSetIterator() method on the row set to remove the secondary iterator from memory.
Example 9-7 shows a typical application module custom method that correctly uses a secondary row set iterator for programmatic iteration, because the EmpView1 view object instance in its data model may be bound to a user interface (either now or at a later time).
Example 9-7 Using a Secondary Row Set Iterator in an Application Module Custom Method

// Custom method in an application module implementation classpublic
void doSomeCustomProcessing() {
ViewObject vo = getEmpView1();
// create secondary row set iterator with system-assigned name
RowSetIterator iter = vo.createRowSetIterator(null);
while (iter.hasNext()) {
Row r = iter.next();
// Do something with the current row.
}
// close secondary row set iterator
iter.closeRowSetIterator();}


Monday, July 27, 2009

View Criteria with Exists Optional Bug

I created a simple HR application with departments and Employees

In DepartmentsView i put query criteria, wanting departments that have Employees with old hire date.


The issue is that i want if no criterion is entered to show all departments. I thought since exist criterion is optional it should work. But no, it show anyway only departments that have Employees.


I think The solution would be easy for oracle developers if for view criteria where clause, instead of:
( (EXISTS(SELECT 1 FROM EMPLOYEES Employees WHERE ( ( ( Employees.HIRE_DATE < :inBeforeDate ) OR ( :inBeforeDate IS NULL ) ) ) AND (Departments.DEPARTMENT_ID = Employees.DEPARTMENT_ID))) )

when the exists criterion is optional to set:
( (EXISTS(SELECT 1 FROM EMPLOYEES Employees WHERE ( ( ( Employees.HIRE_DATE < :inBeforeDate ) OR ( :inBeforeDate IS NULL ) ) ) AND (Departments.DEPARTMENT_ID = Employees.DEPARTMENT_ID))) OR ( :inBeforeDate IS NULL ))

test case :

Sunday, July 26, 2009

Jdeveloper 11 r1 An unexpected severe error has ocurred in Jdeveloper

I often get this error while working on jdeveloper r1



I checked in forums and I saw that other people have it too.
http://forums.oracle.com/forums/thread.jspa?messageID=3609674&#3609674
and there is a bug 8677319 to track this issue.
But i am not sure its the same issue since i have different error log and it is not related with how much time you work with jdeveloper:
Invoking command: Insert[ from oracle.ide.ceditor.CodeEditor ]oracle.adfdtinternal.view.rich.binding.addin.PageToPageDefinitionSyncModelListener$SyncRunnable$1:26-Jul-2009 13:23:20 oracle.javatools.logging.LogUtils logWARNING: Exception in task oracle.adfdtinternal.view.rich.binding.addin.PageToPageDefinitionSyncModelListener$SyncRunnable$1@1e5a4d4 on model oracle.adfdtinternal.model.ide.navigator.nodes.PageDefinitionXmlModel@191c28b; txn name=non-dom transaction: oracle.adfdtinternal.view.rich.binding.addin.PageToPageDefinitionSyncModelListener$SyncRunnable$1 org.w3c.dom.DOMException: Not selection document:oracle.xml.parser.v2.XMLDocument@1f9ee33 at oracle.bali.xml.model.Selection.checkValidNode(Selection.java:572) at oracle.bali.xml.model.Selection.add(Selection.java:321) at oracle.bali.xml.model.Selection.set(Selection.java:287) at oracle.adfdtinternal.view.rich.binding.addin.PageToPageDefinitionSyncModelListener$SyncRunnable$1.performTask(PageToPageDefinitionSyncModelListener.java:118) at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:172) at oracle.bali.xml.model.task.StandardTransactionTask.run(StandardTransactionTask.java:103) at oracle.adfdtinternal.view.rich.binding.addin.PageToPageDefinitionSyncModelListener$SyncRunnable.run(PageToPageDefinitionSyncModelListener.java:113) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Uncaught exceptionorg.w3c.dom.DOMException: Not selection document:oracle.xml.parser.v2.XMLDocument@1f9ee33 o.bali.xml.model.Selection.checkValidNode(Selection.java:572) o.bali.xml.model.Selection.add(Selection.java:321) o.bali.xml.model.Selection.set(Selection.java:287) o.adfdtinternal.view.rich.binding.addin.PageToPageDefinitionSyncModelListener$SyncRunnable$1.performTask(PageToPageDefinitionSyncModelListener.java:118) o.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:172) o.bali.xml.model.task.StandardTransactionTask.run(StandardTransactionTask.java:103) o.adfdtinternal.view.rich.binding.addin.PageToPageDefinitionSyncModelListener$SyncRunnable.run(PageToPageDefinitionSyncModelListener.java:113) j.a.event.InvocationEvent.dispatch(InvocationEvent.java:209) j.a.EventQueue.dispatchEvent(EventQueue.java:597) j.a.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) j.a.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) j.a.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) j.a.EventDispatchThread.run(EventDispatchThread.java:122)


I manage to reproduce it in the same simple test case of previous post
http://adfbugs.googlecode.com/files/TestPPR.zip

The steps to reproduce it are:
Open TestPPR.jspx in source view
Open TestPPRPageDef.xml in source view
make any change in TestPPRPageDef.xml (i.e. id="Next" to id="Next1")
Go to TestPPR.jspx and click on diferent places of code
the error will appear then
I hope this help to solve this bug.

Friday, July 24, 2009

Partial Page Rendering ChangeEventPolicy="ppr" bug. (Fixed in 11.1.2)

While working on previews application I noticed something else.

Suddenly the result table in query page started to refresh every time I selected a row.

Also when I had scroll down in the results and selected a row the visible range whas returned back to the first page and I could not see the selected row.

I looked at the history of page and I didnt see anything strange, just I had added in a point a navigation button in the collection.
I checked the history in bindings and there I found the difference:

iterator Binds="EmployeesView1" RangeSize="25"
DataControl="AppModuleDataControl" id="EmployeesView1Iterator"
ChangeEventPolicy="ppr"


after removing ChangeEventPolicy="ppr" the table behaved correctly again.
I also notice in the detail log(-Djbo.debugoutput=console) the following:
[9421] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[9422] ! ERROR: Use of pinDataControl
[9423] ! is not supported. Pinning the !
[9424] ! DataControl will result in severe!
[9425] ! performance issues. !
[9426] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I don't know if it is related but it doesn't seems good.

So is this a bug?
We should not use ChangeEventPolicy="ppr" for iterators used in tables?
If not why it is set automatically when you drag and drop some iterator operations?

I reproduced the problem in a simple test case with just departments table
http://adfbugs.googlecode.com/files/TestPPR.zip

Metalink:
Bug No: 7233400 AUTOPPR: TABLE REREFRESHES UNNECESSARILY
Status: Scheduled for Future Release

Does not reproduce in Jdeveloper 11.1.2

Performance Tuning, Range Paging Last operation, bug

So I started working on Performance Tuning with Range Paging as Steve suggested.
In order to have more realistic performance tests I created a lot of employees (200000) using the following database procedure:

create or replace
PROCEDURE CREATE_EMPLOYEES AS
BEGIN
FOR i IN 1..200000 LOOP
Insert into employees (employee_id,
last_name,
email,
hire_date,
job_id)
select employees_seq.nextval as employee_id,
'auto' i as last_name,
'aut' i '@gmail.com' as email,
sysdate as hire_date,
'IT_PROG' as job_id
from dual;
END LOOP;
COMMIT;
END CREATE_EMPLOYEES;

So I tested Range Paging and I actually saw the difference in query page, while scrolling down the results of query criteria.
Then I go to Edit page and I press Last button. Then I get this error:
oracle.jbo.InvalidOperException: JBO-25084: Cannot call last() on row set EmployeesView1 because the access mode uses range-paging


I guess since its a jbo exception it is not a bug?
It doesn't say much for the user though...
So in order for performance we must not have a 'Last' button?
Or is better to use diferent view object for query and for edit?

Performance Tuning, Only up to row number, bug

In the same application I continue searching ways to do performance tuning so:
In the view object Tuning, in the frame called Retrieve from the database, I set
Only up to row number =10


I was expecting that only 10 rows would be retrieved from database by a filter like rownum<=10
but when I check the log (and database sql) I see that normal select is send to database:
[1214] SELECT Employees.EMPLOYEE_ID, Employees.DEPARTMENT_ID, Employees.FIRST_NAME, Employees.LAST_NAME, Employees.EMAIL, Employees.PHONE_NUMBER, Employees.HIRE_DATE, Employees.JOB_ID, Employees.SALARY, Employees.COMMISSION_PCT, Employees.MANAGER_ID, Departments.DEPARTMENT_NAME, Departments.DEPARTMENT_ID AS DEPARTMENT_ID1 FROM EMPLOYEES Employees, DEPARTMENTS Departments WHERE Employees.DEPARTMENT_ID = Departments.DEPARTMENT_ID(+)
[1215] Bind params for ViewObject: EmployeesView1
[1216] DBTransactionImpl.mDefaultSparseArrayThreshold is 20
[1217] No Resource Bundle found but null value id:LOVUIHints_NullValueId is defined in an ListBinding Definition.
[1218] DCUtil, returning:oracle.adf.model.binding.DCParameter, for AppModuleDataControl
[1219] Changing iterator range size from :25 to :10
From what I know this select retrieves all rows from database and then somehow ADF shows only 10.
So wouldn't it be better performance for me to just put rownum<=10 in the where clause?

Tuesday, July 21, 2009

Performance Tuning, LOVs and Range Paging bug (Fixed in 11.1.1.3)

I try to Implement performance tuning on view objects

So in the same application bellow I set for ManagersLov view object Access Mode = Range Paging and Range Size = 26


But when I run the application and try to open Managers LOV I get the following exception:
java.sql.SQLException: Attempt to set a parameter name that does not occur in the SQL: Bind_RangePage_High at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70) at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271) at oracle.jdbc.driver.OraclePreparedStatement.setIntAtName(OraclePreparedStatement.java:11026) at oracle.jdbc.driver.OraclePreparedStatementWrapper.setIntAtName(OraclePreparedStatementWrapper.java:783) at oracle.jbo.server.OracleSQLBuilderImpl.bindRangePagingParams(OracleSQLBuilderImpl.java:1655) at oracle.jbo.server.ViewObjectImpl.bindRangePagingParams(ViewObjectImpl.java:3845) at oracle.jbo.server.ViewObjectImpl.bindParametersForCollection(ViewObjectImpl.java:18320) at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:1035) at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:815) at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:5892) at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1021) at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:889) at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2734) at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2711) at oracle.jbo.server.ViewRowSetIteratorImpl.first(ViewRowSetIteratorImpl.java:1540) at oracle.jbo.server.ViewRowSetImpl.first(ViewRowSetImpl.java:3231) at oracle.adf.model.binding.DCIteratorBinding.setupRSIstate(DCIteratorBinding.java:757) at oracle.adf.model.binding.DCIteratorBinding.refreshControl(DCIteratorBinding.java:657) at oracle.jbo.uicli.binding.JUIteratorBinding.refreshControl(JUIteratorBinding.java:473) at oracle.adf.model.binding.DCIteratorBinding.rangeRefreshed(DCIteratorBinding.java:863) at oracle.adf.model.binding.DCIteratorBinding.bindRowSetIterator(DCIteratorBinding.java:499) at oracle.jbo.uicli.jui.JULovButtonBinding.bindRowSetIterator(JULovButtonBinding.java:1289) at oracle.jbo.uicli.binding.JUCtrlListBinding.createListIterBinding(JUCtrlListBinding.java:903) at oracle.jbo.uicli.binding.JUCtrlListBinding.initFromServerBinding(JUCtrlListBinding.java:593) at oracle.jbo.uicli.binding.JUCtrlListBinding.setupListItems(JUCtrlListBinding.java:663) at oracle.jbo.uicli.jui.JULovButtonBinding.actionPerformed(JULovButtonBinding.java:803) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6134) at javax.swing.JComponent.processMouseEvent(JComponent.java:3265) at java.awt.Component.processEvent(Component.java:5899) at java.awt.Container.processEvent(Container.java:2023) at java.awt.Component.dispatchEventImpl(Component.java:4501) at java.awt.Container.dispatchEventImpl(Container.java:2081) at java.awt.Component.dispatchEvent(Component.java:4331) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895) at java.awt.Container.dispatchEventImpl(Container.java:2067) at java.awt.Window.dispatchEventImpl(Window.java:2458) at java.awt.Component.dispatchEvent(Component.java:4331) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

So is this a bug?
Can we use Access Type and Range paging in view objects that are used as LOVs?

Friday, July 17, 2009

LOVs Dont return Values when there is any validation error on page

On the same application bellow i try to create a new Employee so i press new.

i enter employeeId and EmployeeNam and i press Apply.
Validation Errors fire since i havent filled all required fields.



then i try to select from LOV a Department. but there is no way.
Even though the LOV open, it does not return a value and it doesnt close unless i press the cancel button.



I can only return values from LOV when there is no validation errors on page.

Is this working as expected?

When i have more than 1 lov with validation errors then i have to click on all LOVs for all validations to be fixed before i can return values from LOVs.

Is this a bug?
is there a workaround?

Tuesday, July 14, 2009

JDeveloper 11 r1 Cascading LOV bugs

Since I had a strange reply for the previews post in oracle forums
I decided to investigate cascading LOVs a little more

So I created a ManagersLOV view object with query:
SELECT m.EMPLOYEE_ID,
m.FIRST_NAME,
m.LAST_NAME,
m.DEPARTMENT_ID
FROM EMPLOYEES m
WHERE EXIST (select null
from employees e
where e.manager_id = m.employee_id)
I added bind variable inDepartmentId and view criteria for DepartmentId
I added it as LOV in the employees view and in the accessors I set DepartmentId as value for the bind variable.


I see in property inspector that Row Level Bind Variables is set to true.
I also added ManagerId in query Criteria
I test the application.
In query page if I select a department from LOV and then open manager LOV, managers are filtered correctly depending on department, But:
Bug 1:
If I Type a value in department (or if I remove value) and then try to select manager then the managers are not filtered correctly.


Bug 2: If I type an invalid value in Department and press search, and then try to select a manager I have a null pointer exception.:
Caused by: java.lang.NullPointerException
at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding$AdfCriterionValues.(FacesCtrlSearchBinding.java:2834)


Bug 3: If I type an invalid value in Department and go to Edit page (press Edit or New) and return (New Search) tha page is corrupted with the same null pointer exception.


Bug 4: In Edit page I type an invalid value in ManagerId, then I change the department and try to select new value for the ManagerId from the LOV. But the managers are filtered according to the old department


So I think this is not correct so I go to the LOV of ManagerId field and in the UI Hints I select the checkbox Filter Combo Box Using 'ManagersLovCriteria'


I go again to the accessor and I see that property Row Level Bind Variables is empty.
I go again to the LOV of ManagerId field and in the UI Hints and I see the checkbox Filter Combo Box not checked. No mater how many times I try to check it it remains unchecked.


So I try the application and I reproduce all the above bugs.

So I manually change the value of property 'Row Level Bind Variables' to “false” and I try the application.
I cannot reproduce the Bugs 2 and 3 with NullPointerException but the Managers never filter for the selected department no mater if I select it from LOV or not

So as a conclusion, cascading LOVs don't work correctly in Jdeveloper 11g r1 no mater the value of
'Row Level Bind Variables'
Find test case application at:

Monday, July 13, 2009

JDeveloper 11 r1 migration bug

In jdeveloper before release 1 when you where using bind values in LOVs in the accessor there was a checkbox 'Row level bind variable'
you had to check that in input List of values fields but to uncheck it if the LOV was used in the view criteria.
Ofcourse that caused problems if the same attribute was used in query and in results.
So i was happy to see that it is removed.
But if you check the xml, the code is still there.


but the value is set by default to true.
But when we migrated the application to release 1 it didnt change the value to true. it remained 'false' causing a lot of problems in cascading LOVs

So i suggest you change manual all RowLevelBinds="true"

Sunday, July 12, 2009

ADF input list of values AutoSubmit bug.

So lets see in the same application the bugs in LOV.

As default LOV has AutoSubmit=false
Yet when you select a value from the from department LOV the department name changes automatically.
Thats strange since LOV return only department id and no partial trigger from department id to department name exist.
Yet if you change the value by typing the description is not updated.
If you put an invalid value by hand then a validation error is shown when you submit page

So I put AutoSubmit=true to department id and partial trigger in department name hopping to have same behavior when I type value in LOV field.
Then when I put an invalid value the LOV automatically pop up. No validation error is shown. If I press cancel, still no validation error. Only when I submit the page the validation appear
If I type a valid value in department then 'usually' the LOV does not pop up. I say 'usually' because if the valid value start with the same value of other valid values then the LOV stills pop up. If I press cancel on LOV then Department Name is not updated.

An other strange thing is that when I press a valid value and press tab to go to next field the focus remains in the LOV field.
So is it only me that finds this behavior wrong?
Should we consider this Buggy behavior or for some reason I don't understand its a feature?





ADF return from dialog Dialog Bug

So I heard that returnActionListener works now on R1
So I wanted to try a dialog
The scenario is simple
The same employee query and edit pages below but I open query page as dialog


I hope that when I return I will be able to have somehow the same row as in dialog. So I put a partial trigger for the button to the form.
But no luck, when I return even if I haven't selected a different row I have an error message

Ofcourse if i do the same without a dialog it works correctly.
So Is this a bug?
Is there a workaround?

Download testcase from:
http://adfbugs.googlecode.com/files/TestDialog.zip

Monday, July 6, 2009

Query Component Required Criterion bug 2

In the same application bellow as i said that bug does not happen all the time
Some times there is an other bug.
When you first enter the Query page there are no data, since it is not executed by default and no criterion is selected.
If you just navigate to the edit page (edit or new) and return then the result table is full of data.
Is this a bug?
Is there a workaround? Except than using different view object for query end edit

you can download testcase from
http://code.google.com/p/adfbugs/downloads/detail?name=TestQuery.zip&can=2&q=#makechanges

Sunday, July 5, 2009

Query Component Required Criterion bug (new r1 Bug)

So I decided to upgrade my application.
I added List of values for Departments for EmployeesView.DepartmentId and Department name in Employees view. I also added DepartmentId in query criteria as required criterion


I also created an edit page for Employees and navigation between pages with default task flow.

So I run and go first again to the search page.
Before Release 1 of jdeveloper 11 when you had required criteria and press search without entering values, nothing happened. That was quite frustrating for users but we could explain it to them with the * sign.

Now a message is displayed explaining that. So I was happy to see it:



But after some searches and navigations to edit page and back. I was surprised to see that the layout was broken.


I could not navigate or do anything any more...
I check the console to see the following:

<05-jul-2009> <[ServletContext@5888435[app:TestQuery module:TestQuery-ViewController-context-root path:/TestQuery-ViewController-context-root spec-version:2.5]] Servlet failed with Exception oracle.jbo.AttrValException: JBO-27014: Attribute DepartmentId in EmployeesViewCriteria is required at oracle.jbo.rules.JboVCItemRequiredValidator.validateItem(JboVCItemRequiredValidator.java:90) at oracle.jbo.rules.JboVCItemRequiredValidator.validate(JboVCItemRequiredValidator.java:160) at oracle.jbo.common.ViewCriteriaImpl.validateRow(ViewCriteriaImpl.java:597) at oracle.jbo.common.ViewCriteriaImpl.validate(ViewCriteriaImpl.java:558) at oracle.jbo.server.ViewRowSetImpl.validateViewCriteria(ViewRowSetImpl.java:7152) Truncated. see log file for complete stacktrace >

So is this a bug?
Is there a workaround?

Saturday, July 4, 2009

Query Component Focus bug

You can say that I am strange or whatever but imagine if users ask that query criteria should have focus when you enter the page...
I could say that its a detail... that its not so important...
But they will reply that every search engine in the world has initial focus. Imagine if in Google or youtube you should click in search field to search something...
So I try to do it.
There is a property in af:document for initialFocusId so I set it to Query component since I can't get inside.


But still I am many tabs away of focusing the first criterion.
So I tried to remove components above the criteria like:
No Match All – Any

remove save
put mode to footer
but I just managed to be 1 tab away from criteria


The only way I could do it is by using simple mode for Query component


So is this a bug?
Or should I chose between focus and advanced search?

Friday, July 3, 2009

Query Component Save bug

In the same application bellow i try the Save... button


Since i usally want to query employees with salary >3000 i set that value and i save search:


But when i run that saved search i dont get the result, the value of criterion is lost:


So i thought ok it doesn't save values, lets see advanced search:
I use advanced search and add Salary again with same value.
I save criteria and now it saves both criterion and value:



So it doesnt save criteria values that have bind variable.
Yet i wouldnt know how to explain this to an end user...
Is this a bug?
No? since it has a workaround?
Dont use bind variables in criteria?

Thursday, July 2, 2009

Query Component validations bug

So I installed Jdeveloper 11.1.1.1.0 new release yesterday
I created Default Business Components from test HR schema
In the EmplyeesView I created View Criteria for 2 attributes:
HireDate and Salary

Finally I created a default search panel with result table.
So I run it and tried to use it
I am a bad user so I put wrong format for the HireDate and not a number for Salary
I press search and logically I had validation errors.
So I pressed reset thinking that it will clear the values to put new...
but still validations fire... no reset is executed

I thought I need to look at the manual. There must be a way to clear criteria when I have invalid values.... but no luck.
So is this a bug?
Is there a workaround?
If there is a workaround is this still a bug?
Will Oracle fix it?