Wael Abdeen Blog
Unified - General DML/Navigation Back Bean | Oracle ADF

Hi,

While Leading Oracle Fusion Discussion Group B Team - Saudi Arabia / Gulf Area, i decided to change & Enhance my General Mechanism for DML operations to be more simple, Unified & General for my ADF Applications.

today, i show a new way to make your DML operations/ Records Navigation  are easy to handle & Managed for all your team and make it more easy to be customizable by any of your Developers & for any purpose.

idea “is to make your Action Sources - Buttons or whatever you use to pass Iterators Names or Defined Page Definition Actions” with Action or Action Listeners methods”.
Benefits.

  • One Managed/Back Bean Easy to Handle (Request Scope).
  • Customizable for any special commit & RollBack Behavior.
  • General For any Iterator, Actions & for any page.

First of all, you have to build one small ADF/JSF application and in your task flow by adding it in Adfc-config.xml or faces-config.xml as you work.

  <managed-bean>
    <managed-bean-name>dml</managed-bean-name>
    <managed-bean-class>Beans.dml</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
  </managed-bean>

package Beans;

import WA.WABEAN;
import javax.faces.event.ActionEvent;
import oracle.adf.view.rich.component.rich.RichPopup;
import oracle.binding.OperationBinding;
import oracle.jbo.DMLException;
import oracle.jbo.Row;
import oracle.jbo.RowSetIterator;


public class dml {

    WABEAN mybean = new WABEAN();
    private String MethodNameorIteratorBinding = “”;
    private RichPopup p2;
    private RichPopup p3;

    public String CreateInsert() {
        if (getMethodNameorIteratorBinding() != null) {
            RowSetIterator Schedual =
           mybean.AccessIteratorBinding(getMethodNameorIteratorBinding()).getRowSetIterator();
            Row lastRow = Schedual.last();
            int lastRowIndex = Schedual.getRangeIndexOf(lastRow);
            Row newRow = Schedual.createRow();
            newRow.setNewRowState(Row.STATUS_INITIALIZED);
            Schedual.insertRowAtRangeIndex(lastRowIndex + 1, newRow);
            Schedual.setCurrentRow(newRow);
        }
        return null;
    }
    public String Delete() {
        if (getMethodNameorIteratorBinding() != null) {
            mybean.AccessOperation(getMethodNameorIteratorBinding()).execute();
        }
        return null;
    }
    public String Next() {
        if (getMethodNameorIteratorBinding() != null) {
            mybean.AccessOperation(getMethodNameorIteratorBinding()).execute();
        }
        return null;
    }
    public String Previous() {
        if (getMethodNameorIteratorBinding() != null) {
            mybean.AccessOperation(getMethodNameorIteratorBinding()).execute();
        }
        return null;
    }
    public void Commit(ActionEvent actionevent) {
        if (getMethodNameorIteratorBinding() != null) {
            try {
                OperationBinding commit = mybean.AccessOperation(getMethodNameorIteratorBinding());
                commit.execute();
                if (commit.getErrors().isEmpty()) {
                    mybean.ShowDialog(getP2(), actionevent);
                }
            } catch (DMLException e) {
                mybean.Validate(mybean.getFacesContext(), “Commit ..”, e.getErrorCode() + ” - ” + e.getBaseMessage(),
                                1);
            }
        }
    }
    public void Rollback(ActionEvent actionevent) {
        if (getMethodNameorIteratorBinding() != null) {
            try {
                OperationBinding rollback = mybean.AccessOperation(getMethodNameorIteratorBinding());
                rollback.execute();
                if (rollback.getErrors().isEmpty()) {
                    mybean.ShowDialog(getP3(), actionevent);
                }
            } catch (DMLException e) {
                mybean.Validate(mybean.getFacesContext(), “RollBack ..”, e.getErrorCode() + ” - ” + e.getBaseMessage(),
                                1);
            }
        }
    }
    public void setMethodNameorIteratorBinding(String MethodNameorIteratorBinding) {
        this.MethodNameorIteratorBinding = MethodNameorIteratorBinding;
    }
    public String getMethodNameorIteratorBinding() {
        return MethodNameorIteratorBinding;
    }
    public void setP2(RichPopup p2) {
        this.p2 = p2;
    }
    public RichPopup getP2() {
        return p2;
    }
    public void setP3(RichPopup p3) {
        this.p3 = p3;
    }
    public RichPopup getP3() {
        return p3;
    }
}

Before Continue, please Note,

  • Create Insert method insert record for next row index (Require Iterator Name) and no need for action.
  • Delete, Next & Previous (Required Actions Names Defined in Page Definitions).
  • Commit & Rollback Methods make it’s purposes and Handle Errors Expected and Show Feedback Dialogs as well.
  • MethodNameorIteratorBinding used to pass Iterator or Actions Names Required

