Displaying View from Another Entity
Let’s say you want to show a view from one entity data form on another. For example, you would like to see on a data form specific details available in a view on a different entity, saving the extra clicks of having to switch from a data form to another one to check those details.
Starting with FintechOS 18.1.10, you can achieve this by using a token on the data form where you want to render the view from the other entity.
Prerequisites
- You have two entities.
- One entity has a view defined (can be the default view) and the other entity has a digital journey or a data form defined.
How to display a view from another entity
- On the entity where you want to render the view from another entity, go to the edit configuration page of the digital journey or data form. Click the UI tab.
- On the left panel of the UI Designer select the Relation Data Template and drag it to the container where you wish to place it.
- After dropping it, click on it to open the right panel and configure it. Select the relation from the drop-down list.
- Replace the relation tag with the token which will render the view from another entity. The token should follow this format: {? EntityName, view: viewName ?}.
- After you finish customizing the view layout, save the data form and the entity.
If you copy/paste the token, the HTML editor might break its formatting and it might not work as intended. We recommend you to either copy/paste the token using a text editor or within the HTML Editor from the Tools menu, select <>Source code and check the token formatting.
The table below describes the token elements you can use when rendering the view.
Token Element | Description |
---|---|
entityName | The name of the entity from which you will render the view. |
view: | The name of the view to be displayed. |
noheader | Does not display the view header. Display the default view from entity FTOS_CMB_AccountType without header using token {? FTOS_CMB_AccountType, view: default, noheader ?} |
nofilter | Does not display the view filtering / search. Display the default view from entity FTOS_CMB_AccountType without filtering using token {? FTOS_CMB_AccountType, view: default, nofilter ?} |
noinsert | Does not display the Insert button on the view toolbar. Display the default view from entity FTOS_CMB_AccountType without the Insert button using token {? FTOS_CMB_AccountType, view: default, noinsert ?} |
nodelete | Does not display the Delete button on the view toolbar. Display the default view from entity FTOS_CMB_AccountType without the Delete button using token {? FTOS_CMB_AccountType, view: default, nodelete ?} |
noexport | Does not display the Export button on the view toolbar. Display the default view from entity FTOS_CMB_AccountType without the Export button using token {? FTOS_CMB_AccountType, view: default, noexport ?} |
norefresh | Does not display the Refresh button on the view toolbar. Display the default view from entity FTOS_CMB_AccountType without the Refresh button using token {? FTOS_CMB_AccountType, view: default, norefresh ?} |
notoolbar | Does not display the view toolbar. Display the default view from entity FTOS_CMB_AccountType without the toolbar using token {? FTOS_CMB_AccountType, view: default, notoolbar ?} |
collapse: | The text displayed as a collapse panel. Display the default view from entity FTOS_CMB_AccountType after clicking on the Name text using token {? FTOS_CMB_AccountType, view: default, collapse: Name ?}. |
data form: | If the entity from which you render the view has multiple forms and you want a specific data form on edit directly from this view, use form: in the token followed by the data form name. NOTE Do not use no insert within the token when using form:. |
insertForm: | If the entity from which you render the view has multiple forms and you want a specific data form on insert directly from this view, use insertForm: in the token followed by the data form name. NOTE Do not use no insert within the token when using data form:. |
Filtering the view results
You can filter the results displayed in the view by using a custom fetch for the view.
Passing default value
If you want to pass a default value for the insert data form, you must use the context.on("goToInsert", function(e){})
function;
context.on("goToInsert", function(e){
var pId = "18352c17-0ca4-4b6d-8037-28510e6186d1"
e.options.defaultVals = "parentId*" + pId;
})
Refreshing the view
If you want to programmatically refresh the view, use the ebs.refreshGrid(gridName)
function.
If no view: is specified, gridName will be the entityName token element.
For {? myEntity ?}
ebs.refreshGrid("myEntity")
If view: is specified, gridName will be the entityName token element concatenated with _ and the view: token element.
For {? myEntity, view: myEntityView ?}
ebs.refreshGrid("myEntity_myEntityView")