The Source for Java Technology Collaboration
User: Password:



Greg Murray

Greg Murray's Blog

Creating AJAX Enabled JSF Components

Posted by gmurray71 on May 25, 2006 at 09:08 PM | Comments (5)

There is a class of applications and developers that Java Server Faces suites well. JSF is well suited for those that do not want to deal with the intricacies of learning CSS, JavaScript, and DHTML. Once a component is properly created it can be re-used. That said getting all the moving parts in order can take some doing.

Including AJAX Functionality in a Custom JavaServer Faces Component shows the Phase Listener approach of JSF component development. This is the approach taken with the Java BluePrints AJAX Components/ whih run in Creator and are also used in the Java Pet Store 2.0. Shale Remoting provides a framework for developing JSF components using this approach.

In this example JSF manages the renders the links to JavaScript. JavaScript renders the view on the client. A phase listener is used to manage AJAX call which update the model contained in session scoped beans. There may be some that do not favor an approach where JavaScript is doing much of the rendering of the view as there is not an exact representation of what is being displayed on the client maintained on the server. With some dynamic UIs, especially those that use existing JavaScript libraries out there, it is difficult to keep and exact representation on the client and server. When JavaScript is dynamically managing the view on the client the component developer needs to consider how the data that the component will be validated, how the component is relates to the components around it, and how chatty the client will be with the server. These issues occur because the phase listener jumps you out of the normal JSF lifecycle processing for processing AJAX requests.

There are other approaches that are being developed on top of JSF 1.2 and for the future JSF 2.0 that will allow for more granular updates to client/server representation of the view transparently using AJAX. This approach allows existing JSF components to use the standard validators and rendering logic and does not require a developer to have extensive knowledge of AJAX. This approach is being developed as part of the JSF Extensions.

