Page 1 of 1
Why isn't EJS taking over?
Posted: Wed Dec 09, 2020 7:06 pm
by zeddave
I followed the example (1) for EJS within an HTML container. I had the "html" as "This is a test = <%= LEVEL1_TEXT %>", and the "user defined data" as LEVEL1_TEXT. But, the end result renders exactly that I have in the "html" variable. "This is a test = <%= LEVEL1_TEXT %>". I've used EJS in the past, outside profound, and it appears that EJS isn't being recognized and not properly templating the contents. I do see the /ejs/ejs.min.js file being loaded. So, I'm just wondering what else I could be missing. Thanks.
Re: Why isn't EJS taking over?
Posted: Fri Dec 11, 2020 3:45 pm
by Scott Klement
I created a display file like this:
- ejsdisplay.png (2.95 KiB) Viewed 1760 times
I set TESTME to 'Hello' then EXFMT my screen. The 'Hello' was printed in the HTML container (as well as the output field) as expected. I'm not sure what you're doing differntly, but it seems to work fine for me.
Re: Why isn't EJS taking over?
Posted: Fri Dec 11, 2020 5:07 pm
by zeddave
Thanks, Scott. Oddily enough, when I created a brand new program and display file it worked properly. The problem, that I was experiencing, was with a display file that was converted to Rich Display. Thanks, again.
Re: Why isn't EJS taking over?
Posted: Fri Dec 11, 2020 7:31 pm
by Scott Klement
Hmmm... I don't see why it'd matter if its a converted screen or not.
It looks like Emily from our Support team reached out to you yesterday asking for some additional information. Make sure you follow-up with her, and she'll take good care of you.
Re: Why isn't EJS taking over?
Posted: Fri Dec 11, 2020 9:43 pm
by zeddave
I believe I was able to figure out the problem, and it's when I use the "longName" for the "user defined data" variable.
When I use a “longName” of “level0_text”, the “fieldName” is “LEVEL00001”, and the EJS fails.
But, when change the variable name to just ‘level0” (which means the fieldName remains “level0”), then the EJS will work.
Also, I did send this to Emily.
Thanks, Scott.
David