Atozed Forums

Full Version: Async region rendering in TIWBS4Region
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am using Intraweb 15.2.21, Delphi 10.4.1, IWBootstrap 4.
How should I proceed to render a frame in a TIWBS4Region asinchronously?
Is it possible?
May I use frames in the same way I use them in standard Intraweb application?

Thank you,
Davide
Hi Davide,

I use iwbootstrap and not iwbootstrap4 but think your problem is not related to the specific iwbootstrap version.
By default iw15.2.x has ServerController.RenderAsyncEnabled set to True. It's a public property to control the (new) iw async rendering.
This rendering is not compatible with iwbootstrap. iwbootstrap has it's own async rendering logic and both are not compatible.
Set ServerController.RenderAsyncEnabled to False to use iwbootstrap. 
You can also turn it off on a form level: TIWForm.RenderAsyncEnabled.

Search this forum for more related information.

Maybe in the future the iwbootstrap rendering logic will be adapted to be compatible.

And yes you can use frames etc. I use following code to render a modal (tiwbsmodal) window.

Code:
var Dialog: TFrameSelectDocumentOutputDevice;
begin
  // setup dialog for the user
  Dialog := TFrameSelectDocumentOutputDevice.Create(ParentForm);
  Dialog.Name := IWBSGetUniqueComponentName(ParentForm, 'frame');
  Dialog.Parent := ParentForm;

  // <snip> other settings

  Dialog.OnAsyncOK := HandleUserResponse;
end;
(12-28-2020, 12:04 PM)jeroen.rottink Wrote: [ -> ]Hi Davide,

I use iwbootstrap and not iwbootstrap4 but think your problem is not related to the specific iwbootstrap version.
By default iw15.2.x has ServerController.RenderAsyncEnabled set to True. It's a public property to control the (new) iw async rendering.
This rendering is not compatible with iwbootstrap. iwbootstrap has it's own async rendering logic and both are not compatible.
Set ServerController.RenderAsyncEnabled to False to use iwbootstrap. 
You can also turn it off on a form level: TIWForm.RenderAsyncEnabled.

Search this forum for more related information.

Maybe in the future the iwbootstrap rendering logic will be adapted to be compatible.

And yes you can use frames etc. I use following code to render a modal (tiwbsmodal) window.

Code:
var Dialog: TFrameSelectDocumentOutputDevice;
begin
  // setup dialog for the user
  Dialog := TFrameSelectDocumentOutputDevice.Create(ParentForm);
  Dialog.Name := IWBSGetUniqueComponentName(ParentForm, 'frame');
  Dialog.Parent := ParentForm;

  // <snip> other settings

  Dialog.OnAsyncOK := HandleUserResponse;
end;

Hi Jeroen,

I am redesigning a standard HTML/Javascript Intraweb application to create a new IWBoostrap4 one.
Following your instructions I assumed that all async rendering should be managed through a standard page-to-page navigation.
Is it correct?

Just to be sure to design in the better possible way IBWBoostrap permit...

Thank you,
Davide
Hi Davide,

Not sure if I understand your question 'standard page-to-page navigation'.
Maybe a good source of information to see what is possible is the iwbootstrap demo 'IWBSDemo'.
It contains lots of inspiration and information. Also async navigation between pages, showing and handling dialogs and async creating dynamic content.

The one thing that is missing from this demo to get it working in iw15.2.x is disabling the new Intraweb Async Render support.
But it's easy to disable this and get the demo fully working. Add the following line of code to the demo project.



Code:
procedure TIWServerController.IWServerControllerBaseConfig(Sender: TObject);
begin
  RenderAsyncEnabled := False;  // <-- new line


  // existing code
end;


Test it with and without this line of code to test 'Dialogs / Alerts', 'Dinamically create modal dialog from TIWFrame' and see the difference.

With examining this demo I hope you get enough information to get you going on your redesign.