Hi
How do I start the IWFileUploader upload function in another component's onclick event?
E.g.:
procedure TForm1.IWImageFile1AsyncClick (Sender: TObject; EventParams: TStringList);
begin
[... run IWFileUploader upload function ...]
end;
I am using version IW15.1.22.
Regards
Robert
Hi. Select your IWImageFile, Properties, ScriptEvents, OnClick:
Code:
IW.FileUploader("IWFILEUPLOADER1").selectFile();
(08-03-2020, 07:14 PM)Jose Nilton Pace Wrote: [ -> ]Hi. Select your IWImageFile, Properties, ScriptEvents, OnClick:
Code:
IW.FileUploader("IWFILEUPLOADER1").selectFile();
Hi and thanks for the answer to Robert because I want to do in the same way!
BUT Delphi generates an error:
E2242: 'FileUploader' is not a name of a unit
Something wrong?
Best regards and thanks for answer
Lorbass
This is Javascript, it goes in ScriptEvents.OnClick, not the Delphi OnClick.
(08-05-2020, 03:03 PM)Lorbass Wrote: [ -> ] (08-03-2020, 07:14 PM)Jose Nilton Pace Wrote: [ -> ]Hi. Select your IWImageFile, Properties, ScriptEvents, OnClick:
Code:
IW.FileUploader("IWFILEUPLOADER1").selectFile();
Hi and thanks for the answer to Robert because I want to do in the same way!
BUT Delphi generates an error: E2242: 'FileUploader' is not a name of a unit
Something wrong?
Best regards and thanks for answer
Lorbass
Hi
In javascript, use the name of the TIWFileUploader component on the Form.
More info:
The onAsyncUploadCompleted event of the TIWFileUploader component works only in visible mode.
Currently this code (but I'm still trying to fix it):
UPL: TIWFileUploader; // UPL visible: false
// IWImageFile ScriptEvents "onclick": 'IW.FileUploader("UPL").selectFile();'
...
procedure TModifyConfig.UPLAsyncSelectFile(Sender: TObject; EventParams: TStringList);
begin
UPL.Visible:=True;
end;
...
procedure TModifyConfig.UPLAsyncUploadCompleted(Sender: TObject; var DestPath, FileName: string; var SaveFile, Overwrite: Boolean);
begin
[... fájl műveletek ...]
UPL.Visible:=False;
end;
...
(08-05-2020, 04:58 PM)brsoft Wrote: [ -> ] (08-05-2020, 03:03 PM)Lorbass Wrote: [ -> ] (08-03-2020, 07:14 PM)Jose Nilton Pace Wrote: [ -> ]Hi. Select your IWImageFile, Properties, ScriptEvents, OnClick:
Code:
IW.FileUploader("IWFILEUPLOADER1").selectFile();
Hi and thanks for the answer to Robert because I want to do in the same way!
BUT Delphi generates an error: E2242: 'FileUploader' is not a name of a unit
Something wrong?
Best regards and thanks for answer
Lorbass
Hi
In javascript, use the name of the TIWFileUploader component on the Form.
More info:
The onAsyncUploadCompleted event of the TIWFileUploader component works only in visible mode.
Currently this code (but I'm still trying to fix it):
UPL: TIWFileUploader; // UPL visible: false
// IWImageFile ScriptEvents "onclick": 'IW.FileUploader("UPL").selectFile();'
...
procedure TModifyConfig.UPLAsyncSelectFile(Sender: TObject; EventParams: TStringList);
begin
UPL.Visible:=True;
end;
...
procedure TModifyConfig.UPLAsyncUploadCompleted(Sender: TObject; var DestPath, FileName: string; var SaveFile, Overwrite: Boolean);
begin
[... fájl műveletek ...]
UPL.Visible:=False;
end;
...
Many thanks for answers!
In Version 15.2.10 it works fine - also if FileUploader is invisible!
Sometimes the light is a train.
Dan