my dog learned polymorphism*
The moose likes Other Application Frameworks and the fly likes Seam's Javascript and AJAX support Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Seam Watch "Seam New topic
Author

Seam's Javascript and AJAX support

Plamen Alexandrov
Greenhorn

Joined: Mar 02, 2008
Posts: 1
Hi there,

I have a question about integration of new-style Ajax in Javascript and MyFaces framework - note this is a Seam question (being an integration framework). Every time I start up a new WEB 2.0 project - being a Rich Internet Application - I end up writing a lot client side javascript code to improve user experience by both optimization and detailed customization. I'm now convinced that I have to do so - in order to meet certain client requirements. When it comes to Ajax most of the time I need a lot more detailed approach of updating a lot of different small DOM elements as a result of my ajax request, rather than just an area of generated html.

It is not a secret that having a client-side DOM update should always be backgrounded by a server-side update of MyFaces component tree in order to persist your changes after refresh. My question is - how do you achieve this behavior using Seam? I am acquainted of alternative to ASP .NET 3.5 JSON serialization technologies like DWR but I'm more interested on programmatic ease of this kind of updates on the server-side component tree. Another similar question is how do you keep authentication, authorization, long-lived application/request/business process/transaction context in a javascript based remote procedure call on your business method?

I'm not pretty sure that this is the best way to do ajax updates but definitely having only <AjaxZone> taggs is not an option to me.

Have any Ideas or Recommendations - don't doubt to share...
Jason Porter
Ranch Hand

Joined: Apr 26, 2007
Posts: 120
Take a look at RichFaces (http://www.jboss.org/jbossrichfaces/) or ICEfaces (http://www.icefaces.org). These are both JSF component kits, so they will require a JSF implementation (MyFaces or Sun RI). Both of these work nicely with Seam. Others have also had success with Oracle ADF now known as Apache Trinidad.
Dan Allen
Author
Ranch Hand

Joined: Mar 05, 2003
Posts: 164
If you want your Ajax request to result in an updated server-side tree and very fine-grained updates to the page, your best bet is ICEfaces. I like both RichFaces and ICEfaces, but ICEfaces is unique in that it uses a diffing algorithm to only make changes to the page that are actually changes. You don't need any of those "zone" tags because it automatically figures out what to update.

Another similar question is how do you keep authentication, authorization, long-lived application/request/business process/transaction context in a javascript based remote procedure call on your business method?


The beautiful part about using Ajax-based JSF components with Seam is that you don't do anything differently than you do with a non-Ajax application (talking in general terms). Seam doesn't really know that its components are being used over Ajax, so you can do all of your normal authentication, authorization, long-lived application/request/business process/transaction, stuff. The key is that you use a long-running conversation to keep state from one Ajax request to the next.

I cover this question a bit in chapter 7 and chapter 12 is totally dedicated to this topic.


Dan Allen | http://mojavelinux.com | Author of Seam in Action - http://mojavelinux.com/seaminaction
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Seam's Javascript and AJAX support
 
Similar Threads
Seam and Ajax
DWR 2 and MVC web frameworks
Ajax with MyFaces Tree2 component
How do I achieve this solution?
Passing value to JSP from a method in Action class