Posts

Showing posts from October, 2014

Creating Custom Validation Rule For Entity Object in ADF

Image
Hi All, In this post we will see how we can create the custom validation rule in ADF. In Entity Object we have already many inbuilt validation rules like "Collection, Compare, Key Exist, Length" etc.. But suppose we have the requirement of createting our own validation rules then you can create it in this way. First of all create a Fusion Web Application and then right click on "Model" project and select "new" option. From Categories tab select "ADF Business Component" and then select item as "Validation Rule" as shown below. Give the Name of validation Rule class "Name"  and "Rule Display Name" according to your requirement. Now click on Ok. Now suppose if you have to validate the salary that the salary should not be greater than 100000. Then to do so you have to write the validation logic inside your rule validator class. You validation rule class will look like somewhat as shown below....

Creating Custom Data Types Using Domain in ADF

Image
Hi All, In this post I am going to show you How you can create the custom Data Type for validation using Domain in ADF. Suppose you have to validate the Email or URL Attribute in your Entity Object then you can create a custom data type in ADF and use that custom data type for validation of email or URL. So to create a custom data type, First create a ADF application and right click on "Model" project and select "New" option. Then from "Categories"  tab select "ADF Business Component" and then select "Domain" as shown below. Then click on OK. Give the meaningful name for your custom data type according to your choice as shown below. Click on "Next". Now click on Finish. Then go to "Java" section of created data type and open the java file. When you will open the "EmailDomain" class then you will see the following code. There is one " validate " method in th...

Accessing Different Scopes programatically in ADF.

You can use the following piece of codes to access different scope programatically. 1)  How to programmatically access requestScope objects          ADFContext context= ADFContext.getCurrent();          Map reqScope = context.getCurrent().getRequestScope();           reqScope.put("Name","Kunal Kumar");           2)  How to programmatically access ApplicationScope objects          ADFContext context= ADFContext.getCurrent();          Map appScope = context.getCurrent().getApplicationScope();          appScope.put("Name","Kunal Kumar"); 3)  How to programmatically access sessionScope objects          ADFContext context= ADFContext.getCurrent();    ...

Get value of SelectOneChoice from af Query panel instead of index in ADF

Image
Hi All, In this post I am going to show you that How you can get the value instead of index from SelectOneChoice component in query panel. By default when you try to access the value of SelectOneChoice from query panel, it will give you the index instead of actual value. But here will will try to get the actual value. Suppose you have a view object with name "SearchVO". In this VO we have create one attribute with name "DepartmentId". Also we have created a read only view object to fetch DepartmentId and DepartmentName from DEPARTMENTS table. Now we will attach the LOV to DepartmentId attribute in SearchVO. To do so click on Add icon of the List Of Value option. Select the DepartmentRO and map the DepartmentId column. Select Display Attribute as "DepartmentName" and click on "Ok". Now go to your SearchVO and create a View criteria as shown below and click on "Ok". You can see your created View ...

Creating Declarative Component Using Query Panel and Table In ADF

Image
 Hi All, In this post I am going to show you how you can create a declarative component using existing component in ADF. I this example I have taken the AF Query and ADF table for creation of declarative component. After creating the declarative component you can reuse it in many application. You just have to pass the required parameter for this declarative component. To create a declarative component first create a Fusion Web Application as shown below. After this right click on ViwController project and select "New" option. Select the Categories as "JSF" and then select "JSF Declarative Component" option. In the next screen give the name of the component and then click on "Add Tag Library" button. Then give the Tag Library Name and URL according to your choice and click on OK. Now click on af:componentDef and then go to property inspector and then select Attribute tab under common properties. Now click on Add and add ...