TWO Browser Windows built & controlled with ONE Browser based WASM Application

How can I have a Browser based WASM Application build & use TWO separate browser windows, not Browser Tabs? The main & 1st HTML Window is the Application. When the user has entered all his information & the results computed, the WASM/HTML needs to launch a 2nd HTML page for a Report of the results. The Report WASM needs to use the computational results to build the Report HTML page. A user can then save the Report as an HTML page or use the browser’s ability to save as a PDF Report. When done with the Report, the user will frequently go back to the same Application with all his data still on display, perhaps change one or more things to generate comparison Reports.

The Application saves the user data & the computed results in a file, say Data.pas, which both HTML/WASM’s need to have access to. I probably need the Report/WASM to close the Report Window & update Data.pas for the Application so it will know the Report is done. If the Report Window & thus it’s WASM is not closed, what happens if the Application launches the Report HTML/WASM again? Does my world go to hell? Were it a perfect world, I’d like it to be ONE WASM application able to build, & support 2 different HTML pages. Maybe using separate namespaces but both using a Data namespace for the shared data?

In RemObjects Talk I see references to “Report Builder.” Is that an option, easy to use, & run in a browser based WASM Application? Google does not present anything for “RemObjecsts WASM Report Builder.” An HTML Report page is not hard for me to build including adding an image.

Call window.open - but this won’t work always; it can be blocked by a popup blocker or just open a new tab, depending on the user config of the browser (that is defaulted to open a new tab on almost all browsers).

This is nit my area, but I assume this sound be doable with the Browser APIs provided in Island RTL, either directly or via the DOM model access it provides, In a similar fashion as it would be done from JavaScript itself.

Note that I’m nit sure if the same Wasm instance can be share across windows, or if the second window would need to load its own copy (which then could communicate via the Browser/DOM APIs or local storage, I assume). Again, Web/Browser APIs aren’t my area, so my apologies if this is vague (or even wrong).

No, Report Builder is a third party library for Delphi for creating printable reports from database data.

For the report builder, you could look at SAP Crystal Reports that can do HTML reporting.
But that is not WASM but server side ASP .Net.

Each window will have it’s own WASM instance, with it’s own memory.

To communicate between them, see:

2 Likes

One other tip: instead of using more windows, you can also use overlays:
https://www.w3schools.com/howto/howto_css_overlay.asp

Combined with:
https://www.w3schools.com/howto/howto_js_draggable.asp

This creates your own MDI interface in a browser window.

1 Like

Thanks, This looks good to pursue.

1 Like

Thanks, guys. I need all the help I can get & you guys are providing it! Hope to help others when I’m more experienced w/ WASM.

1 Like