08 October, 2020

Database Sequence in Oracle ADF - Many Solutions

The video explains how to use Oracle Database sequence in Oracle ADF.

 1- Use DB Trigger and DBSequence Data Type 

2- Use create() in EntityImpl Class 

3- Use Expression Language in default value

 

 

 

Thanks

05 October, 2020

Oracle ADF Messages & Sweet Alert

The video explains different ways to show messages in Oracle ADF

1- JavaScript Alert

2- Faces Message

3- ADF Popup

It also explains  how to Use Sweet Alert in Oracle ADF.

Sweet Alert is beautiful, responsive, customizable, accessible (WAI-ARIA) replacement for JavaScript's popup boxes.
 
 

Thanks

26 September, 2020

Oracle ADF Session Variable - Part 2

Save Map, Array and Class Object in Session Variable, then Read the session Variable using

1- Expression Language

2- Java Code




Download Sample Application

10 March, 2019

ADF : Scope Variables

Oracle ADF uses many variables and each variable has a scope.
There are five scopes in ADF (Application, Request, Session, View and PageFlow).
The below code snippest explains how to get value of each variable scope.

        AdfFacesContext adfCtx = AdfFacesContext.getCurrentInstance();
                
        //Page Flow Scope
        Map pageFlowMap  = adfCtx.getPageFlowScope();
        Object pageFLowVariable = pageFlowMap.get("VARIABLE_NAME");
        
        //View Scope
        Map viewMap  = adfCtx.getViewScope();
        Object viewVariable = viewMap.get("VARIABLE_NAME");
        
        //Session Scope
        HttpServletRequest request =
            (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
        HttpSession session = request.getSession(false);
        Object sessionVariable = session.getAttribute("VARIABLE_NAME");
        
        //Request Scope
        Object requestVariable = request.getAttribute("VARIABLE_NAME");
        
        //Application Scope
        Map applicationMap = FacesContext.getCurrentInstance().getExternalContext().getApplicationMap();
        Object applicationVariable = applicationMap.get("VARIABLE_NAME");




Thanks

09 January, 2019

How to Pass Parameters to ActionListener in ADF

In some cases, it is required to pass a value to ActionListener of ADF Button.

The method that can be invoked by actionListeners has only one parameter of type ActionEvent. 
So I will explain how to pass parameter to that bean method however it contains only one paramater ActionEvent in method signature.

I added button to my page as below



The default signature of ActionLister is 




The workaround I used is adding an attribute tag from the JSF.Core inside the ADF Button So the code in the jsp page looks like this



Note "MyAttrName" is the name of paramater and "MyAttrValue" is the value of paramater.
You can bind  "MyAttrValue" to get any value from page definition.
Now I will write the followign code to get paramatervalue from bean

 
The variable "attrValue" holds the value of paramaters which is "MyAttrValue" in this example.

Thanks
Mahmoud Elsayed

28 November, 2017

OAF :Formatting DateTime Fields

Use the following code to format DateTime feilds in OAF

OAWebBean departureDateBean = webBean.findChildRecursive("DepartureDate");

OANLSServices nls = pageContext.getOANLSServices();
oracle.cabo.ui.validate.Formatter formatter =
    new OADateValidater(nls.getUserJavaDateFormat() + " HH:mm",
                        nls.getUserRRRRJavaDateFormat() + " HH:mm");
                       
departureDateBean.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, formatter);


Thanks

Database Sequence in Oracle ADF - Many Solutions

The video explains how to use Oracle Database sequence in Oracle ADF.   1- Use DB Trigger and DBSequence Data Type  2- Use create() in Entit...