Tuesday, November 29, 2011

Accessing an entity based ViewAccessor from a ViewObject

View accessors in ADF Business Components are value accessor objects that point from an entity object attribute (or view object) to a destination view object or shared view instance in the same application workspace . The view accessor returns a row set that by default contains all rows from the destination view object. You can optionally filter this row set by applying view criteria to the view accessor. The base entity object or view object on which you create the view accessor and the destination view object need not be in the same project or application module, but they must be in the same application workspace.

Because view accessors give you the flexibility to reach across application modules to access the queried data, they are ideally suited for accessing view instances of shared application modules.

When you create a ViewAccessor at the entity level, accessing the same at the ViewObject level is a little tricky, especially if you want to have it as part of a groovy expression in a transient attribute. An expression that works is :

row = (object.getEntity(0).ViewAccessorName.first())
return (row == null) ? null : row.Name

Jdeveloper IDE table-inspector error

When you're working with jdeveloper and the ide gives the below error in the property inspector :

Error : Error constructing column editor

Reason : This mostly happens when the related AM data control is not loaded properly in the data controls section.

Soln : Clean, build, and deploy the model project.
Re-load the data controls region.
Now., clicking on the property inspector shud render the column editor for your table!!