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
Uncategorised

ADF ViewObject query selects values into wrong attributes?

Problem    In the view object result set value of particular attribute has wrong value. It belongs to another attribute of the same view object, usually to previous one in the sequence. Solution    Each view object attribute has property “Selected in query”. It must be selected if attribute is fetched using SQL query. If it is not selected and…

Continue Reading
Linux, VPN

Ubuntu vpn connects successfully and shortly thereafter fails – network traffic stops – either VPN and local network

I’ve started to use Ubuntu for my job needs and experienced first pretty annoying challenge with VPN connection.I’m using openvpn client with network manager. After successfull connect to VPN server I can use local and remote networks with no problem. After a while – like 1 -10 minutes , sometimes a bit longer up to couple hours or sometimes immediately…

Continue Reading
Uncategorised

ADF how to stretch table vertically and horizontally?

How to stretch ADF table vertically to fill maximum available vertical space in browser? Answer: Put table into af:panelStretchLayout component center facet. Put dimensionsFrom=”parent” attribute into af:panelStretchLayout (parent of af:panelStretchLayout component must stretch its children) How to stretch ADF table horizontally to fill maximum available horizontal space in browser? Answer: Put table into af:panelStretchLayout component center facet. Add styleClass=”AFStretchWidth” attribute to af:panelStretchLayout   Example:  <af:panelStretchLayout…

Continue Reading
Uncategorised

ADF java.lang.ClassCastException: …ViewRowImpl cannot be cast to …ViewRow ?

For example:java.lang.ClassCastException: model.DepartmentsViewRowImpl cannot be cast to model.common.DepartmentsViewRow JDeveloper, when generating View Object Row client interface sometimes goes wrong with class definition. Such error can be displayed when implementation of class is not defined. In particular error sample –  “implements DepartmentsViewRow” is missing in DepartmentsViewRowImpl class:public class DepartmentsViewRowImpl extends ViewRowImpl implements DepartmentsViewRow {…}

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
Uncategorised

How to output text with line breaks in ADF ?

   If we use regular “af:outputtext” component to print text with line breaks (new line symbols like “n” or  “rn”)  in ADF – we don’t succeed. Text is displayed in one line regardless of those symbols. Instead we need to use  “af:outputFormatted” component. But it is not enough. While it does not understand “n” or “rn” symbols, we need to use…

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