Check out the tutorial and let us know aht you think.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment


  • Dear Mr. Greg,

    Why SUN/Java community making “Ajax + Java” so complicated? What happened to all the smart people at SUN, who invented so many good things? Why so many smart people trouble understanding simple logic?

    Please understand the simple logic: All we need to do is invent reusable Ajax GUI classes, which are better than GUI Classes for desktop platform (e.g. Java/Swing). Then it costs less to build superior online graphics intensive application than possible on desktop.

    At Pioneer-soft, we recently published an innovative "recipe" to do just that:
    http://cbsdf.com/technologies/DHTML-Widgets/TECH-Summary.htm

    Although the technology let us build GUI Classes for DHTML components, it would have most impact, when next generation vector graphics such as XAML/Vista or Mozilla/SVG are released.

    It is very hard to create "real" graphics 2D/3D GUI components with out fine-grained control over drawing/animation. Both Microsoft and Google recently came to this conclusion and using SVG on the maps. This trend would continue.

    For example, how is it possible rotating to certain direction or change colors to the GIF image in the following SVG air traffic control application? You need Abobe’s SVG viewer to view the following sample:
    http://cbsdf.com/technologies/jsp/atc_test1a.jsp

    My web site is getting on average 200 hits a day and 1800 full page view a day in the past two weeks. But, still they are having hard time accepting the simple facts. I am wondering why so many smart people trouble understanding such simple logic: All we need is to build better Ajax GUI Classes to leapfrog the desktop platforms. I have given many examples to back this.

    Greg, I have sent you an email before but never heard from you. I need help from SUN. Whom can I contact to become technology partners? Our technology can add huge value to Java. Looking forward to hearing from you!

    Best Regards!
    Raju

    Dear Mr. Greg,

    Why SUN/Java community making “Ajax + Java” so complicated? What happened to all the smart people at SUN, who invented so many good things? Why so many smart people trouble understanding simple logic?

    Please understand the simple logic: All we need to do is invent reusable Ajax GUI classes, which are better than GUI Classes for desktop platform (e.g. Java/Swing). Then it costs less to build superior online graphics intensive application than possible on desktop.

    At Pioneer-soft, we recently published an innovative "recipe" to do just that:
    http://cbsdf.com/technologies/DHTML-Widgets/TECH-Summary.htm

    Although the technology let us build GUI Classes for DHTML components, it would have most impact, when next generation vector graphics such as XAML/Vista or Mozilla/SVG are released.

    It is very hard to create "real" graphics 2D/3D GUI components with out fine-grained control over drawing/animation. Both Microsoft and Google recently came to this conclusion and using SVG on the maps. This trend would continue.

    For example, how is it possible rotating to certain direction or change colors to the GIF image in the following SVG air traffic control application? You need Abobe’s SVG viewer to view the following sample:
    http://cbsdf.com/technologies/jsp/atc_test1a.jsp

    My web site is getting on average 200 hits a day and 1800 full page view a day in the past two weeks. But, still they are having hard time accepting the simple facts. I am wondering why so many smart people trouble understanding such simple logic: All we need is to build better Ajax GUI Classes to leapfrog the desktop platforms. I have given many examples to back this.

    Greg, I have sent you an email before but never heard from you. I need help from SUN. Whom can I contact to become technology partners? Our technology can add huge value to Java. Looking forward to hearing from you!

    Best Regards!
    Raju

    Posted by: rajuch on May 28, 2006 at 02:15 AM


  • Hi Raju and others, the purpose of the tutorial here was to show how to create re-usable AJAX enabled components that work well with Java. There are many ways to user Java and AJAX depending on what you want to do. If you want the most nuts and bolts type access you can use a Serlvet Using AJAX with Java shows this approach. Using an Ajax enabled component is not that diffucult either. See the BluePrints JSF Components which includes videos on how to use the JSF AJAX components. Lastly there is Project jMaki which provides a large set of AJAX enabled components which may be used as JSF components or JSP tags. All these solutions are not complicated and they are available today.

    Posted by: gmurray71 on June 06, 2006 at 07:59 PM

  • Guys Be Informed !!!
    Cbsdf.com is back with a new Ajax FRAUD
    I am unable to understand what Raju and cbsdf guys are trying this time.But few years back these frauded (rigged) the XML-J 2002 awards and stole it from OpenOffice, ( Cocoon and Batik as well).

    Back then the company name was Elansoft and product was Agileblox
    http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=104875540622555&w=2

    The below is an old google cached page,

    http://66.102.7.104/search?q=cache:fdWESVpaqC8J:weblog.halogenlabs.com/%3Fp%3D86+Elansoft+cocoon&hl=en&gl=in&ct=clnk&cd=1&client=firefox-a

    For this and other business malpractices and sleaze, a complaint ,p>was lodged with FBI and Elansoft closed US office and ran from the law.

    http://www.zdnetasia.com/builder/program/dev/talkback.htm?PROCESS=show&ID=20024225&AT=39062710-39000408_39000406_39000407_39000409_39000410_39000412_39000411_39000413_39000404_39000400_39000402_39000401_39000403_39000405c

    I feel, since they escaped FBI last time so easily, they are trying to do it once again

    Posted by: mohanraogs on June 21, 2006 at 01:25 AM

  • Guys Be Informed !!!
    Cbsdf.com is back with a new Ajax FRAUD
    I am unable to understand what Raju and cbsdf guys are trying this
    time.But few years back these frauded (rigged) the XML-J 2002 awards and stole it from OpenOffice, ( Cocoon and Batik as well).

    Back then the company name was Elansoft and product was Agileblox
    http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=104875540622555&w=2

    Here is an old

    google cached page
    For this and other business malpractices and sleaze, a complaint
    was lodged with FBI and Elansoft closed US office and ran from
    the law.

    Java forums discussion of victims
    www.zdnetasia.com article


    I feel, since they escaped FBI last time so easily, they are trying to do it once again

    Posted by: mohanraogs on June 21, 2006 at 01:35 AM

  • Hi, I need to develop dynamic tables that support sorting, editing, deletion of rows using JSF and Ajax. Can anyone provide some pointers on how to accomplish this? Would it need a custom component or can it be done on top of the existing h:datatable?

    Can you provide some guidelines on how to resolve this in JSF? I cannot find any resources for this. Thanks

    Posted by: popcorn09 on September 25, 2006 at 12:14 AM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds