Show a new TIWAppForm and then go back to previous one - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: English (https://www.atozed.com/forums/forum-16.html) +----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html) +----- Thread: Show a new TIWAppForm and then go back to previous one (/thread-2500.html) |
Show a new TIWAppForm and then go back to previous one - giorgio_c - 09-04-2021 I guess if I can show a new TIWAppForm from current html page, and then resume back to the first one, mantaing the orignal status. Opening a modal form programmatically by JavaScript in the first one, and then show a new TIWAppForm, on "release" command I get a re-initialized HTML page of the first one, not the previous html page with actual status. RE: Show a new TIWAppForm and then go back to previous one - kudzu - 09-04-2021 Please provide a simple ready to run demo showing this issue. There isnt enough information in this message for us to be able to determine what you are doing in the Javascript. RE: Show a new TIWAppForm and then go back to previous one - giorgio_c - 09-07-2021 (09-04-2021, 08:27 PM)kudzu Wrote: Please provide a simple ready to run demo showing this issue. There isnt enough information in this message for us to be able to determine what you are doing in the Javascript. Create a new IW Application with 2 TIWForm (main form, and secondary form). in the first one create 2 TIWText and a TIWButton, then connect the page to an html template like this: MASTER TEMPLATE Code: <!doctype html> PAGE TEMPLATE Code: <body> The TIWButton click event creates and displays a new secondary TIWForm. Into the second TIWForm put a "close" TIWButton in order to release the page, so the web applicaton go back to the first page. In the first html template, a <button> element shows a Bootstrap modal form. In this modal form (div element) are embedded the 2TIWText element generated by Intraweb and the TIWButton. In this modal form, the TIWButton call the new page. When user click on "close" in this second web page, Intraweb render the first page again from scratch, and the modal form disappears because it was activated by a JavaScript command executed after the IntraWeb page rendering. The only way I found to show the modal form, is adding this code in IWAppFormRender event (first page); Code: procedure TfEdiHome.IWAppFormRender(Sender: TObject); The "openModal" boolean var is initialized to false and then assigned to "true" in Delphi code, when opening the second page. Then create a <script> into the first page html template with this code: Code: <script> This way, Intraweb renders the basic page and JavaScript code activates previous html page status (displays the modal form again). This is a very simple example, in real case I have a DataTables rendered by JavaScript code and others element. I guess if exists a clever way to accomplish the goal to restore the first page status. Maybe this is only a JavaScript area, not Intaweb. Alternatively, if it is possible to insert the rendering of a different TIWForm into the existing page. This way the second page can be injected into a <div> (modal form) of the main page, so not status restore is required at all. RE: Show a new TIWAppForm and then go back to previous one - kudzu - 09-07-2021 Please provide this as a ready to run project in a zip file with a standalone project in it. This will eliminate any mistakes or differences and allow us to help you better. RE: Show a new TIWAppForm and then go back to previous one - Alexandre Machado - 09-10-2021 (09-04-2021, 06:02 PM)giorgio_c Wrote: I guess if I can show a new TIWAppForm from current html page, and then resume back to the first one, mantaing the orignal status. If you have Form1 active and show Form2 from Form1, whenever you release Form2, you will go back to Form1 the way it was before, unless you have destroyed it. If you haven't, it will just work. |