Home arrow JavaScript arrow Page 5 - JSP Libraries and AJAX
JAVASCRIPT

JSP Libraries and AJAX


In the first part of this article we learned about AJAX techniques and using AJAX with PHP and JSP. In this part we will try to use some advanced JSP tag libraries to develop feature-rich web applications using AJAX.

Author Info:
By: Mamun Zaman
Rating: 4 stars4 stars4 stars4 stars4 stars / 14
August 29, 2007
TABLE OF CONTENTS:
  1. · JSP Libraries and AJAX
  2. · AjaxTags Tags
  3. · jMaki
  4. · jMaki widgets
  5. · jMaki Menu, Data Table and More

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
JSP Libraries and AJAX - jMaki Menu, Data Table and More
(Page 5 of 5 )

The following code example shows how easy to create a multi-level Yahoo-like menu.

<a:widget name="yahoo.menu" value="{menu: [ 
        { label:'Must Read',
        menu: [ 
        { label:'Slashdot', url:'http://www.slashdot.org' },
        { label:'dev.java.net', menu: [ 
        {label : 'jMaki',url:'http://ajax.dev.java.net'}, {label : 'Glass',url:'http://glassfish.dev.java.net'} 
        ] }
        ]
        }, 
        { label:'Click me for fun!',style:{strongemphasis:true} },
        { label:'Disabled!',style:{disabled:true} },
        { label:'Yahoo!', url:'http://www.yahoo.com' },
        { label:'Sun Microsystems', url:'http://www.sun.com',style:{checked:true} },
        { label:'Oracle', url:'http://www.oracle.com' }
        ]}" />

Here is the output.

Using the Yahoo Datatable widget, you can create a nice sortable data table like the one here.

The code generates this output is:

<a:widget name="yahoo.dataTable" args="{
       
columns :[
       
{title : 'Company', width : 200, locked:false},
       
{title : 'Price', width : 75, renderer: 'usMoney'}, 
        {title : 'Change', width : 75, renderer: 'change'}, 
        {title : '% Change', width : 75, renderer: 'pctChange'}, 
        {title : 'Last Updated', width : 85, renderer: 'italic'}
        ]}"
        value="[
        ['A Co',71.72,0.02,0.03,'9/1 12:00am'],
        ['B Inc',29.01,0.42,1.47,'9/1 12:00am'],
        ['C Group Inc',83.81,0.28,0.34,'9/1 12:00am'],
        ['D Company',52.55,0.01,0.02,'9/1 12:00am']
        ]" />

A Yahoo like calendar can be added using the following tag.

<a:widget name="yahoo.calendar" />

You can also add a nice dialog box like this one into your code by just dragging the Yahoo Dialog widget from palate.

Here is the code generated by dragging.

<a:widget name="yahoo.simpledlg"/>

We can change the properties of this dialog box by clicking the jMaki button at the top middle of Netbeans IDE.

Here it is:

A window will be opened if you click the jMaki button.

I changed text value to 'Are you sure?' then clicked OK. The source code will be changed automatically. You can change other arguments also.

<a:widget name="yahoo.simpledlg" args="{text:'Are you sure?'}" value="{}"/>

And the modified dialog box is as below.

You can also add Google Search or Yahoo Search by simply dragging and dropping. You can add a Google Map to your web application. You can add menus, calendars, trees, an editor, an editable table and lots of other cool widgets to your web application very easily. Install it and give it a try; you will definitely love the experience.

I tried to describe different Ajax techniques in this article. There are lots of other techniques. Try them and then decide which one suits your requirements.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
JAVASCRIPT ARTICLES

- More Top jQuery Tutorials for Beginners
- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 2 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials