Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Intraweb Async procedures Question



Permlink Replies: 13 - Last Post: Dec 5, 2017 1:09 AM Last Post By: Frank Krätzig
Frank Krätzig

Posts: 10
Registered: 12/29/17
Intraweb Async procedures Question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 29, 2017 1:08 AM
Hello and thanks for reading my Post. Just arrived new here, but I already started devoloping with Intraweb for my Company many years ago, so I'm not quite a newbie ;)

so, first of all, of course i searched the web and this forum for answers, but nothing did match, so here's my question.

I am working with Intraweb Version 14.1.14 - An update to the Latest version would be possible, if nessesary.

Right now im exploring ASYNC function in Intraweb (again) but unfortunatially something always seems to go wrong. I Try to explain.
Whenever i Use ASYNC capabilities of the Intraweb, the Program Logic is Fully complete, and the code does what it should do.

But the problem is, that the Website doesn't render the changes correctly, until Full page refresh (pressing f5 possible, too)
Here's an example - the links will guide you to the pictures.

TIWButton A is clicked, TIWButton A has the task to refresh the TIWGrid B below:

[Picture A|https://drive.google.com/file/d/1rc95XrpN-AFqLIcWzJx8YA9VQ8Yhj1PP/view?usp=sharing]

After Button A is clicked, via OnAsyncClick Method, the grid below is completely refreshed - almost like it should:

[Picture B|https://drive.google.com/file/d/10dN7egkgF92OpFgF08BlUp8JV7Ah2TAy/view?usp=sharing]

The Problem here, is the rendering of the grid, seems like it's lost lots of attributes on the way.
If i press f5 or another button or a (non-Async) Function, witch causes a full page refresh, the grid remains intact again, Like in Picure A.

It seems that Intraweb somehow doesn't collect the property of the IW Elements, wich should be re-rendered after the async job. How can I Force Intraweb to refresh a certain part of the Website. If that is what it takes to correct the view, i am willing to insert a bit of code for that components, like

IWGridB.RenderNew;

so that the components rendereing stays intact without refreshing the whole page.

I am considering to render the nessecary property completely from css to avoid thiss mess - hope this wopn't be nessecary

Edited by: Frank Krätzig on Nov 29, 2017 1:09 AM

Edited by: Frank Krätzig on Nov 29, 2017 1:10 AM

Eitan Arbel

Posts: 508
Registered: 2/24/13
Re: Intraweb Async procedures Question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 29, 2017 6:40 AM   in response to: Frank Krätzig in response to: Frank Krätzig
hi Frank

you just hit one of the key differences between Sync and Async operations.

both Sync and Async operations do almost the same things.
but...
in Sync operations, there is (among a few other things) a full refresh, or what we call a "Full Submit", and that is why you see the "rotating wheel", and the refresh is good and full.
in Async, sometimes not everything is refreshed and you need to do it "manually", but the results on the page are very fast and looks intuitive like in a Desktop application.

there are several ways to do it, but i found only 1 thing that can really refresh the page correctly.
"Refresh", "Update" and "ForceAlign", are iw command, but if you use the CGDevTools package then there is RenderRegionAsync(YourRegion); which is really great in refreshing the specific Region you want.

also, if you have the TMS package, and use the TIWAdvWebGrid, there is a procedure "AsyncUpdateAllCells".

both CGDevTools and TMS are very recommended to have when using intraweb.

in intraweb 17, things will be MUCH better and different
Dan Barclay

Posts: 889
Registered: 11/9/03
Re: Intraweb Async procedures Question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 29, 2017 10:06 AM   in response to: Frank Krätzig in response to: Frank Krätzig
Frank Krätzig wrote:
Hello and thanks for reading my Post. Just arrived new here, but I already started devoloping with Intraweb for my Company many years ago, so I'm not quite a newbie ;)

so, first of all, of course i searched the web and this forum for answers, but nothing did match, so here's my question.

I am working with Intraweb Version 14.1.14 - An update to the Latest version would be possible, if nessesary.

Right now im exploring ASYNC function in Intraweb (again) but unfortunatially something always seems to go wrong. I Try to explain.
Whenever i Use ASYNC capabilities of the Intraweb, the Program Logic is Fully complete, and the code does what it should do.

But the problem is, that the Website doesn't render the changes correctly, until Full page refresh (pressing f5 possible, too)
Here's an example - the links will guide you to the pictures.

TIWButton A is clicked, TIWButton A has the task to refresh the TIWGrid B below:

[Picture A|https://drive.google.com/file/d/1rc95XrpN-AFqLIcWzJx8YA9VQ8Yhj1PP/view?usp=sharing]

After Button A is clicked, via OnAsyncClick Method, the grid below is completely refreshed - almost like it should:

[Picture B|https://drive.google.com/file/d/10dN7egkgF92OpFgF08BlUp8JV7Ah2TAy/view?usp=sharing]

The Problem here, is the rendering of the grid, seems like it's lost lots of attributes on the way.
If i press f5 or another button or a (non-Async) Function, witch causes a full page refresh, the grid remains intact again, Like in Picure A.

It seems that Intraweb somehow doesn't collect the property of the IW Elements, wich should be re-rendered after the async job. How can I Force Intraweb to refresh a certain part of the Website. If that is what it takes to correct the view, i am willing to insert a bit of code for that components, like

IWGridB.RenderNew;

so that the components rendereing stays intact without refreshing the whole page.

I am considering to render the nessecary property completely from css to avoid thiss mess - hope this wopn't be nessecary

Edited by: Frank Krätzig on Nov 29, 2017 1:09 AM

Edited by: Frank Krätzig on Nov 29, 2017 1:10 AM


Hi Frank,

There is a flag that may solve your problem. Within your async code, set the DoRefreshControl flag to true:

IWGridB.DoRefreshControl:=true;


Note that this is a flag, NOT a property that stays set, so you will need to set it during the async code. The grid should render, and the flag will be reset by IW. Give that a try. I'm not certain from your description, but I believe it will take care of it.

Dan
Frank Krätzig

Posts: 10
Registered: 12/29/17
Re: Intraweb Async procedures Question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 30, 2017 2:05 AM   in response to: Frank Krätzig in response to: Frank Krätzig
Hello, and thanks so much for the answers.

so, i found that doRefreshControl Works for the grid, THANKS!!.

unfortunateley it doesn't work with TIWTreeView - or am i doing something wrong?
EDIT!!! I tried it with anoter tree view, it worked there. HM perhaps my code is wrong - is it known, that the doRefreshControl sometimes fails in some cases?
Im working with TIWFIleUploader, and as soon i want to finish my upload, in "AsyncUploadCompleted", i want to refresh my TIWTreeView .

To describe what i wanna do: Simply add an an item....

2) Is there a possibility to force full page refresh in async procedures`?

EDIT2!!!! ok i did the rerfresh in the AsyncUploadSuccess and that worked.... !?!?
perfect, but my goal is reached. thanks!

Edited by: Frank Krätzig on Nov 30, 2017 2:23 AM
Frank Krätzig

Posts: 10
Registered: 12/29/17
Re: Intraweb Async procedures Question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 30, 2017 4:36 AM   in response to: Frank Krätzig in response to: Frank Krätzig
Hello and thanks so much for the answers.

one more:

How can i show a "loading" - like animation, while i run my async procedures..

My favorite would be to set the caption of a button to loading .. and set it back when finishing.
Eitan Arbel

Posts: 508
Registered: 2/24/13
Re: Intraweb Async procedures Question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 30, 2017 6:04 AM   in response to: Frank Krätzig in response to: Frank Krätzig
if you need the rotating wheel, then why not just run it in sync?

in sync you won't need to worry about the rotating wheel, and refresh
Frank Krätzig

Posts: 10
Registered: 12/29/17
Re: Intraweb Async procedures Question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 30, 2017 6:23 AM   in response to: Eitan Arbel in response to: Eitan Arbel
ok thanks for the inspiration, perhaps you are just right. I just wanted to customize this a bit more...
for now, okay, i have bigger problems:

Look at these two pictures... a bit background, this is a very complex iw application with many components and frames.
On the following Pitures, you see just an excerpt:

I just switched a fiew procedures to async now, but i still get rendering problems, "dorefreshcontrol" doesn't help, besides, the "effects" are rather strange because no visibility changes have been made code-wise.

Picture a : an async button click:

https://drive.google.com/file/d/1KBKuaNils0wuuaIIRMfeGeElgR5Q6nxG/view?usp=sharing

Biture b: the button disappears with no reason! - no visibility involved.

https://drive.google.com/file/d/1A1XL6tH5Z12zBULWLrNcm972XCstgROZ/view?usp=sharing

again, a full page refresh fixes the problem, or pressing f5, how you want it.
By cheking the HTML code, it is clearly visible that the button wich is disapeared also disapeared in the html code....

can anyone tell me why there are ASYNC Procedures, wich glich on such a heavy way? What is wrong here? of course im a programmer myself, so im asking myself, is that an general IW problem or am i doing things completly wrong.

Eitan Arbel

Posts: 508
Registered: 2/24/13
Re: Intraweb Async procedures Question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 30, 2017 9:59 AM   in response to: Frank Krätzig in response to: Frank Krätzig
Sync and Async operations were not invented by AToZed\intraweb, and i think that these known issues also happen in other web dev systems and apps.
i too have refresh problems sometimes, and after i try several things, i choose if it would be best to do it in Sync or Async...

do you have the CGDevTools package?
their RenderRegionAsync is REALLY good and can save you a lot of trouble.

if you don't have the CG pack, then try Refresh, Update, ForceAlign, Invalidate.
but in case you have refresh problems you can't fix, i would suggest you to be lazy like me, and do it in Sync... :D
Frank Krätzig

Posts: 10
Registered: 12/29/17
Re: Intraweb Async procedures Question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 1, 2017 1:59 AM   in response to: Eitan Arbel in response to: Eitan Arbel
Thanks so much all of you, thanks for answering and clearing things up. I thought so, that this whole thing isn't really well-engeneered tho i understand the complexity of this whole topic and that those things arent quite easy to accomplish.

hope this will be fixed soon, but i think such problems occure in those basic layers, wich can only be changed if the whole concept will bechanged, wich has to be done trough reinventing the whole code ;)

tanks a lot guys, perhaps i'll try this package!

Edited by: Frank Krätzig on Dec 1, 2017 2:06 AM
Eitan Arbel

Posts: 508
Registered: 2/24/13
Re: Intraweb Async procedures Question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 1, 2017 7:30 AM   in response to: Frank Krätzig in response to: Frank Krätzig

hope this will be fixed soon, but i think such problems occure in those basic layers, wich can only be changed if the whole concept will bechanged, wich has to be done trough reinventing the whole code ;)

intraweb 17 is about to come in just a few more months.
it's not an enhanced iw14, but a whole new system, that will truly revolutionize web development.
stay tuned, and i'm sure you will be amazed :D
Frank Krätzig

Posts: 10
Registered: 12/29/17
Re: Intraweb Async procedures Question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 4, 2017 3:04 AM   in response to: Eitan Arbel in response to: Eitan Arbel
Eitan Arbel wrote:
intraweb 17 is about to come in just a few more months.
it's not an enhanced iw14, but a whole new system, that will truly revolutionize web development.
stay tuned, and i'm sure you will be amazed :D

Thanks so much,
do you have more information on Release Date, and how much code is to change with this update ? ;)

Jose Nilton Pace


Posts: 122
Registered: 5/15/98
Re: Intraweb Async procedures Question
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 4, 2017 3:53 AM   in response to: Frank Krätzig in response to: Frank Krätzig
Frank, about the IWDBGrid, DoRefreshControl := True;, you do a workaround that works for me. Maybe solve for you too:
   IWGridB.DoRefreshControl := True;
   WebApplication.CallBackResponse.AddJavaScriptToExecute('$(''#TBLIWDBGRIDB'').attr(''style'', '''');');

Note: Name of dbgrid is all capitalized and include #TBL before the name of your DBGrid.
Chad Hower

Posts: 613
Registered: 3/2/07
Re: Intraweb Async procedures Question [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 4, 2017 9:48 AM   in response to: Frank Krätzig in response to: Frank Krätzig
On 12/4/2017 7:04 AM, Frank Krätzig wrote:
do you have more information on Release Date, and how much code is to change with this update ? ;)

First half of 2018. IW17 will import and run IW14 code unchanged or
nearly so.
Frank Krätzig

Posts: 10
Registered: 12/29/17
Re: Intraweb Async procedures Question [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 5, 2017 1:09 AM   in response to: Chad Hower in response to: Chad Hower
Thanks Chad!

Soi just to close this off, i solved my problems with .RepaintControl; and cometimes with .DoRefreshControl := true;

thanks you all!
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02