![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 5 of 5 total |
![]() |
Mon, Jul 30 2018 10:45 AM | Permanent Link |
Mark Brooks Slikware | I have a scenario where I have a "parent" EWB app that contains a TBrowser instance. The parent EWB app updates the TBrowser URL to load one of several "child" EWB apps. I'm using this technique in order to modularise my codebase for a large project and it works really well (so far).
As part of the technique I need to communicate from each of the child EWB apps back to the parent EWB app. I'm using Window,PostMessage to do this and, again, it seems to work really well. However, I have needed to add the PostMessage method into TWindow within WebDOM like this: procedure postMessage(const message: String; const targetOrigin: String); Firstly is this definition correct? Secondly, is there a reason that I should be aware of regarding why it was omitted in the first place? I'm just worried that I get too far down the line and then something goes "BOOM". Many thanks Mark |
Tue, Jul 31 2018 3:16 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Mark,
<< Firstly is this definition correct? >> It's close enough. The 3rd parameter is for transferring objects, which you probably won't need to do. << Secondly, is there a reason that I should be aware of regarding why it was omitted in the first place?>> IE10+, and our base browser is still IE9. Did you also implement an event handler for the messages coming in ? Tim Young Elevate Software www.elevatesoft.com |
Tue, Jul 31 2018 5:44 PM | Permanent Link |
Mark Brooks Slikware | Tim Young [Elevate Software] wrote:
>> Did you also implement an event handler for the messages coming in ? Hi Tim. Thanks for the info. Yes I have an event handler that catches events from the TBrowser-embedded EWB app up in the parent EWB-app, like this: function TrapChildMessage(AEvent: TMessageEvent): boolean; which I attach like this: Window.AddEventListener('message',TrapChildMessage,False); Out of interest, what does the boolean return value signify in TrapChildMessage? Regards Mark |
Mon, Aug 6 2018 2:09 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Mark,
<< Out of interest, what does the boolean return value signify in TrapChildMessage? >> I assume that you mean "AddEventListener" ? The Boolean parameter indicates whether you're defining a "capturing" event handler (True), or a "bubbling" event handler (False). Most of the time, you want this to be False. A "capturing" event handler is triggered as an event is first dispatched from the root element down to the target element. A "bubbling" event handler is triggered as an event is dispatched from the target element outward to the root element. https://stackoverflow.com/questions/4616694/what-is-event-bubbling-and-capturing Tim Young Elevate Software www.elevatesoft.com |
Thu, Aug 9 2018 8:42 AM | Permanent Link |
Mark Brooks Slikware | Got it now - thanks
|
This web page was last updated on Thursday, March 30, 2023 at 10:19 AM | Privacy Policy![]() © 2023 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |