TFrameRequestFeedNew(FrameComp).ProcessCommand(0);
Is called between the CGCallBackDisableAjaxResponse...CGCallBackEnableAjaxResponse
No, in my first demo, TFrameRequestFeedNew(FrameComp).ProcessCommand(0) is called outside of CGCallBackDisableAjaxResponse...CGCallBackEnableAjaxResponse.
I checked with breakpoints.
I use ProcessCommand(0) as event "frame after first show":
delphi code
CreateNewFrameWithoutRender(TFrameRequestFeedNew);
// some work with frame
RenderRegionAsync(wRegionContainer); // Show frame
TFrameRequestFeedNew(FrameComp).ProcessCommand(0); // Frame after show
Other thing, you execute this:
wRegionBottomButtons.AjaxReRender();
In ProcessCommand, for what? You don't need do this on create of frame (check the code).
It's just for example. there is also line: wHTMLEditor.Content := 'test' that leads to same issue, even if wRegionBottomButtons.AjaxReRender() commented.
I suppose that some bug present in Lazy render, but also my code is not perfect.
I'll check, how i can change my code in real project, probably i can avoid issue by improving my code.
Thanks for advice!
cgdevtools_support wrote:hi
As suggestion, would be great if render parameter AAfterLazyLoadJS will also work with old renderer.
This is not needed , since the old method wasn't async in browser, you just have to add to correspondant to AAfterLazyLoadJS , after calling RenderRegionAsync / AjaxReRender
I'm not sure that i understand you
I implemented wrapper for me, to use single call for both render methods:
delphi code
cm_RenderRegionAsync(wRegionContainer, TRenderRegionAsyncMethod.rramDefaultMethod, true, TFrameRequestFeedNew(FrameComp).GetJSInitCode());
delphi code
procedure cm_RenderRegionAsync(ARegion: TIWHTMLContainer; ACGRenderAsyncMethod: TRenderRegionAsyncMethod; ABrowserResize: boolean = false;
const AAfterRenderJS: string = ''; const AAppendToHTMLID: string = '');
var
RenderAsyncMethod: TRenderRegionAsyncMethod;
begin
case ACGRenderAsyncMethod of
TRenderRegionAsyncMethod.rramDefaultMethod:
RenderAsyncMethod := CGRenderAsyncMethod;
TRenderRegionAsyncMethod.rramOldMethod:
RenderAsyncMethod := TRenderRegionAsyncMethod.rramOldMethod;
TRenderRegionAsyncMethod.rramLazyLoadMethod:
RenderAsyncMethod := TRenderRegionAsyncMethod.rramLazyLoadMethod;
else
RenderAsyncMethod := TRenderRegionAsyncMethod.rramOldMethod;
end;
if RenderAsyncMethod = TRenderRegionAsyncMethod.rramOldMethod then
begin
RenderRegionAsync(ARegion, ACGRenderAsyncMethod, ABrowserResize, '', AAppendToHTMLID);
if not AAfterRenderJS.IsEmpty then
CGAddJavaScriptToAjaxResponse(AAfterRenderJS);
end
else
RenderRegionAsync(ARegion, ACGRenderAsyncMethod, ABrowserResize, AAfterRenderJS, AAppendToHTMLID);
end;