Chapter 10. Rich components and Ajax


In this chapter:

  • Using Ajax components and behaviors to create responsive web UIs
  • Contributing JavaScript and CSS to the <head> section with header contributors
  • Integrating third-party JavaScript libraries in your custom components
  • Gotchas when using Ajax in your applications

Chapter 8 introduced you to creating custom components with Wicket. In the second half of that chapter, we developed a discount-list component, which consists of multiple panels and has different modes of operation (list, edit/delete, and add).

This chapter is about rich components, which typically means widgets that have richer behavior than basic ones in HTML. Examples are lists where you can reorder elements by dragging and dropping them, maps that load data in the background when you scroll, and text fields that provide a list of suggestions while you type.

The term rich components can apply to components that use anything from DHTML (typically HTML + JavaScript + CSS) to Flash to Java applets, and so forth. This book focuses on DHTML because it has the broadest support of all the options.

In this chapter, we’ll explore a few things that will enable you to create killer components. You’ll learn about the different ways in which you can enrich your components using JavaScript, CSS, and packaged resources, and you’ll learn how to use and extend Wicket’s Ajax capabilities.

10.1. Asynchronous JavaScript and XML (Ajax)

10.2. Header contributions

10.3. Ajaxifying the cheese discounts

10.4. Creating your own Ajax components

10.5. Gotchas when working with Wicket and Ajax

10.6. Summary