Java, JSP, JSF, Struts, Hibernate and Ajax from an everyday life. Nothing serious just some thoughts.
May 4, 2008
Dynamic tables with JMesa
JMesa is a very useful open source project.It is a dynamic HTML table that allows you to edit, filter, sort, paginate and export your data. By my opinion it is a really cool and useful tool for development a java web applications. Here is a simple and fast tutorial and example.
What do you need to run this tutorial?
1. JDK, JMesa requires 1.5 or above, I recommend 1.6
2. IDE - I'll use my favorite eclipse
3. JMesa latest
4. JQuery, JMesa requirement, prefer the latest version
5. I'll use Struts
OK, now what to do. Extract the jmesa archive and create new web project. Put jmesa.jar on your WEB-INF/lib directory. Put the JavaScript, CSS and image files in the corresponding folders. For me that would be /scripts, /styles and /images. For the data bean I'll use simple class Framework
public class Framework {
String name;
String url;
String license;
Boolean like;
public Framework(String name, String url, String license, Boolean like) {
this.name = name;
this.url = url;
this.license = license;
this.like = like;
}
public String getName() {
return name;
}
public String getUrl() {
return url;
}
public void setName(String name) {
this.name = name;
}
public void setUrl(String url) {
this.url = url;
}
public String getLicense() {
return license;
}
public Boolean getLike() {
return like;
}
public void setLicense(String license) {
this.license = license;
}
public void setLike(Boolean like) {
this.like = like;
}
}
Our framework action or servlet must set the data collection, in our case it will do something like this:
Framework jquery = new Framework("jQuery", "http://jquery.com", "MIT & GPL", true);
Framework mootools = new Framework("Mootools", "http://mootools.net/", "MIT License", true);
Framework gwt = new Framework("Google Web Toolkit", "http://code.google.com/webtoolkit/", "Apache License", false);
Framework dojo = new Framework("Dojo", "http://dojotoolkit.org/", "BSD & AFL", false);
Framework prototype = new Framework("Prototype", "http://www.prototypejs.org/", "MIT License", false);
ArrayList frameworks = new ArrayList();
frameworks.add(jquery);
frameworks.add(mootools);
frameworks.add(gwt);
frameworks.add(dojo);
frameworks.add(prototype);
request.setAttribute("frameworks", frameworks);
And our framework.jsp file:
And thats it. Our jmesa table is ready to be shown on public. Simple, easy and fun.
Subscribe to:
Post Comments (Atom)
Popular Posts
-
I’ll continue my article about JQuery Effects - with this one. It would be short information on how to make custom JQuery slideshow animati...
-
This tutorial tries to provide fast and easy instructions on getting started with Hibernate. You can download Hibernate from http://www.hibe...
-
I receive this nasty error yesterday and it took me some time to figure out the problem. This line passes without any problems $client = n...
-
JMesa is a very useful open source project.It is a dynamic HTML table that allows you to edit, filter, sort, paginate and export your data....
-
This would be simple and easy tutorial on how to use Apache Struts in Java web projects. What do you need for this tutorial? Java Tomcat...
-
Here is one fast and simple example on how to do FTP file uploads with PHP. < ? php $ ftp_server = "ftp.server.url" ; $ ...
-
This question is somewhat painful for me. Maybe I am too stupid. Anyway, if you want to make tar archive without using exec, for example on ...
-
JQuery is a lightweight JavaScript framework that got a lot of attention lately so I decided to write few rows about it. This post-tutorial...
-
You can use JQuery Effects in many different ways. I'll write few examples just to show how cool and fun is to work with this API. Usi...
-
Fast and easy Hibernate example-tutorial (Part 1) In the first part of this tutorial we met the basic functionality of Hibernate. We store a...
5 comments:
Hi,
I am trying to use JMesa as i need to make a POC for the same, if it comes out to be simple...may be we can use it in future projects. But the issue is that i am not getting good help from anywhere...i am reading the documentation. Some more information can be very useful.
Please take out some time to explain more. Are you using JMesa as well for some application ?
Yep, I use JMesa in some projects. I'll try to write some more when I have enough time.
boss why r u fooling people wher is ur jmesa code.
Hi,
Is there any option to change the filter cell?? Since the filter cell looks like textbox, filter option is not obvious to the user.. Can anybody help me If its possible to change it.
Excuse me, can you say more about this row?
(request.setAttribute("frameworks", frameworks);)
Where you defined request object.
Post a Comment