This is one of the most useful feature of Tapestry 5.3. There is already a concept of
Zone in Tapestry for Ajax but now it is complimented by
AjaxResponseRenderer. This fills a lot of gaps at least for people coming from Wicket. It is a bit similar to
AjaxRequestTarget but empowered with Zones and JSON. I have compiled a small example demonstrating most of the features.
Tapestry mailing list has a constant flow of newbie questions related to
AjaxFormLoop component. This is a very powerful component but with some limitations that must be understood before using it.
AjaxFormLoop allows, in a limited way, dynamic addition of components to a form. These components are laid out inside the
AjaxFormLoop. Each time the ‘Add New’ link is clicked,
addRow event is triggered. This event requires the event handler to return a new ‘value’ bean. A new row is added to the loop with the given set of components and these components if form fields are bound to the newly instantiated bean.
As Tapestry does not provide a Dialog Box, let us see how difficult(or easy) it is to create one on our own. We will use ModalBox as it has an MIT license and it is written in prototype (Soon this won’t be a criteria for choosing a script as Tapestry is going to be prototype independent). The
ModalBox script is very easy to use. There is a
ModalBox.show() method which displays a dialog box. It takes a dom element and configuration options as parameters. If you want to create a wizard just keep on using the same method inside the dialog box. There is also a
ModalBox.hide() method to hide the dialog. Continue reading