Adding a View Object Instance Based on a Predefined View Object at Runtime

If you created a view object definition at design time, you can dynamically add an instance of that view object to an application module instance's data model at runtime by calling createViewObject() on the application module. An instance of the view object will be added to the application module's data model and returned by the method.

To add a view object instance based on a predefined view object at runtime:

  1. Create a String containing the package-qualified name of the view object definition. For example, if the view object definition is called OrdersView and is in the package orderentry.datamodel, you would use the following code:

    String voDefName = "orderentry.datamodel.OrdersView";

  2. Create a String containing the name you want to give the instance in the data model. For example, if this instance is to be called OrdersForCustomer, you would use the following code:

    String voInstanceName = "OrdersForCustomer";

  3. Call createViewObject() passing in the instance name and the definition name:
    ViewObject ordVO = myAM.createViewObject(voInstanceName, voDefName);                
  4. If you want the instance to stand in a master-detail relationship with another instance, see Ways to Change View Object Relationships at Runtime.

Ways to Add a View Object Instance to the Data Model at Runtime
About Oracle ADF View Objects
About Oracle ADF Application Modules
About View Object and View Link Instances
Creating a View Object Definition
Accessing a Root-Level Application Module
Finding View Object Instances in the Data Model

 

 

Copyright © 1997, 2004, Oracle. All rights reserved.