8/15/2008

Ajax Controls for Click Framework

I'm thinking about Ajax integration for Click Framework recently.

For example, see the below page class. If you clicks AjaxRequestButton, Click invokes getAllBooks() using XMLHttpRequest. And getAllBooks() renders a Java object as JSON. AjaxRequestButton generates a HTML button that invokes Ajax.Request of prototype.js.

public class AjaxPage extends AjaxPage {
  public AjaxRequestButton button
    = new AjaxRequestButton("search", this, "getAllBooks");
  
  public AjaxPage(){
    button.addAjaxHandler(
      AjaxRequestButton.ON_COMPLETE, "displayResult");
  }
  
  public boolean getAllBooks(){
    List<Book> books = bookService.getAllBooks();
    renderJSON(books);
    return false;
  }
}
Next example. AjaxSubmit control send Form using Ajax.Request.
public class AjaxPage extends AjaxPage {

  public Form form = new Form("form");
  private TextField keyword = new TextFiled("keyword");
  private AjaxSubmit search = new AjaxSubmit("search", this, "onSearch");
  
  public AjaxPage(){
    form.add(keyword);
    form.add(search);
  }
  
  public boolean onSearch(){
    List<Book> bookList = bookService.search(keyword.getValue());
    renderJSON(books);
    return false;
  }
}
Of course, these controls need more improvement. However I think this concept matches to Click Framework well.

8/14/2008

S2Click: Seasar2 integration for Click Framework

S2Click is Seasar2 integration for Click Framework. Seasar2 is an opensource DI container made in Japan. S2Click adds powerful features to Click.
  • HOT deploy - You don't have to restart application server when you modify your sourcecode.
  • Java5 annotation - S2Click provides some annotations for ease of development
  • Ajax & File download support - The page base class S2ClickPage provides methods to render Ajax & file downloading response.
  • public field handling - You can use public fields instead of setter & getter in many places.
  • Extended controls - S2ClickForm, ToolTip, ConfirmSubmit, AjaxLinks and AjaxButtons
Now, Seasar2 and S2Click focuses to Japanese developers (So documentation is provided with Japanese mainly).

However I will introduce S2Click detailed features in this blog. And also I will feedback these features to Click Framework from S2Click in the feature.

8/03/2008

Click Framework goes to ASF!

There are very good news. Click Framework will join to the Apache Incubator! The proposal has been accepted.

This is the first step of introducing Click Framework to many Java developers. I'll make effort to incubate Click Framework in the Apache Incubator.