Tuesday 10 July 2018

ADF: ADF Table clear Filter

ADF: ADF Table clear Filter





    public void resetFieldTableFilter()
        {
        try {
            FilterableQueryDescriptor queryDescriptor =
                (FilterableQueryDescriptor)this.getFieldTable().getFilterModel();
            if (queryDescriptor != null &&
                queryDescriptor.getFilterCriteria() != null) {
                queryDescriptor.getFilterCriteria().clear();
                this.getFieldTable().queueEvent(new QueryEvent(this.getFieldTable(),
                                                               queryDescriptor));
            }
        } catch (Exception e) {
            if (AppsLogger.isEnabled(AppsLogger.SEVERE)) {
                AppsLogger.write(this,
                                 "Exception in  resetFieldTableFilter :" +
                                 e.getMessage() + " ", AppsLogger.SEVERE);
            }
        }
        }


Tuesday 3 July 2018

ADF : SkipValidation

ADF : SkipValidation


http://andrejusb.blogspot.com/2012/12/skip-validation-for-adf-required-tabs.html




1. Set Immediate = true property for both tabs:
2. Open page definition file and select root tag, Go to Properties window and search for SkipValidation property. Set SkipValidation to true:

Monday 26 March 2018

ADF : Best tutorial links

ADF: How to check whether particular View Object’s data is modified or not

ADF: How to check whether particular View Object’s data is modified or not?

 Create following method in ViewImpl class of your view object.

public boolean isdirty()
{
boolean flag=false;
DepartmentsViewRowImpl crow =(DepartmentsViewRowImpl)this.getCurrentRow();
EntityImpl entity= crow.getDepartments();
byte state=entity.getEntityState();
if(state!=entity.STATUS_UNMODIFIED)
{
flag=true;
}
return flag;
}

 

http://adftutorials.com/keyword/custom-error-message

 

ADF: Custom Error Handler in Model layer

ADF: Custom Error Handler in Model layer


https://docs.oracle.com/cd/E14571_01/web.1111/b31974/web_adv.htm#ADFFD1398

http://adftutorials.com/adf-custom-error-handler-to-display-custom-message-to-user.html

In Model Project
------------------

Step1 : custom error handler that extends the DCErrorHandlerImpl class

    eg:
        public final class MyErrorMessageHandler extends DCErrorHandlerImpl {

                public String getDisplayMessage(BindingContext ctx, Exception ex) { 
                        String message=""; 
                         
                        if (ex instanceof oracle.jbo.ValidationException) { 

                                String msg = ex.getMessage(); 
                         
                                int i=msg.indexOf("JBO-25013");//When JBO-25013 Too many object match promary key exception occur. 
                         
                                if(i>0) 
                         
                                { 
                                     
                                    message= "Duplicate Employee Id Found."; 
                                     
                                } 
                         
                                message= getDisplayMessage(ctx,ex); 
                         
                        } 
                         
                        else             
                         
                        { 
                         
                            message=getDisplayMessage(ctx,ex); 
                         
                        } 
                         
                        return message;            
                         
                }                                                                                                                                                                 
 

In View Project
------------------

Step2 :  Register MyCustomErrorHandler class into Databinding.cpx file.


    <?xml version="1.0" encoding="UTF-8" ?> 
   
    <Application xmlns="http://xmlns.oracle.com/adfm/application" 
     
    version="11.1.1.60.13" id="DataBindings" SeparateXMLFiles="false" 
     
    Package="com.in.adftutorials.view" ClientType="Generic" 
     
    ErrorHandlerClass="com.in.adftutorials.view.MyCustomErrorHandler">

Wednesday 28 June 2017

ADF : ADF Table not displaying rows 1st time.

ADF : ADF Table not displaying rows 1st time.


If we are using <af:quickQuery component against VO (ADF table), always we should mark "Query Automatically" checked, other wise rows will not be displayed 1st time when we land to the page.