Finally, build your jsf, jspx or jsff page and make toolbar containing the buttons of 6 dml operations (insert, delete, next record, previous record, commit & rollback) and add the “setPropertyListener” passing Iterators or Actions Required.

                <af:toolbar id=”t1”>
                  <af:button id=”b1” icon=”#{resource[‘images:add.png’]}” action=”#{dml.CreateInsert}”>
                    <af:setPropertyListener from=”Company1Iterator” to=”#{dml.methodNameorIteratorBinding}”
                                            type=”action”/>
                  </af:button>
                  <af:button id=”b2” action=”#{dml.Previous}” icon=”#{resource[‘images:back.png’]}”>
                    <af:setPropertyListener from=”CompanyPrevious” to=”#{dml.methodNameorIteratorBinding}”
                                            type=”action”/>
                  </af:button>
                  <af:button id=”b3” icon=”#{resource[‘images:next.png’]}” action=”#{dml.Next}”>
                    <af:setPropertyListener from=”CompanyNext” to=”#{dml.methodNameorIteratorBinding}”
                                            type=”action”/>
                  </af:button>
                  <af:button id=”b4” icon=”#{resource[‘images:remove.png’]}” action=”#{dml.Delete}”>
                    <af:setPropertyListener from=”CompanyDelete” to=”#{dml.methodNameorIteratorBinding}”
                                            type=”action”/>
                  </af:button>
                </af:toolbar>


Finally, you have one Back Bean responsible for handle all DML / Navigation operations in any Iterator or Page Defination Actions for all pages in your ADF Application.

?

af:table bad behavior in JDeveloper/ADF 12c | Oracle ADF

Hi,

Few Days ago, we faced one bad behavior while building IMS New ADF Application.

While Leading Oracle Fusion Discussion Group B Team - Saudi Arabia / Gulf Area, Main issue come from the default behavior of af:table component for 12c Latest ADF/JDeveloper .

Normal Behavior in ADF Project is a disaster in 12c (as before in old versions) but little bit different, in few steps i will show the bad behaviors and How to solve completely with one step.

  • create small table with insert statement as attached in SCRIPT.sql attached file in the project url and create it into your default hr schema.
  • Create ADF - JSF Fusion Application as usual. 

                     image

  • Build Business Component from table and drop it as Entity Object and View Object as well based on table created.

imageimage

  • Make View Object in No Rows Mode (VO always in Insert Mode Only).

image

  • Make Normal jsf page dropping VO as a af:table and createinsert method as a button in toolbar facet for panelgrouplayout container.

image

  • we have only one record in our table

image

  • Run the page, press createinsert button and you will face this Error Message !!

image

  • Insert Second Record

image

  • Run Page Again, and press same button, wow it works !!, but there is a another bad behavior, Data Duplicated !!
  • but wait, why Data Displayed !!, we created new row only and at same time, VO has no row property activated !!

image

  • sometimes if you have Master Detail Relation Ship and you have af:table for detail one, you will face another problems same as “Second Record is not visible !!” and sometimes Fire Validation Error for Required items however u didn’t leave the row !!

Finally, to Stop all bad behaviors from af:table, please change the Change Event Policy property of Iterator to be Non instead of ppr (in page Def base of page)

image

image

Now, you have perfect result ..

image


 ?

Oracle BDI - Oracle Base Development Infrastructure

Hi

Few Days Ago, i started to Build Oracle BDI - Base Development Infrastructure for Oracle Fusion Discussions Community with Cooperation with Apps Stuff Team and i published my Article about the Preparations,  Installations  & Configurations Parts.

I decided to share Knowledge in 4 Parts, Preparations, Installations, Configurations & Best Practice and so today i share the 4th part under name Best Practice

it is Part 4 of build Professional Base Development Infrastructure For JAVA / ADF Developers and using JDeveloper

Resources

  • Oracle Enterprise Linux 6.2
  • JDK 1.6 U 45
  • OTP 11.1.2.4.0
  • Oracle DB XE 11.2.0
  • Weblogic 10.3.6
  • ADR 11.1.1.6 (Patched to 11.1.2.4.0) - Optional
  • Jira 4.5
  • CollabNet Subversion Edge 3.3
  • JDeveloper 11.1.2.4.0 - latest

thanks ?

Oracle JDeveloper - ADF 12c is out !!

at last, Oracle Announced For Oracle JDeveloper - ADF 12c with new Features and available for download.

thanks ?

Oracle BDI - Oracle Base Development Infrastructure

Hi

