<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bandos&#039; Arcade &#187; AJAX</title>
	<atom:link href="http://www.nuwanbando.com/tag/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nuwanbando.com</link>
	<description>&#34;It&#039;s not about how it is, but how I see it &#34; - Stranger Than Fiction</description>
	<lastBuildDate>Thu, 02 Feb 2012 08:52:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>YUI file upload with jsp backend</title>
		<link>http://www.nuwanbando.com/2009/07/yui-file-upload-with-jsp-backend/</link>
		<comments>http://www.nuwanbando.com/2009/07/yui-file-upload-with-jsp-backend/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 16:51:29 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=147</guid>
		<description><![CDATA[For last two weeks I was working on some user interface logic and happened to use Yahoo UI library (YUI). The task was to upload an image using Ajax. Since I was new to YUI, I was looking here and there over the net for some references. There were some good ones but thats for [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F07%2Fyui-file-upload-with-jsp-backend%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F07%2Fyui-file-upload-with-jsp-backend%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>For last two weeks I was working on some user interface logic and happened to use Yahoo UI library (<a href="http://developer.yahoo.com/yui/" target="_blank">YUI</a>). The task was to upload an image using Ajax. Since I was new to YUI, I was looking here and there over the net for some references. There were some good ones but thats for PHP back-ends, but mine was a jsp back-end and i didn&#8217;t know how to read the object thrown out from the YUI side.</p>
<p>with some more digging I came across nice file handling library in Apache commons (<a href="http://commons.apache.org/fileupload/using.html" target="_blank">Commons File Upload</a>) and took use of it to do the task. the code is as follows.</p>
<pre name="code" class="html">
<html>
<head>

<script type="text/javascript" src="[PATH_TO_YUI]/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="[PATH_TO_YUI]/connection/connection-min.js"></script>
<script type="text/javascript">
function init(){
  var onUploadButtonClick = function(e){
    //the second argument of setForm is crucial,
    //which tells Connection Manager this is a file upload form
    YAHOO.util.Connect.setForm('testForm', true);

    var uploadHandler = {
      upload: function(o) {
        alert(o.responseText);
      }
    };
  YAHOO.util.Connect.asyncRequest('POST', 'upload.php', uploadHandler);
  };
  YAHOO.util.Event.on('uploadButton', 'click', onUploadButtonClick);
}

YAHOO.util.Event.on(window, 'load', init);
</script>
</head>
<body>
<form action="upload.php" enctype="multipart/form-data" method="post" id="testForm">
<input type="text" id="test"/>
<input type="text" id="test-2"/>
<input type="text" id="test-3"/>
<input type="file" name="testFile"/>
<input type="button" id="uploadButton" value="Upload"/>
</form>

</body>
</html>
</pre>
<p>I took the above code segment directly from a <a href="http://thecodecentral.com/2007/09/04/asynchronous-file-upload-yuis-approach">YUI file upload tutorial</a> hence the credit goes to the author. The jsp back-end using apache commons file upload is as follows.<br />
<span id="more-147"></span></p>
<pre name="code" class="java">
if (ServletFileUpload.isMultipartContent(request)) {
	FileItemFactory factory = new DiskFileItemFactory();

	ServletFileUpload servletFileUpload = new ServletFileUpload(
					factory);
	List fileItemsList = servletFileUpload
					.parseRequest(request);

	String optionalFileName = "";
	FileItem fileItem = null;

	Iterator it = fileItemsList.iterator();

	while (it.hasNext()) {
		FileItem item = (FileItem) it.next();
		if (item.isFormField()) {
		//Other form values
			if (item.getFieldName().equals("test"))
				gName = item.getString();
			if (item.getFieldName().equals("test-2"))
				gUrl = item.getString();
			if (item.getFieldName().equals("test-3"))
				gDesc = item.getString();
		} else {
			contentType = item.getContentType();
			itemSizeInBytes = item.getSize();
			//any operation with the file goes here
		}

	}

}
</pre>
<p>So thats how it goes <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2009/07/yui-file-upload-with-jsp-backend/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Placing DHTML layers over the FLASH content</title>
		<link>http://www.nuwanbando.com/2007/04/placing-dhtml-layers-over-the-flash-content/</link>
		<comments>http://www.nuwanbando.com/2007/04/placing-dhtml-layers-over-the-flash-content/#comments</comments>
		<pubDate>Sun, 08 Apr 2007 05:55:55 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Designing & Development]]></category>
		<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://nuwanbando.com/?p=25</guid>
		<description><![CDATA[Adobe (Macromedia) Flash is one of the technologies we use to add fancy eye catching animations to our web sites. But after the resent development of Ajax, developers tend to blend CSS and JavaScript effects with those flash animations making their sites look more new or rather web 2.0 (ish). For some time i was [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2007%2F04%2Fplacing-dhtml-layers-over-the-flash-content%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2007%2F04%2Fplacing-dhtml-layers-over-the-flash-content%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Adobe (Macromedia) Flash is one of the technologies we use to add fancy eye catching animations to our web sites. But after the resent development of Ajax, developers tend to blend CSS and JavaScript effects with those flash animations making their sites look more new or rather web 2.0 (ish).</p>
<p>For some time i was searching for a method to place DHTML layers over the Flash objects, yet i couldn&#8217;t find an article regarding this matter or rather i didn&#8217;t spend much time sweeping the NET regarding this. How ever For a web site I was doing recently I had to use the <a href="http://www.huddletogether.com/projects/lightbox/">lightbox.js effect</a> But again I met the problem of laying the DHTML layer over my flash content, Luckily in the troubleshooting part in the lightbox web page i found the path directing to the Adobe official site where this problem is wildly discussed.</p>
<p>As it says &#8220;Use the WMODE parameter to allow layering of Flash content with DHTML layers. The WMODE parameter can be &#8216;window&#8217; (default), &#8216;opaque&#8217;, or &#8216;transparent&#8217;. Using a WMODE value of &#8216;opaque&#8217; or &#8216;transparent&#8217; will prevent a Flash movie from playing in the topmost layer and allow you to adjust the layering of the movie within other layers of the HTML document.&#8221;</p>
<p>You can gather more details at <a href="http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_15523">http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_15523</a></p>
<p>Cheers..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2007/04/placing-dhtml-layers-over-the-flash-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is it AJAX or FLASH ?</title>
		<link>http://www.nuwanbando.com/2007/04/is-it-ajax-or-flash/</link>
		<comments>http://www.nuwanbando.com/2007/04/is-it-ajax-or-flash/#comments</comments>
		<pubDate>Sat, 07 Apr 2007 12:14:20 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Designing & Development]]></category>
		<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://nuwanbando.com/?p=24</guid>
		<description><![CDATA[Today I was integrating some eye catching AJAX effects to one of the web sites I was developing, and one of my friend Told me &#8220;Nice Flash Effect&#8221;&#8230;.. I smiled for a moment and thought it really is&#8230; AJAX is Growing So fast that I feel sooner it will beet Macromedia FLASH animation what you [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2007%2F04%2Fis-it-ajax-or-flash%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2007%2F04%2Fis-it-ajax-or-flash%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Today I was integrating some eye catching AJAX effects to one of the web sites I was developing, and one of my friend Told me &#8220;Nice Flash Effect&#8221;&#8230;.. I smiled for a moment and thought it really is&#8230;</p>
<p>AJAX is Growing So fast that I feel sooner it will beet Macromedia FLASH animation what you include in your website. There are many AJAX frame works available to take use of and play with some great Javascript effects. What I was Using today for this perticular site is <a href="http://labs.adobe.com/technologies/spry/">Adobe Spry framework</a> , simply designed with great animations. This framework is so much trying to catch the flash like effects. It&#8217;s a wonderful situation that Current owners of Macromedia is doing such a thing and making the 1st move&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2007/04/is-it-ajax-or-flash/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

