Tag Archives: ajax

Tapestry 5.3+ New Features : Part 2

AjaxResponseRender

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.
Continue reading

Advertisements

Tapestry & AjaxFormLoop

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.

Continue reading

A Modal Dialog For Tapestry

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

Tapestry Magic #2: Ajax with Graceful Degradation

@XHR

In Tapestry5, both Ajax & non-ajax event handlers are simple methods and a single method can be used to handle both requests. This is particularly useful in case a browser does not support javascript or javascript is disabled. On the client side, Tapestry5 gracefully degrades to a non-ajax call. If we make a small adjustment to our event handler method, we can handle both ajax and non-ajax calls on the server side and make a graceful degradation on server side too.

Continue reading

%d bloggers like this: