100
Views
10
Comments
Solved
How to implement this code snippet in Outsystems?
Question
Application Type
Reactive

I'm new to healthcare domain and I am experimenting with a few things and need a working example, if someone can help. This seems to be a simple HTML but when I try to replicate this in Outsystems it just doesnt work

Need some help in replicating https://codesandbox.io/s/viewer-script-tag-tprch?file=/index.html into an Outsystems App page experience

2022-04-19 13-20-22
Andrea Lembo
Solution

Hi @ARS ,

I've attached an OML file with:

-Custom Block OHIF ( The onready event load the scripts and the onrender execute the script 

window.OHIFViewer.installViewer)

-The Home page show the block

Warning: this viewer is a single page App, so pay attention to the url that you set on "routerBasename" inside the javascript.

Br,

AL

OHIF.oml
UserImage.jpg
ARS

Interesting! When I download the oml and try to run as-is it throws an error which says

Cannot read properties of Undefined (reading 'installviewer')


It seems like something is trying to access the properties prior to the definition. @Andrea Lembo how did you get it running? Am I missing something here?

2022-04-19 13-20-22
Andrea Lembo

Hi,

In the OnReady Action of the block there is this action:

Can you check from your browser dev console if the file is correctly loaded?

UserImage.jpg
ARS

aah! you are absolutely right @Andrea Lembo Content Security Policy issue...! gotcha...let me work this out and I shall post an update soon

2022-04-19 13-20-22
Andrea Lembo

The require script inside the oml point to an extenal file ("https://unpkg..."), but you can download the entire file save it inside the scripts folder in the module and use it as Required Scripts for the block.


UserImage.jpg
ARS

@Andrea Lembo did the required change and got ahead 1 step. However, it looks like I cannot make changes to the CSP settings in my personal environment :(

UserImage.jpg
ARS

@Andrea Lembo since I'm unable to run your oml in my environment (due to my restrictions), can you confirm the behavior for me please.

Unlike the code sandbox, the Outsystems app does render the OHIF experience but the viewport is ever expanding. If you look at the bottom right of the image that gets loaded in the center canvas, you can see the zoom level increasing without any command being issued.

Is that the case at your end too?

2022-04-19 13-20-22
Andrea Lembo

Yes, I confirm that weird behaviour

UserImage.jpg
ARS

Fixed it! I think its due to the responsive nature of Outsystems. I just set the container height to 80vh and job done, atleast for now!!

Many thanks @Andrea Lembo for all your prompt responses. Marking your initial one as solution. Thanks

2022-08-03 04-32-50
Ravi Punjwani

Hi ARS,

Can you elaborate what issue are you facing in generating such page?

From primary view, it seems a normal web page (dark theme) with a table/grid in the content area. The grid offers row total count, filtering, sorting, paging etc.

These requirements seem pretty normal from my perspective. What issue are you exactly facing here?

2022-04-19 13-20-22
Andrea Lembo
Solution

Hi @ARS ,

I've attached an OML file with:

-Custom Block OHIF ( The onready event load the scripts and the onrender execute the script 

window.OHIFViewer.installViewer)

-The Home page show the block

Warning: this viewer is a single page App, so pay attention to the url that you set on "routerBasename" inside the javascript.

Br,

AL

OHIF.oml
UserImage.jpg
ARS

Interesting! When I download the oml and try to run as-is it throws an error which says

Cannot read properties of Undefined (reading 'installviewer')


It seems like something is trying to access the properties prior to the definition. @Andrea Lembo how did you get it running? Am I missing something here?

2022-04-19 13-20-22
Andrea Lembo

Hi,

In the OnReady Action of the block there is this action:

Can you check from your browser dev console if the file is correctly loaded?

UserImage.jpg
ARS

aah! you are absolutely right @Andrea Lembo Content Security Policy issue...! gotcha...let me work this out and I shall post an update soon

2022-04-19 13-20-22
Andrea Lembo

The require script inside the oml point to an extenal file ("https://unpkg..."), but you can download the entire file save it inside the scripts folder in the module and use it as Required Scripts for the block.


UserImage.jpg
ARS

@Andrea Lembo did the required change and got ahead 1 step. However, it looks like I cannot make changes to the CSP settings in my personal environment :(

UserImage.jpg
ARS

@Andrea Lembo since I'm unable to run your oml in my environment (due to my restrictions), can you confirm the behavior for me please.

Unlike the code sandbox, the Outsystems app does render the OHIF experience but the viewport is ever expanding. If you look at the bottom right of the image that gets loaded in the center canvas, you can see the zoom level increasing without any command being issued.

Is that the case at your end too?

2022-04-19 13-20-22
Andrea Lembo

Yes, I confirm that weird behaviour

UserImage.jpg
ARS

Fixed it! I think its due to the responsive nature of Outsystems. I just set the container height to 80vh and job done, atleast for now!!

Many thanks @Andrea Lembo for all your prompt responses. Marking your initial one as solution. Thanks

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.