EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
  • 1.  includeFile html file in handler

    Posted Sun May 28, 2017 05:03 PM

    Hello everyone,

    I m trying to include an html file in egl handler and when i write  javascript code or jquery in included html file like this:

    $(document).ready(function() {
    var age=document.getElementById("age").value;
          alert("age:"+age);
    });

    and the widget with id " age" is defined in my handler, I get an error document.getElementById(…) is null means that element with id passed to getElementById() does not exist.

    Now with the included file, it's like we have two body tags and and I want the javascript code to be executed after handler load but to be written in included file.

    Is it possible?

     

     

    michaeldefox


  • 2.  Re: includeFile html file in handler

    Posted Thu June 01, 2017 04:47 AM

    Hi,

    we have a similar problem and we also don't found a solution.

     

    Maybe it is a bug.

    If you have found something please share it.

     

    Kind Regards!

    Marcel-D


  • 3.  Re: includeFile html file in handler

    Posted Fri June 02, 2017 04:29 AM

    I  think I have figured it out what's the problem. I changed html file a little bit. I removed body tag in html file and before 
    closing html tag I included this script(see attachment)

     

    These js files now are loaded after page load. 

    I m still getting some errors in the browser's console: 
    1. Refused to set unsafe header "Content-Length"
    2. dojo.js:15 Error: multipleDefine
    but the ui works fine.

    And in some cases if  you want to append another handler after  page load  maybe you ll need to add this code  again  in your second handler.
    script Widget{tagname = "script"};
    script.setAttribute("src", "bootstap.min.js");
    document.body.appendChild(script);
    Hope this helps. I ll try to upload an example.

     

    michaeldefox

    Attachments