Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
charlesandrews  
#1 Posted : Monday, July 6, 2009 6:20:04 PM(UTC)
charlesandrews

Rank: Newbie

Groups: Member
Joined: 7/2/2009(UTC)
Posts: 4

Hi,

I am evaluating Aurigma image uploader for use in a project, if successful our company will be purchasing a full license for the product. I have been attempting to add an event listener in order that we can use our own buttons for upload. We have been quite easily able to add a button which will trigger the send() event correctly with the code

Code:
<input type="button"  value="Upload" onclick="getImageUploader('Uploader').Send();">

Adding an event listener, we have been using the code

Code:
var iu = getImageUploader('Uploader'); iu.addEventListener('SelectionChange', 'imageselectionchanged()');

And have tried it in both the onLoad() method for the page and a button which is clicked. Both give the error:

"Error: uncaught exception: [Exception... "Not enough arguments [nsIDOMEventTarget.addEventListener]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://macpro.local/upload.php :: onload :: line 1" data: no]"

Do you have any suggestions of how to get this to add this listener? Until this point I have been very happy with the performance and customisation available from this product and would like to see us able to use it in this project.

Regards,

Charles Andrews

Edited by user Monday, July 6, 2009 6:33:55 PM(UTC)  | Reason: Not specified

Fedor  
#2 Posted : Monday, July 6, 2009 6:33:09 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Hello Charles,

Code:
var iu = getImageUploader('Uploader'); iu.addEventListener('SelectionChange', 'imageselectionchanged()');

You can add event listener during control initialization only:

Code:
<script type="text/javascript" src="iuembed.js"></script>
<script type="text/javascript">
function ImageUploaderID_SelectionChange() {
	//...your code...
}
var iu = new ImageUploaderWriter("ImageUploaderID", 610, 500);
//...params...
//...other event listeners...
iu.addEventListener("SelectionChange", "ImageUploaderID_SelectionChange");
//...other event listeners...
iu.writeHtml();
</script>

Please see Image Uploader documentation for more info.

Edited by user Monday, July 6, 2009 6:44:35 PM(UTC)  | Reason: Not specified

Best regards,

Fedor Skvortsov

charlesandrews  
#3 Posted : Monday, July 6, 2009 8:58:37 PM(UTC)
charlesandrews

Rank: Newbie

Groups: Member
Joined: 7/2/2009(UTC)
Posts: 4

I have used PHP to initialize my control, am I right in thinking that I would be unable to add event listeners to a control which has been initialized using PHP? It's not a huge difficulty, though it would require me to go back and rewrite some stuff which I'd rather not do if it is unnecessary.

Regards,

Fedor  
#4 Posted : Monday, July 6, 2009 9:11:33 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
In PHP you can use addClientSelectionChange function:

Code:
<?php
    $imageUploader = new ImageUploader("ImageUploader1", 650, 400);

    $imageUploader->addClientSelectionChange("imageselectionchanged");

    $imageUploader->render();
?>

Edited by user Tuesday, July 7, 2009 12:27:33 AM(UTC)  | Reason: Not specified

Best regards,

Fedor Skvortsov

charlesandrews  
#5 Posted : Monday, July 6, 2009 11:57:12 PM(UTC)
charlesandrews

Rank: Newbie

Groups: Member
Joined: 7/2/2009(UTC)
Posts: 4

Okay, I have got that to work. It seems I have misunderstood what is meant by "selection", I was looking for a way to fire an event when files are checked/unchecked, in order that I can enable, disable a button in response to this and the number of files which have been selected. Is there a listener for filechecked, and a property for the number of items which are currently checked?
Fedor  
#6 Posted : Tuesday, July 7, 2009 12:20:49 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Quote:
Okay, I have got that to work. It seems I have misunderstood what is meant by "selection", I was looking for a way to fire an event when files are checked/unchecked, in order that I can enable, disable a button in response to this and the number of files which have been selected. Is there a listener for filechecked, and a property for the number of items which are currently checked?

You should use ImageUploader.UploadFileCountChange Event to handle file checking/unchecking and ImageUploader.UploadFileCount Property to get count of checked files:

Code:

function imageuploadfilecountchange() {
    alert(getImageUploader("ImageUploader1").getUploadFileCount());
}

Code:
<?php
    $imageUploader = new ImageUploader("ImageUploader1", 650, 400);

    $imageUploader->addClientUploadFileCountChange("imageuploadfilecountchange");

    $imageUploader->render();
?>

Edited by user Tuesday, July 7, 2009 12:27:13 AM(UTC)  | Reason: Not specified

Best regards,

Fedor Skvortsov

charlesandrews  
#7 Posted : Tuesday, July 7, 2009 7:40:40 PM(UTC)
charlesandrews

Rank: Newbie

Groups: Member
Joined: 7/2/2009(UTC)
Posts: 4

This works now which is good, and it is coming along well to some extent. However the uploading which was previously working now seems to have failed for no apparent reason. The java console output is:

08/07/2009 11:36:29 [0x0-0x94094].com.apple.Safari[1293] Status=[ERROR]

08/07/2009 11:36:29 [0x0-0x94094].com.apple.Safari[1293] Progress=[0]

08/07/2009 11:36:29 [0x0-0x94094].com.apple.Safari[1293] ValueMax=[0]

08/07/2009 11:36:29 [0x0-0x94094].com.apple.Safari[1293] Value=[2]

08/07/2009 11:36:29 [0x0-0x94094].com.apple.Safari[1293] [ErrorPage] \

I can't find a documented list of error codes to try to work out what it causing this. The error message "server or proxy not found" appears, but doesnt make sense as the action and redirect URLs have both been checked as working.

Tamila  
#8 Posted : Sunday, July 12, 2009 6:37:07 PM(UTC)
Tamila

Rank: Advanced Member

Groups:
Joined: 3/9/2008(UTC)
Posts: 554

Was thanked: 1 time(s) in 1 post(s)
Hello Charles,

Quote:
08/07/2009 11:36:29 [0x0-0x94094].com.apple.Safari[1293] Value=[2]

It means that URL specified in the Action property was not found. Please check it.

To get more information about error codes you can read the following article:

http://www.aurigma.com/r...ImageUploader.Error.aspx

Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!

Users browsing this topic
Guest
Forum Jump  
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.