Few Days Ago, i started to Build Oracle BDI - Base Development Infrastructure for Oracle Fusion Discussions Community with Cooperation with Apps Stuff Team and i published my Article about the Preparations & Installations Parts.

I decided to share Knowledge in 4 Parts, Preparations, Installations, Configurations & Best Practice and so today i share the 3rd part under name Preparations.

it is Part 3 of build Professional Base Development Infrastructure For JAVA / ADF Developers and using JDeveloper

Resources

  • Oracle Enterprise Linux 6.2
  • JDK 1.6 U 45
  • OTP 11.1.2.4.0
  • Oracle DB XE 11.2.0
  • Weblogic 10.3.6
  • ADR 11.1.1.6 (Patched to 11.1.2.4.0) - Optional
  • Jira 4.5
  • CollabNet Subversion Edge 3.3
  • JDeveloper 11.1.2.4.0 - latest

thanks ?

Oracle BDI - Oracle Base Development Infrastructure

Hi

Few Days Ago, i started to Build Oracle BDI - Base Development Infrastructure for Oracle Fusion Discussions Community with Cooperation with Apps Stuff Team and i published my Article about the Preparations Part.

I decided to share Knowledge in 4 Parts, Preparations, Installations, Configurations & Best Practice and so today i share the 1st part under name Preparations.

it is Part 2 of build Professional Base Development Infrastructure For JAVA / ADF Developers and using JDeveloper

Resources

  • Oracle Enterprise Linux 6.2
  • JDK 1.6 U 45
  • OTP 11.1.2.4.0
  • Oracle DB XE 11.2.0
  • Weblogic 10.3.6
  • ADR 11.1.1.6 (Patched to 11.1.2.4.0) - Optional
  • Jira 4.5
  • CollabNet Subversion Edge 3.3
  • JDeveloper 11.1.2.4.0 - latest

thanks ?

Oracle BDI - Oracle Base Development Infrastructure

Hi

Few Days Ago, i started to Build Oracle BDI - Base Development Infrastructure for Oracle Fusion Discussions Community with Cooperation with Apps Stuff Team.

I decided to share Knowledge in 4 Parts, Preparations, Installations, Configurations & Best Practice and so today i share the 2nd part under name Preparations.

it is Part 1 of build Professional Base Development Infrastructure For JAVA / ADF Developers and using JDeveloper

Resources

  • Oracle Enterprise Linux 6.2
  • JDK 1.6 U 45
  • OTP 11.1.2.4.0
  • Oracle DB XE 11.2.0
  • Weblogic 10.3.6
  • ADR 11.1.1.6 (Patched to 11.1.2.4.0) - Optional
  • Jira 4.5
  • CollabNet Subversion Edge 3.3
  • JDeveloper 11.1.2.4.0 - latest

thanks ?

Hi
i am happy to announce for a Community For Apps Stuff Team For Engineers / Developers Interested in Oracle Technologies specially Oracle Application Development Framework (ADF), Oracle Service Oriented Architecture (SOA) &amp; Oracle Business Intelligence Enterprise Edition (OBIEE).
Apps Stuff is planning to give Advanced Techniques and Answers for members Questions and Clarifications For all Community Members.
Apps Stuff Help Community Members to be in Modern / Scientific Way to use Oracle Advanced Techniques in their Projects.
Apps Stuff try to Clarify and Help Community Members to know more about Oracle Fusion Middleware (OFM).
Apps Stuff Planning to have many sessions &amp; lectures to help improving Developers Knowledge specially in middle east Area.
For More Details, please press here.
I am Happy to announce For new Cooperation With Apps Stuff Team in the Future.
Regards.
 

Hi

i am happy to announce for a Community For Apps Stuff Team For Engineers / Developers Interested in Oracle Technologies specially Oracle Application Development Framework (ADF), Oracle Service Oriented Architecture (SOA) & Oracle Business Intelligence Enterprise Edition (OBIEE).

  • Apps Stuff is planning to give Advanced Techniques and Answers for members Questions and Clarifications For all Community Members.
  • Apps Stuff Help Community Members to be in Modern / Scientific Way to use Oracle Advanced Techniques in their Projects.
  • Apps Stuff try to Clarify and Help Community Members to know more about Oracle Fusion Middleware (OFM).
  • Apps Stuff Planning to have many sessions & lectures to help improving Developers Knowledge specially in middle east Area.

For More Details, please press here.

I am Happy to announce For new Cooperation With Apps Stuff Team in the Future.

Regards.

 

ActFax 5.01 (Build 0232) is out&#160;!!
For more details, please  check here ..
thanks&#160;?

ActFax 5.01 (Build 0232) is out !!

For more details, please  check here ..

thanks ?