I knew that it's possible insert HTML code in text blocks, but if you can add HTML code then you could embebed JavaScript!!
So, I was investigating and working in it, and I got add JavaScript in my JDE application!!!
Alert JavaScript from JD Edwards |
In some post I read about for 8.90 and later versions you must enable security for it, but in my case I need with JD Edwards 9.2.
Code Example:
evt_HTML_A030
evt_iSegmentID_INT01
evt_Message_ALPH
evt_WebcenterContentLogin_URL
OPT: Using Defaults
0001 //
0002 // Initialize Variables
0003 //
0004 VA evt_HTML_A030 = ""
0005 VA evt_iSegmentID_INT01 = 1
0006 //
0007 // Notify the tool that the Information text block contains encoded text.
0008 //
0009 Encode(FC Text Block 100, VA evt_HTML_A030, VA evt_HTML_A030)
0010 //
0011 // HTML & Javascript Code
0012 //
0013 //
0014 VA evt_Message_ALPH = ""Hello JavaScript!!!""
0015 VA evt_HTML_A030 = concat([VA evt_HTML_A030],"<script type="text/javascript">")
0016 VA evt_HTML_A030 = concat([VA evt_HTML_A030],"function abrirVentana(){")
0017 VA evt_HTML_A030 = concat([VA evt_HTML_A030],"alert(")
0018 VA evt_HTML_A030 = concat([VA evt_HTML_A030],concat([VA evt_Message_ALPH],");"))
0019 VA evt_HTML_A030 = concat([VA evt_HTML_A030],"}")
0020 VA evt_HTML_A030 = concat([VA evt_HTML_A030],"</script>")
0021 VA evt_HTML_A030 = concat([VA evt_HTML_A030],"<button onclick="abrirVentana();">")
0022 VA evt_HTML_A030 = concat([VA evt_HTML_A030],"Alert</button>")
0023 VA evt_HTML_A030 = concat([VA evt_HTML_A030],"<script>")
0024 //
0025 // Add HTML & JS to segment
0026 //
0027 Add Segment(FC Text Block 100, VA evt_HTML_A030, <Default,Default,0,Default>, <No>, VA evt_iSegmentID_INT01)
The next steps will be create my own JavaScript library for separate and organize my JS code, and it allow will be more easier and faster to access JS functions.
Personally, I thint it opens up world of possibilities.
Hi YouLoseBellyFat, great!!!
ResponderEliminargreat
ResponderEliminarThanks!!
EliminarIs it possible to invoke javascript from jde event. I mean without the button in text block.
ResponderEliminarOf course Imran, you can declarate the function and then call it. regards.
EliminarHi there,
ResponderEliminarI tried your code as indicated but it is doing nothing as if it is blocked or secured...Any ideas?
Hi Unknown,
EliminarReview the code with inspect in your browser for check is all ok. But if is ok, try lowering explorer security.
Regards.