|
<< Click to Display Table of Contents >> Navigation: Telegram > 2023 > 06 > 01 > Telegram_2023-06-01T09 |
2023-06-01T09:45:38
I have a tip, try this on The ScriptEvent OnClick is:
type: pre WebApplication.ExecuteJS('ActiveLock();');
IW.FileUploader(\IWFileUploadSource\).startUpload();
language: After the success or error, etc:
type: code WebApplication.ExecuteJS('ReleaseLock();');
2023-06-01T09:46:32
nice. that sounds exactly like what i'm looking for. I'm working on a web template, waiting for the customer to approve the live version. So while i'm waiting i'm tinkering with such things. Excellent advice !
2023-06-01T09:48:54
Jackson said, \It's the wild west out there\, and I suspect he's right. LOL
2023-06-01T09:50:30
I have used a lot template with mixed js, css, etc, etc
2023-06-01T09:52:28
well, it didn't work but isn't that an Apache sort of command ? requiring the seconds to lock ???
2023-06-01T09:52:51
im using \HoldOn.js\ but in this case, it does not work. One second...
2023-06-01T09:53:21
try
HoldOn_Open('Reading Source File...' );
// WebApplication.ExecuteJS('ActiveLock();');
i := IsFileValid( UserSession.FDM_OFAC.FOFAC_SEARCH_FILE );
case i of
-1,0 : UpdateFormLabel( label_uploaded, rsOS_UploadNA, TT_danger, 'text-nowrap' ); // coulndt connect to xlsx xxx
-2 : UpdateFormLabel( label_uploaded, rsOS_UploadEmpty, TT_danger, 'text-nowrap' ); // no rows
-3 : UpdateFormLabel( label_uploaded, rsOS_UploadInvalid, TT_danger, 'text-nowrap' ); // unknown format
end;
finally
// WebApplication.ExecuteJS('ReleaseLock();');
HoldOn_Close ;
end;
2023-06-01T09:53:44
and i'm calling it from this code...
procedure TformBase.HoldOn_Open( sMsg : string );
var
sCmd : string ;
begin
// css and js must be included in template!. \sk-fading-circle\
sCmd :=
' type: link HoldOn.open ({theme:\sk-rect\, ' + #13 +
' message:''' + sMsg + ''',' + #13 +
' textColor:\black\ ' + #13 +
' });';
Usersession.WebApplication.CallBackResponse.AddJavaScriptToExecuteAsCDATA( sCmd );
end ;
procedure TformBase.HoldOn_Close ;
begin
Usersession.WebApplication.CallBackResponse.AddJavaScriptToExecuteAsCDATA('HoldOn.close();');
end;
2023-06-01T09:55:52
when i call \HoldOn('some message')... it works in other places, but not this one. strange. it is truly the wild west out there. My template has the correct html, css, js etc. so nothing wrong there. I simply call the \HoldOn...\ in a try/finally block.... Here's a case where it works....
try
HoldOn_Open( 'Loading Data...' );
UserSession.FDM_OFAC := TdmOFAC.Create( WebApplication );
finally
HoldOn_Close ;
end;
So you think this would be easy. I find myself playing with stuff that normally takes seconds or minutes in a windows app, but days in an IW web app.
2023-06-01T09:58:11
basically the HoldOn just invokes the CustomLockerAnimation ( I dont want the user to think the system is frozen so they start clicking on everything or pressing the refresh button )...
So in one case I'm calling HoldOn while the datamodule is being created, bc it takes a few seconds. In another case, I'm calling HoldOn because after an upload, I read the file and verify that it's a good file ( which takes a few seconds, too ). But when i call HoldOn a second time, the CustomLockerANimation does not show up. Strange to me.
2023-06-01T09:58:20
Maybe you can only call HoldOn once. I dunno.