Hyper-References
A hyper-reference is a sort of hypertext link that identifies a view of a given Server object. Clicking on a hyper-reference opens the related view. A hyper-reference is a representation attribute whose value is defined by:
An access path to a Server object. This access path must follow only unary relations. If no access path is defined, the hyper-reference is said to be local. A local hyper-reference is a hyper-reference that points to the same Server object as the one that is associated with the representation containing the hyper-reference.
A dynamic-view type identifier.
The target object in the access path must be of the same type as the main origin of the dynamic-view type or of a subtype. This identifier can be void, in which case no dynamic view type is associated with the hyper-reference.
An expression of type
string that is used to represent the hyper-reference.
In the following example, the item representation associated with Line possesses two hyper-references, label and inputNode:
view DomainView:
...
subscribe Line:
represent MatrixItem item:
HyperRef label={LineView,"..."};
HyperRef inputNode={input->NodeView,input.name};
The label hyper-reference lets you open the view LineView. This hyper-reference is local and is represented by the string "...".
The inputNode hyper-reference lets you open the view NodeView whose main origin will be the target of the input relation, that is a Node object. This hyper-reference is represented by the name of the Node.
A hyper-reference selection is notified to the server by the callback function IlsRpObject::onDereference. Selecting a hyper-reference causes the view it identifies to be opened if this view is not already open on the component side or if you forced it to be re-opened.
When a hyper-reference has no associated dynamic-view type, it cannot be dereferenced. To test whether a hyper-reference can be dereferenced, you have to pass the value IlsEditRights::HREF_SELECT to the function IlsRpObject::isEditable.
Just as with editing references, editing a hyper-reference means modifying the target of the associated relation. As a consequence, a hyper-reference can be edited only if a modifier was defined for the relation. A local hyper-reference cannot be edited.
A hyper-reference can be assigned to another hyper-reference, provided that both point to Server objects with compatible types (see the member functions IlsRpObject::onUpdate and IlsRpObject::isMatchingHRef).
On the server side, this assignment operation is interpreted as replacing the target object of the access path.
A reference to a representation object can also be assigned to a hyper-reference. See the member functions IlsRpObject::onUpdate and IlsRpObject::isMatchingRef. Such an assignment has the same semantics as the assignment of a hyper-reference.
The label of a hyper-reference can be edited in the same way and under the same conditions as a representation attribute of type IlsString.
Note: To test whether the label is editable, you must pass the value IlsEditRights::HREF_LABEL to the function IlsRpObject::isEditable. |
Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.