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
Expand all | Collapse all

Call egl handler function from external javascript code

Discussion Topic

Discussion TopicFri February 03, 2017 01:35 AM

Discussion Topic

Discussion TopicFri February 03, 2017 02:23 AM

  • 1.  Call egl handler function from external javascript code

    Posted Thu February 02, 2017 02:23 AM

    Hi everyone,

     

    I have a handler that includes an html file. In html file I have a button called "click". In handler I have a function called "clickTest". Is there any way when user clicks on the button, the "clickTest" function be triggered?

     

    Thanks in advance.

    xarlaps


  • 2.  Re: Call egl handler function from external javascript code

    Posted Thu February 02, 2017 10:51 AM

    See if this code helps you ..

     

            box Box{layoutData = new GridLayoutData{row = 1, column = 1, verticalAlignment = GridLayoutLib.VALIGN_TOP, horizontalSpan = 2}
                    , padding = 8, columns = 1, width = "400", marginBottom = 11
                    ,children=[ You_Image,
                        new HTML{ layoutData = new GridLayoutData{ row = 1, column = 1,horizontalSpan = 2 },
                        text=(  
                          "<a href=" + " You_Url..." + " target=\"_blank\">"  
                        + "<img src=" + " You_Url..." + " style=\"width:120px;height:60px;border:0;\">"
                        + "</a> "

                     )}
                     ]} ;

     

    ojomenezes


  • 3.  Re: Call egl handler function from external javascript code

    Posted Fri February 03, 2017 01:35 AM

    No, this doesn't match to my question...

    xarlaps


  • 4.  Re: Call egl handler function from external javascript code

    Posted Fri February 03, 2017 02:04 AM

    Hi xarlaps,

    I can basically think of two ways to accomplish this. You can try them in attached sample project.

    Method one is setting a delegated EGL function in the HTML file, and calling that delegated function whenever the button is clicked. 

    Method two is publishing a message on the infobus whenever the button is clicked, which is captured by the EGL handler.

    Kind regards,

    Guus

    gweis

    Attachments



  • 5.  Re: Call egl handler function from external javascript code

    Posted Fri February 03, 2017 02:23 AM

    Yes, this is what I was searching for. Thanks.

    xarlaps