CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

New features in 1.7-2.1, some questions.

General discussion

by Jorge Sousa » 23 Apr 2014 15:54

Actually there was a late change - adding lazyload.js to the page, that moves the script links to the body, which is not totally compatible with Intraweb.

A new version should be released again very soon.

About the ticket, don't worry we don't forget,
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by George » 23 Apr 2014 16:23

cgdevtools_support wrote:A new version should be released again very soon.
About the ticket, don't worry we don't forget,
:D
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by Jorge Sousa » 23 Apr 2014 16:36

Actually what is wrong, from Intraweb side is that when you code this:

StyleSheet.Filename := ExtractFilePath(WebApplicationFileName()) + 'wwwroot\ui-themes\flick\jquery-ui.css';

it generates

this

<div id="submitform_stylesheet"><link rel="stylesheet" type="text/css" href="/ui-themes/flick/jquery-ui.css"></div>

inside the head tag

and ruins the whole page, you can see in browser html inspect, all the script and link tags are moved.

Please report this bug to Intraweb, we already did, and use this code, for now:

procedure TIWMainForm.IWAppFormCreate(Sender: TObject);
begin
PageContext.AddLinkFile('ui-themes/flick/jquery-ui.css');
end;

So in conclusion, we don't have to release an new urgent version just because of this.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by George » 24 Apr 2014 06:55

Thanks!
I prefer to use "HTMLHeaders.Add" in IWServerControllerBaseConfig. Now render works great. Thanks again!
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by George » 25 Apr 2014 08:09

Hi!

Can you suggest, how to call my JS code inside async processing, but after region is completely loaded and css applyed?
delphi code
RenderRegionAsync(wRegionContainer);
CGAddJavaScriptToAjaxResponse('FrameRequestFeedResize();'); // region is not completely loaded (or css not applyed for now), and my js code evaluates incorrect height
// CGAddJavaScriptToAjaxResponse('debugger; $(document).ready( function() {FrameRequestFeedResize();} );'); // not helps too...
Later, when ajax render completed, my function FrameRequestFeedResize() works as expected.
I can show, what i mean:
page_load_pause_before_call_js.png
page_load_ready.png
page_load_ready_scrolled.png
page_load_ready_scrolled_resized.png

Also, code that executed inside CGAddJavaScriptToAjaxResponse not raise js errors even if code is incorrect.
Browser console shows error as log message: Error in processAjaxExecute when evaluating: $(document).ready( falert("test"); )
It's planned behavior?
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by Jorge Sousa » 25 Apr 2014 15:19

Hi George

Today is holiday here, we have minimal services.

Also, code that executed inside CGAddJavaScriptToAjaxResponse not raise js errors even if code is incorrect.
Browser console shows error as log message: Error in processAjaxExecute when evaluating: $(document).ready( falert("test"); )
It's planned behavior?


You must set CGJSErrorHandler:= True, in the main thread only (eg, ServerController.OnConfig), to see a dialog showing errors, if not js errors are handled normally, ie, silently.

For the rest, we answer later, i hope you understand
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by George » 25 Apr 2014 15:26

You must set CGJSErrorHandler:= True, in the main thread only (eg, ServerController.OnConfig), to see a dialog showing errors, if not js errors are handled normally, ie, silently.

I have line CGJSErrorHandler := True; In IWServerControllerBaseConfig...
And i see error dialog in other cases. Even when CGJSErrorHandler = False, browser debug console not handle errors inside CGAddJavaScriptToAjaxResponse, just write error as log message.
Maybe there try catch?

For the rest, we answer later, i hope you understand
Sure, have a nice weekend)
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by Jorge Sousa » 25 Apr 2014 16:32

Hi

Maybe there try catch?


Yes, Intraweb introduced a try / catch a few months ago, in all ajax response handling. Should we talk with them about this?
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by George » 25 Apr 2014 16:46

cgdevtools_support wrote:Hi
Maybe there try catch?

Yes, Intraweb introduced a try / catch a few months ago, in all ajax response handling.

Interesting, how they can explain that.
And how they suppose, we must search bugs in JS code... Lol.
So even if debug JS enabled, we can't debug JS in sort of places.

Should we talk with them about this?
Yep, please..
At this time, i understand, that i should enable JS error window, because users can't understand what happen, why UI not responding and what to do.
When i enable your js error window, users will be able to make screenshot and send bug report. So yes, every error should be handled by your JS error window...
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by George » 01 May 2014 20:47

George wrote:Hi!
Can you suggest, how to call my JS code inside async processing, but after region is completely loaded and css applyed?
delphi code
RenderRegionAsync(wRegionContainer);
CGAddJavaScriptToAjaxResponse('FrameRequestFeedResize();'); // region is not completely loaded (or css not applyed for now), and my js code evaluates incorrect height
// CGAddJavaScriptToAjaxResponse('debugger; $(document).ready( function() {FrameRequestFeedResize();} );'); // not helps too...
Later, when ajax render completed, my function FrameRequestFeedResize() works as expected.
I can show, what i mean:
page_load_pause_before_call_js.png
page_load_ready.png
page_load_ready_scrolled.png
page_load_ready_scrolled_resized.png

Hi!
It's still actual(
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

PreviousNext

Return to General - Archive

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.