Creation of transient Entity Object in ADF

Scenario: 

At many point you may feel to create the transient entity object. As we know a transient attribute and transient view object can be created. In the same way we can create the transient entity object.

Why we need to create the transient entity object ?

This can be see with a suitable example.

Suppose you have a transient view object. Now you have created a table on your screen with the help of this transient view object. Now you have populated the data by some code in the transient view object.

In my case I have created a page as shown below and created a button which will call a method to populate the table based on transient view object.

I have created a transient view object which look likes as shown below.


Now I have created the table based on this view object and populating the data using a method call on clicking the button "Populate Table" as shown below.


Now when you put the value in table filter with existing value and press enter you will not be able to get the data as shown below.


This happening because the value is not persisting for transient view object.

If you remove the value from filter and press enter the value will not come back.

Solution:

The solution of this problem is the transient entity object.

How to create transient entity object.

Create a entity object and provide the name of entity object and uncheck the checkbox for "Existing Object" and click on "Next".


A message popup will come. select "No".


You will get the following window. Click on "New".


Provide the attribute name and uncheck the property "Persistent" and click on "Ok".


Create the second and third attribute also like this as shown below.


Now go to transient view object and delete existing attributes and suffle your entity object in the view object.


Now go to attribute section and add attribute from entity as shown below.


Shuttle your all attribute to right side from left side and click on "Ok".


Now run your page and try to filter the data after populating. You will now get the matching records as shown below.



Comments

  1. Hi, I tried doing this in 12c.
    But in transient view object, adding attributes from EO, an error is throwing " Key attribute in Entity object to be persisted ".
    If view object is created based on entity, and drag and drop as table on page with filted and sorting option enable, then getting null pointer exception at oracle.adfinternal.view.faces.renderkit.rich.table.TableFilterUtils.createfilterFieldFromAttributeCriterion(TableFilterUtils.java:55).

    Please check this.

    ReplyDelete

Post a Comment

Popular posts from this blog

Setting up the environment for Angular2 and Hello World Example in Angular2

Showing number of rows or row count on top and bottom of table in ADF.

Build a Simple ReactJS application using react-cli