Retrieving a business object from a view interaction

Article ID: 2370
Last updated: 29 May, 2018
Article ID: 2370
Last updated: 29 May, 2018
Revision: 3
Views: 555
Posted: 22 Nov, 2006
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

How do I retrieve a business object from a view interaction?

Answer

In the case of the network and equipment views, as both of them extend IlpGraphView and as ItcCompositeGraphic implements IlpGraphic, you can use the  method IlpGraphView::getRepresentationObject(IlpGraphic yourIltcCompositeGraphic).getIlpObject().

As the tree and table views do not have to deal with IlpGraphic, the business objects can be retrieved through their IlpGraphicView implementation. This interface offers two methods to retrieve the representation objects:

  • IlpGraphicView.getRepresentationObject(IlpPoint viewLocation), which returns the IlpRepresentationObject at the given position in this object.
  • IlpGraphicView.getRepresentationObjectSelectionModel(), which returns the IlpRepresentationObjectSelectionModel. You can use the getSelectedRepresentationObject()method of this interface to retrieve the representation object.

In general, as IlpGraphView implements IlpGraphicView, both of the above methods can also be employed to retrieve the business object from a representation object with any of the actual JTGO views using: SomeJTGOView.getRepresentationObjectSelectionModel().getSelectedRepresentationObject().getIlpObject().

IMPORTANT COMPATIBILITY NOTE: The method getRepresentationObject() is public and supported at the IlpGraphic (interface) level, but not at the IltcCompositeGraphic(implementation) level. So the graphic object should be manipulated at the IlpGraphic level and not at the IltcCompositeGraphic level. This means that, wherever the customer gets his graphic instance from, he should not cast it to IltcCompositeGraphic, but to an IlpGraphic. This will ensure that the code stays compatible in future versions of JViews TGO.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2370
Last updated: 29 May, 2018
Revision: 3
Views: 555
Posted: 22 Nov, 2006 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Also listed in


Others in this category