Welcome Guest Search | Active Topics | Sign In | Register

AjaxUploader Question Options
Stan92
Posted: Monday, February 18, 2008 12:31:48 AM
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
eo_support
Posted: Monday, February 18, 2008 6:14:27 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
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.html

It returns an array and when you see the length of the array is zero, you would hide your panel.

Thanks
Stan92
Posted: Saturday, February 23, 2008 3:32:39 AM
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
eo_support
Posted: Saturday, February 23, 2008 6:00:49 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi Stan,

You would want to go over some basic JavaScript stuff. You can probably start from here:

http://www.w3schools.com/js/default.asp

Those 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
Stan92
Posted: Saturday, February 23, 2008 6:22:23 AM
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

eo_support
Posted: Saturday, February 23, 2008 6:26:37 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
It should be "getPostedFiles", you have "getPostedfiles" in your code. It's case sensitive.
Stan92
Posted: Saturday, February 23, 2008 6:28:52 AM
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...
Stan92
Posted: Saturday, February 23, 2008 6:42:16 AM
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
eo_support
Posted: Saturday, February 23, 2008 7:00:45 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
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.
Stan92
Posted: Saturday, February 23, 2008 7:06:38 AM
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
eo_support
Posted: Saturday, February 23, 2008 7:12:03 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
The license key is the same.
Stan92
Posted: Saturday, February 23, 2008 7:13:52 AM
Rank: Member
Groups: Member

Joined: 11/15/2007
Posts: 26
Ok thanks.. (and by the way it works now).. thanks for your support.
Stan


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.