Atozed Forums

Full Version: TIWFileUploader
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

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,
Hi Mikey, you can do:
Hello JNP,

Whoa !
I will test it on Monday…

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

I've tested :


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

With best Regards
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):


Where IWFILEUPLOADER1 is the name of your IWFileUploader component.

but I can't get that to work either Confused
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:

In JS they are NOT, yet both are valid syntax. In JS these are BOTH valid, but are DIFFERENT:

Use this one. It calls the method.

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.
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.
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.
Hi guys. I have a TIWFileUploader with ButtonVisible := False; and a TIWButton with in ScriptEvents[onClick] this code: IW.FileUploader("IWFILEUPLOADER").selectFile();