Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I start the IWFileUploader upload function in another component's click event?
#1
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
Reply
#2
Hi. Select your IWImageFile, Properties, ScriptEvents, OnClick:
Code:
IW.FileUploader("IWFILEUPLOADER1").selectFile();
Reply
#3
(08-03-2020, 07:14 PM)Jose Nilton Pace Wrote: Hi. Select your IWImageFile, Properties, ScriptEvents, OnClick:
Code:
IW.FileUploader("IWFILEUPLOADER1").selectFile();

Big thanks! Smile
Reply
#4
(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
The way to success is always under construction ... but i see a light at the end of the tunnel  Idea Big Grin
Reply
#5
This is Javascript, it goes in ScriptEvents.OnClick, not the Delphi OnClick.
Reply
#6
(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;
...
Reply
#7
(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!
The way to success is always under construction ... but i see a light at the end of the tunnel  Idea Big Grin
Reply
#8
Sometimes the light is a train.   Tongue Big Grin

Dan
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)