ADF, ADF Exceptions

ADF How to access bind variable from view object row?

Problem I just faced a requirement to pass bind variable value to one of view object attributes LOV. It looks straight forward while we can provide view criteria and bind variable values to LOV’s view object via view accessor: I thought that it should be no problem just to write a groovy expression into parameters value field: adf.object.viewObject.myBindVariable But  I’ve…

Continue Reading
ADF

ADF application layout messed up after migration to 12.2.1 … What might be the reason ?

Problem: After migration of ADF application from 12.1.3 to 12.2.1 layout was messed up. In particular – component stretching was disordered. Reason: As ADF is going step by step to adaptive layouting, component stretching is optimized accordingly. In version 11.1.1.7 new context parameter was introduced: oracle.adf.view.rich.geometry.DEFAULT_DIMENSIONS. It basically tells what dimensions for stretchable components should be applied by default. For example…

Continue Reading
ADF, JDeveloper

JBO-26041: Failed to post data to database during “Update”… What might be the reason?

Problem: Exception during data save is thrown: oracle.jbo.DMLException: JBO-26041: Failed to post data to database during “Update”: SQL Statement “UPDATE… It might be followed by similar to this one: java.sql.SQLException: Fail to construct descriptor: Unable to resolve type “NVARCHAR2″… Solution: Check if  SQLType attribute of an entity/view object attribute being updated is correct. For example it can be set to…

Continue Reading
ADF, Continuous Query Notification, JDBC, JDeveloper

Override inputListOfValues component model and Continuous Query Notification sample in ADF

Requirement: Standard ADF inputListOfValues component should behave like this: When pressed “Search”, action should stop and wait untill any change happen in DB table being searched When change happen in DB table, search should resume among updated data. If no change happen it should resume after 10 seconds timeout In addition – search input field validation should happen on “Search”…

Continue Reading
ADF, DB Change Notification, JDeveloper, WebSocket

WebSocket together with DB Change Notification in ADF for immediate data refresh in browser (complete sample).

Requirement We have DB table contents displayed in ADF GUI After changes in that DB table (by anyone else in the background) we want to immediately display in our currenlty open browser session Solution To achieve our goal we need somehow to know when changes in DB happen. Once we know when, need to notify browser session in order it…

Continue Reading
ADF, JDBC

How to select all JDBC Database Change Notification Registrations and clean them?

Question: How do I select all database change notifications registered via JDBC driver by my DB user? Answer: select * from user_change_notification_regs Question: How do I clean all of my DB change notifications? Answer: Database change notifications registered via JDBC driver can be deregistered only the same way – using JDBC driver. Therefore you need to execute this code: This…

Continue Reading
ADF, JDeveloper

How to add ADF source code in JDeveloper 12c ?

Problem I want to have ADF source code available in my project. Solution Open service request ticket at My Oracle Support and ask to provide you a source code for ADF. Oracle staff will provide you a security code and a link to download a zip file.  Open JDeveloper, select Tools -> Manage Libraries…  Click Libraries tab Select folder User…

Continue Reading
ADF, JDeveloper

How to iterate through all view object rows irrespective of specified range size and without impact to current rowset?

ProblemImagine we have iterator binding EmployeesViewIterator with specified range size 25. But we want to iterate through ALL employees available, not just 25 of current range. Solution Create new row set iterator from EmployeesView view object. It will contain ALL rows irrespective of specified range size. Iterate it ! DCIteratorBinding it = (DCIteratorBinding)BindingContext.getCurrent().getCurrentBindingsEntry().get(“EmployeesViewIterator”);RowSetIterator rsi = it.getViewObject().createRowSetIterator(null);   while (rsi.hasNext()) {     Row row = rsi.next());   …

Continue Reading
ADF, DB, SQL

ADF method for calling DB procedures, executing other SQL statements with input and output parameters

How to call DB procedure with input and output parameters. Here I provide an example of ADF method which can be used with any number of in/pout parameters used in any order:     public void runStatement(String stt, boolean commit, ArrayList<Map<String, Object>> pars) {                CallableStatement st = this.getDBTransaction().createCallableStatement((stt), 0);        try { …

Continue Reading
ADF, Bindings

How to get LOV value instead of index when it is used in “selectOneChoice” component in the table row?

   When using LOV’s, a common issue in ADF is to get selected value instead of index when LOV is used to render for example “selectOneChoice” component. I’ve faced it when “selectOneChoice” was used in table. That means every row in table can have different selection of LOV values. Thus we can’t rely on iterators current row and simply to…

Continue Reading