how to convert model to relationmodelowner
‎Mar 02, 2021
09:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Mar 02, 2021
09:04 AM
how to convert model to relationmodelowner
Hi
I have model object and want to convert it to relation owner object for weblink. How to get the same?
Labels:
- Labels:
-
Other
- Tags:
- relationowner
- weblink
1 REPLY 1
‎Mar 03, 2021
05:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Mar 03, 2021
05:49 AM
Model is already RealtionOwner because Model extends RelationOwner .. I have not used weblink but in Jlink I would do this:
Model model = session.GetCurrentModel();
RelationOwner relOwner = (RelationOwner) model; //casting model to relation owner, but I suppose you do not have to cast it in javascript because it is dynamically typed language so it will automatically handle inheritence
However I do not have to cast it in Jlink because it already have RelationOwner methods so both of theese is valid:
model.GetRelations();
relOwner.GetRelations();