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

Notification

Icon
Error

Options
Go to last post Go to first unread
cyberlogi  
#1 Posted : Saturday, July 22, 2006 10:26:46 AM(UTC)
cyberlogi

Rank: Member

Groups: Member
Joined: 7/22/2006(UTC)
Posts: 3

Hi, i'm relatively new to aurigma and can't quite figure out how to only load the applet when i need it. I have a page on my site that is both viewable and editable. This page uses the image uploader to handle image uploads, however, only about 10% of my users actually edit anything, so it doesn't make sense to load the applet for the other 90%.

I am looking for an example/solution for using an html anchor tag/button to call a javascript function that loads the applet only if a user makes that action.

I.E.

The page loads without the applet

The user clicks a button [upload images]

The applet loads

You can get a feel for what i mean @ http://trippert.dreamhosters.com/post.php?id=10

Username: test Password: password

Thanks for the help

-matt

Fedor  
#2 Posted : Sunday, July 23, 2006 1:48:51 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)
It is no problem to create Image Uploader dynamically:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Aurigma Image Uploader - Basic Demo</title>

	<script type="text/javascript" src="../iuembed.js"></script>

	<link href="style.css" type="text/css" rel="stylesheet" />

	<script type="text/javascript">

function createImageUploader(){
	//Create JavaScript object that will embed Image Uploader to the page.
	var iu = new ImageUploaderWriter("ImageUploader1", 650, 400);

	//For ActiveX control full path to CAB file (including file name) should be specified.
	iu.activeXControlCodeBase = "../ImageUploader4.cab";
	iu.activeXControlVersion = "4,0,33,0";

	//For Java applet only path to directory with JAR files should be specified (without file name).
	iu.javaAppletCodeBase = "../";
	iu.javaAppletCached = true;
	iu.javaAppletVersion = "2.0.35.0";

	iu.showNonemptyResponse = "off";

	//Configure appearance.
	iu.addParam("PaneLayout", "OnePane");

	//Configure URL files are uploaded to.
	iu.addParam("Action", "upload.aspx")

	//Configure URL where to redirect after upload.
	iu.addParam("RedirectUrl", "gallery.aspx")

	
	document.getElementById("divImageIploader").innerHTML = iu.getHtml();
}
	</script>

</head>
<body>
	<input type="button" value="Upload" onclick="createImageUploader()" />
		
	<div id="divImageIploader"></div>	

</body>
</html>

It will works fine for Java version, however with ActiveX we will have some problems during initial installation:

1. User clicks upload button:

UserPostedImage

2. IE dynamically loads control. Browser blocks it and shows warning in information panel. User clicks on information panel:

UserPostedImage

3. Page is reloaded. User clicks second time upload button:

UserPostedImage

4. IE installs controls.

UserPostedImage

As you see the problem is in page reload which requires user to click 2nd time on Upload button. You can try to find the workaround for it using scripting, however I recommend you to load control at first time without dynamic approach.

Edited by user Monday, December 21, 2009 2:42:30 AM(UTC)  | Reason: Not specified

Fedor attached the following image(s):
dynamic_1.png
dynamic_2.png
dynamic_3.png
Best regards,

Fedor Skvortsov

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.