Nó hoạt động với các ứng dụng JSF và đòi hỏi ít thay đổi mã hiện tại. Ajax4jsf là dễ học, dễ hiểu, và nhiều hơn nữa linh hoạt hơn so với phương pháp tiếp cận thành phần đóng gói sẵn được thảo luận trong Chương 19. Tuy nhiên, Ajax4jsf cũng có những hạn chế của nó. | Simpo PDF Mergepand SplitWegistered Version - http Pros and Cons Ajax4jsf turns regular JSF components into AJAX-enabled components. It works with existing JSF applications and requires little change to existing code. Ajax4jsf is easy to learn easy to understand and much more versatile than the prepackaged component approach discussed in Chapter 19. However Ajax4jsf also has its limitations. Since the AJAX update is based on rerendering JSF components it is difficult to add fancy JavaScript effects you must make extensive changes to the components themselves which as we discussed is not an easy task. Sure you can use the a4j mediaOutput component to render custom graphics but it is slow for animations and other visual effects from the server side. Also since Ajax4jsf uses the same lifecycle as regular JSF it has to submit all JSF state information in each AJAX call. That results in excessive bandwidth usage and slow response when you use client-side state saving in JSF. To fully resolve those issues we must look at solutions that provide tighter integration with JavaScript. That is the topic for the next chapter. From the Library of sam kaplan Simpo PDF Merge and Split Unregistered Version - http 21 I I Direct JavaScript Integration We have discussed two approaches for supporting AJAX in Seam applications. Both require zero JavaScript or XML communication code but they also have some drawbacks. The componentized AJAX UI approach Chapter 19 is easy but you are limited to what the vendor offers. You face a steep learning curve if you want to implement an AJAX-enabled JSF component to render your own custom visual effects or backend logic. The Ajax4jsf approach Chapter 20 works well in the JSF context but it is difficult to implement components with visual effects . drag-and-drops fades pop-ups beyond the standard HTML widgets already supported by the existing JSF components. In addition it is bandwidth-intensive to wrap JSF