JQuery event trigger result in WebWork 2.2.x and Struts2, Part 2

In my last post I showed you how to create a JQuery result type for Struts and WebWork 2.2.x. This post will illustrate how to make use of the result. You will need 3 JSPs: an editor page, a list page, and a “container” page. The container page will typically contain some wrapper-type HTML, a link to add an object and other data that is essentially static in this context. The list page displays the list of objects, and the editor page contains the editor form and its fields.

The container page has divs that will contain the list and the editor. The contents of each div come from AJAX requests for actions that render the list and editor pages upon success. We also bind the document the refreshList event that we defined as the “success” result in part 1 to refresh the list when the page is loaded or the editor dialog is closed. We can also define a delete action that maps success to this event to delete objects from the list and display the result.

This is a summary of how to hook this up. I had originally intended to include code samples and such but I wasn’t sure they would make a whole lot of sense out of context, so I scrapped that idea. Maybe if there is some interest I’ll put together some sample code. Let me know if you’re interested in seeing examples!

jed Jed Prentice is a senior software engineer who has been developing business applications in a variety of industries long enough to have seen a lot of trends come and go. He is an expert in the field of object-oriented software development specializing in distributed systems and web applications written in Java and the practice of agile development methodologies.

Hi!
I find very interesting this post because I’m planing to implement something very similar.
Did you finally uploaded the code anywhere?
Thanks in advance

It has proven difficult to come up with god sample code out of context, but at some point I will try to post some.