|
Rank: Member Groups: Member
Joined: 11/15/2007 Posts: 26
|
Hi, Is it possible to set a panel visible when at least one file is uploaded and sets it to false when there's no file uploaded (or the uploaded files are deleted/removed) ? Stan
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi Stan, That can be done but requires some JavaScript programming. You would start a timer and keep checking how many files the uploader has with this function: http://www.essentialobjects.com/ViewDoc.aspx?t=JSDoc.Public.AJAXUploader.getPostedFiles.htmlIt returns an array and when you see the length of the array is zero, you would hide your panel. Thanks
|
|
Rank: Member Groups: Member
Joined: 11/15/2007 Posts: 26
|
Sorry for my ignorance, But in fact I don't know how to check the length of the array. I suppose I have to set an handle to an event (to the AjaxUploader control).
And in the same time, I need to disable the "final" submit button (this one that validates the whole process) when there's no uploaded files and set it to enable where there's at least one uploaded file.
If someone could help me.. :)
Stan
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi Stan, You would want to go over some basic JavaScript stuff. You can probably start from here: http://www.w3schools.com/js/default.aspThose are quite easy with JavaScript but obviously JavaScript is a client side language, so it's vastly different thant server side language you've been using such as C# and VB.NET. Once you know how JavaScript works, you can use the length property of the array to get the length of the array and the disabled property of the button to disable the button. Thanks
|
|
Rank: Member Groups: Member
Joined: 11/15/2007 Posts: 26
|
Hi, In fact my problem is that I can't access the getFilesPosted() function. When I invoke this function I get a message saying this object doesn't support this method or property (french translation). Here's my code : javascript part : var isInterval=false; var uploadObj; function ProgressHandler(uploader, total, received) { if (!isInterval) { isInterval=true; uploadObj=uploader; timer=setInterval("checkFile()",1000); } } function checkFile() {
var postedFiles=uploadObj.getPostedfiles(); if (postedFiles.length>0) { bla bla }
}
From the EO <eo:AJAXUploader id="AJX1" ClientSideOnProgress="ProgressHandler" ...... </eo>
I know how to change the disabled property from a button. My problem is just to know why I can't invoke the getPostedFiles method.
If you could help...
Stan
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
It should be "getPostedFiles", you have "getPostedfiles" in your code. It's case sensitive.
|
|
Rank: Member Groups: Member
Joined: 11/15/2007 Posts: 26
|
sorry I made a mistake while I wrote my code, I use getPostedFiles (in my current work) and I can't access this the method...
|
|
Rank: Member Groups: Member
Joined: 11/15/2007 Posts: 26
|
here the methods that I can see with the uploader object here are the functions available within the uploader setAllowedExtention getAllowedExtension getTransferredFileCount getTotalFileCount getCurrentFileName getSpeed getEtismiatedSecondsRemaining getElapsedSeconds getTransferredBytes getTotalBytes getPercentage setSize setHeight setWidth getOffsetHeight getOffsetWidth unload isLoaded getType
There's no getPostedFiles method or I did something wrong. By the way I use the Stan
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
I am not sure how you get the list. But getPostedFiles is definitely there. It didn't exist in early versions though, so you might want to upgrade to the latest version.
|
|
Rank: Member Groups: Member
Joined: 11/15/2007 Posts: 26
|
Yes.. I suppose it's an earlier version that I have. I m downloading the latest version. but what about the licence key ? mine is : License Key for EO.Web Controls 2007.2 will it work ? Stan
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
The license key is the same.
|
|
Rank: Member Groups: Member
Joined: 11/15/2007 Posts: 26
|
Ok thanks.. (and by the way it works now).. thanks for your support. Stan
|
|