Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIWFileUploader
#1
Hello, 

I would like to simulate a mouse clic event on a TIWFileUploade component…

I should use the OnAsyncClick… :

IWFileUploader1.OnAsyncClick(IWFileUploader1, EventsParams);

For the sender I use the IWFileUploader1 name of the component, But for the EventsParams, I Don't know what to use …
If place a Stringlist I've created It return me an error…

It is possible to simulate a mouse clic for this compents ? If yes, where I can found a sample, Please ?

With Best regards,
Mikey
Reply
#2
Hi Mikey, you can do:
Code:
IWFileUploader1.selectFile;
Reply
#3
Hello JNP,

Whoa !
I will test it on Monday…

Big thank you !
Have a nice Week-end.
With best Regards,
Mikey
Reply
#4
Hello JNP,

I've tested :

IWFileUploader1.selectFile;

But this doesn't simulate the clic on the IWFileUploader1 component…

With best Regards
Mikey
Reply
#5
In my experience "IWFileUploader1.selectFile;" only works on IE not on Chrome. In my search for a solution I've come across this....

Quote:Use this JavaScript on IWButton's ScriptEvents property (onclick event):

IW.FileUploader("IWFILEUPLOADER1").selectFile();

Where IWFILEUPLOADER1 is the name of your IWFileUploader component.

but I can't get that to work either Confused
Reply
#6
This is a JavaScript issue. JS is a horrible language and this particular part has caused me a LOT of bugs in 17 which often take a long time to track down.

In Delphi these are the same:
xObj.MyMethod();
xObj.MyMethod;

In JS they are NOT, yet both are valid syntax. In JS these are BOTH valid, but are DIFFERENT:
IWFileUploader1.selectFile();
IWFileUploader1.selectFile;

IWFileUploader1.selectFile();
Use this one. It calls the method.

IWFileUploader1.selectFile;
This one does NOT call the method. It instead returns the method "pointer". But since its not being assigned, JS just retrieves the "pointer" and then immediately discards it.
Reply
#7
Hi kudzu,

Many thanks for your answer but I'm afraid that didn't help. Incidentally that selectFile method works fine in IE both with and without the brackets but neither variant works in Chrome. I'm using intraweb 14.2.9, perhaps that's relevant?

Thanks for your help.
Reply
#8
IE is totally non standard. What it does or not is never a good bar to use. I dont think this has to do with IW version. Off the top of my head selectFile is a JS built in function not anything provided by IW.

I will ask Alexandre to take a look at this thread, but just as something I saw in searching try .click() instead of selectFile(). I didnt dig into it or test this, just based on some threads I saw on other forums.
Reply
#9
Hi guys. I have a TIWFileUploader with ButtonVisible := False; and a TIWButton with in ScriptEvents[onClick] this code: IW.FileUploader("IWFILEUPLOADER").selectFile();

   
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)