Introducing Rogue Wave Server > Introducing Dynamic View Services > Dynamic Views > Using Dynamic Views to Edit Server Objects
 
Using Dynamic Views to Edit Server Objects
You can edit server objects from a component in two ways:
*By using the callback functions defined in the generic representation protocol.
For example, when the label of a TreeItem is edited, a generic callback function has to be called on the representation object to request the server to modify the name of the associated domain or node. The generic protocol also allows you to modify one-to-one relations by directly handling references to representation objects or hyper-references.
*By triggering user-defined callback functions on server objects from a generic callback function defined on the base class of the representation object types.
Collectors
Creating server objects from a component or editing server one-to-many relations requires collectors to be declared when specifying the view type. A collector is a representation attribute identifying a set of homogeneous representation objects that belong to another representation object —for example, TreeItem objects in a Tree representation. Basically, the value of a collector is defined:
*by an access path to a server one-to-many relation, and
*by identifying a representation associated with the relation target objects.
The collector editing functions, as defined in the generic representation protocol, let you add or remove objects in a server one-to-many relation.
Transactions
Interactions between the server and components are controlled by transactions both at the server level and at the component level. Callbacks executed on the component are not sent to the server until the transaction is committed to the component. Only then can a transaction take place on the server.
If one of the editing actions to be carried out on the object fails, the transaction is rolled back to the server, which then notifies the component so that its representations revert to a consistent state.

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.