What's new? | Help | Directory | Sign in
Google
gwt-masterview
GWT-Masterview is a library that can used to easily create master screens in GWT applications
  
  
  
  
    
Code License: Apache License 2.0
Labels: GWT, ajax, table, web, javascript, java
Show all Featured Wiki Pages:
BasicUsage
Join project
Project owners:
  steam.fade

GWT-Masterview library is an extension to Google Web Toolkit that provides widgets to filter, sort and paginate your data. It's easy to use, it's widgets are fast and it works right out of the box: you can display your objects with just 3-4 lines of code.

Initially I started to look for a replacement to the Displaytag library, which can't be used in pure GWT applications. Some GWT-extending libraries provided tables, but these tables either were just wrappers of external JavaScript toolkits, or didn't have filter or paging functionality. So I wrote my own small library, with API similar to the one that Displaytag has, and named it Masterview, because I find it simple to create master screens using it.

NOTE: The beta is ready. I'll import it into svn in a day or two.

A tutorial on how to start using the library can be found here.

Masterview library has several predefined themes, but default one looks like this (you can read more about using predefined themes or creating your own here):

The main features of the library

you'll write
MasterView masterView = GWT.create(Person.class);
masterview.setItems(people);
masterview.appendColumn(new Column("firstName", "First name", false, "40%");
masterview.appendColumn(new Column("lastName", "Last name", true, "60%");
RootPanel.get().add(masterview);

The limitations of the library

One possible solution (if there is an absolute need to display person's city in a table) is to add getCity() method to Person bean with code like this:
public String getCity() {
    Address address = getAddress();
    if (null == address) {
        return "---"; //or something
    }
			
    return address.getCity();
}
and create the grid's column like this:
MasterView masterView = GWT.create(Person.class);		
masterview.appendColumn(new Column("city", "Person's city", true, "100%");