Friday 20 December 2013

ADF : Entity Validation : Script Validation - Display customized message from bundle

Entity Validation : Script Validation - Display customized message from bundle


Step1: Define Script expression for "LocationId"



Step2: Drag that View as Form on UI.

           Run the page.




If your DepartmentId > 30, It should throw error when you click on any button.
Note: It won't execute your entity validation for "LocationId" until you change the value of that.
As shown below, i have deleted/altered the value of "LocationId", then only Entity validation will be invoked and throw an error message.

The Reason is:


2nd step is "Apply Request Values" then 3rd step is "Process Validation" (Means: After applying the change only validation happens, if there is no change it will skip the validation step)


Thursday 5 December 2013

ADF : ViewCriteria : ViewCriteriaItem -> In XML / Java

ViewCriteria : ViewCriteriaItem -> In XML / Java



In XML







In JAVA



        ViewObject vo = am.findViewObject("Employees");
        ViewCriteria vc =  vo.createViewCriteria();
        ViewCriteriaRow vcr =  vc.createViewCriteriaRow();
        ViewCriteriaItem vci =vcr.ensureCriteriaItem("EmployeeId");
        vci.setOperator(JboCompOper.OPER_IN);
        vci.setValueMinCardinality(3);
        vci.setValueMaxCardinality(3);
        vci.setValue(0, 101);
        vci.setValue(1, 102);
        vci.setValue(2, 103);
        vc.addRow(vcr);
        vo.applyViewCriteria(vc);

ADF : ViewCriteria : Query Panel with CheckBox

ViewCriteria : Query Panel with CheckBox

 

MyRequiremen:
In Query Panel when ever user check the check box and search's then only the checked Info should display in the table

Solution:
1. In VO -> make Attribute to Check Box in Control Hints.
2. Override the Expression of that Attribue using DECODE

For More Info Refer:

http://adfspecialists.blogspot.in/2012/12/adf-query-panel-with-checkbox-boolean.html 
   
 





ADF : ViewCriteria : Execute MyLogic then Execute Search functionality.

ViewCriteria : Execute MyLogic then Execute Search functionality.


MyRequirement:
In Search Panel if user clicks on Search button, i need to execute my Login then execute the Search functionality.

Solution: 
Just override the executeQuery() function in VOImpl + Do you Logic + super.executeQuery()

For More Info Refer:
 http://andrejusb.blogspot.in/2010/05/yes-no-check-box-in-query-criteria.html




Solution2:

Generate custom where clause fragment for the ViewCriteriaItem

http://www.jobinesh.com/2010/09/using-bind-variable-for-sql-statements.html