Wednesday, August 24, 2005

Using Ajax in a simple JSF Application - Introduction

I am going to start another tutorial on how to integrate Ajax with JSF soon. This is going to be a very simple JSF application with no GIS component. I hope that this could be of some help to GIS and non-GIS JSF developers alike.
Before I talk about this application, here is a nice article that demonstrates how to create a JSF textbox component with auto-complete feature using Ajax technique:
https://bpcatalog.dev.java.net/ajax/textfield-jsf/design.html

The above article discusses how to build a custom component that manages the necessary javascript code and can be easily used in a web page. I have, however, used a different approach to create a similar text box. It is simpler in a sense that it doesn't require you to create a custom TextBox component. The downside though is you will have to manage the Javascript code in the jsp page on your own. So if you do not mind writing/using the javascript code yourself, then you might want to give this a try.

The application that I will be discussing will have a text box to enter a country name. As you type a new character in the text box, it will dynamically get upto 5 matching country names from the server and list those names for you to choose from. Once the text box has the selected country name and you submit the form, it will give you a brief description of that country.
To accomplish the Ajax protion of the application, I have used the third strategy discussed in the following article:
https://bpcatalog.dev.java.net/nonav/ajax/jsf-ajax/frames.html
If you are a GIS Developer and have gone through my previous discussion on Integrating Ajax with ArcGIS Server, the idea is pretty much the same.

If you would like, you can download this application from here. In order to run this application, simply extract the ajax folder from the zip file, put the JSF jar files in WEB-INF\lib folder and deploy it in a servlet container.

Next time, I will discuss the code behind this application. Stay tuned!!

19 Comments:

At 10:57 PM, Blogger Infactahost.com said...

Hey, you have a great blog here! I'm definitely going to bookmark you!

I have a hosting site/blog. It pretty much covers hosting related stuff.

Come and check it out if you get time :-)

 
At 2:58 AM, Blogger Tony said...

I've really enjoyed reading your blog. Very interesting.

My submit article here site has lots of info pertaining to submit article here.

Come visit sometime :)

 
At 5:35 AM, Anonymous Anonymous said...

I downloaded the application, it worked fine, but when i tried doing some experiment on it, i.e, i moved the country.jsp to a folder under ajax/pages, the drop down worked fine when the page was loaded for the first time but then i got a js error once i clicked on the OK button. i was uable to trace the reason, could you please help me in that.

The structure became like this
ajax
|----index.jsp
|----pages/country.jsp
|----WEB-INF
|----js

 
At 9:03 AM, Anonymous Anonymous said...

Hi there!

I am starting to learn JSF and AJAX, your articles teach me lots of detals. I tried to download the application, but the link does not work. Would you kindly email me the example package to
yj1912@gmail.com.

Thank You!

 
At 12:53 PM, Anonymous Find antique dealers said...

Hey, you have a great blog here! I'm definitely going to bookmark you!I have a hosting site/blog. It pretty much covers hosting related stuff.Come and check it out if you get time :-)

 
At 6:05 AM, Anonymous sildenafil said...

Thanks for info the application is giving me some problems I don't why, I'm gonna ask my brother he's better than me on this haha
Thanks for sharing.

 
At 2:33 AM, Anonymous Anonymous said...

[url=http://hoovervacuumbags.weebly.com/]Hoover vacuum bags[/url] http://hoovervacuumbags.weebly.com/

 
At 6:08 AM, Anonymous generic viagra said...

I am very happy for having found this explanation because I was trying to integrate Ajax with JSF, but I didn't get it until I read this. Now I understand how easy it is.

 
At 4:14 PM, Anonymous video surveillance said...

Build a custom component needs to manage javascript code... so I could be a little bit easier to use it in a web page.

 
At 2:27 AM, Blogger hibeyond said...

black boots

Chocolate boots

sand boots

Chestnut boots

gray boots

pink boots

grey boots

pink boots

 
At 1:20 PM, Anonymous buy online percocet said...

You are helping others to grow their knowledge by sharing such a valuable information you have.

 
At 12:59 PM, Anonymous pharmacy said...

Thanks for the tutorial, It will be my first experience with ajax. There are a lot of people have recommended me to do it.

 
At 3:15 PM, Anonymous Generic Viagra said...

I know it is going to be a perfect tutorial because you know exactly what you are saying, and that's perfect because I want to experiment with Ajax because according to you it could be a perfect application and I believe you.

 
At 1:28 PM, Anonymous vrnjacka banja said...

Very well written. You got every point explained. Loved the whole article! Many thanks!
vrnjacka banja smestaj
vrnjacka banja privatni smestaj

 
At 3:46 AM, Anonymous pepa prase said...

I really appreciate sharing this great post. Keep up your excellent work.
bojanke za decu
bojanke

 
At 6:05 AM, Anonymous banja srbija said...

Excellent post. I want to thank you for this informative read. I will bookmark this site and visit again..
Banje u Srbiji
Banje Srbije

 
At 4:59 AM, Anonymous film art said...

I'm really enjoyed reading this article and whole website, thanks a lot for this informations!

 
At 6:12 AM, Anonymous get girlfriend give bj said...

I will bookmark this site and visit again. It is very informative. Thanks for sharing.

 
At 9:38 AM, Anonymous loperamide said...

Nice mini tutorial. Thank you.

 

Post a Comment

<< Home