PDA

View Full Version : Extjs with JSF and Facelets



Tod
28 Sep 2010, 2:35 PM
I need to add some functionality using Extjs to an existing application that is JSF and Facelets based. For example, I need to be able to retrieve JSON data from a JSF Managed Bean. I've searched the forum and a found a few posts and suggestions, but the suggestions are all dated. Is there a recommended approach? My search so far has found vague references to using Shale to expose the beans, using Lilya (links seem to be dead), or using a Phase Listener (see http://http://www.sencha.com/forum/showthread.php?38115-JSF-1.2-and-ExtJS-the-simple-way ). The Extjs is needed because the client needs to do a lot of data manipulation strictly on the client, and then pass the data back to the server for processing on demand.

Thanks for any help you can provide!
-Tod

surfyogi
28 Sep 2010, 10:49 PM
Personally, I think you will find these two architectures so diametrically opposed that nobody here has an opinion.

Keep in mind, Ext is the antithesis of JSF. One sez, client is an after-thought, I don't know javascript. Ext is just the opposite, client is ALL, server is a data provider/pipe.

If I were you, start moving away from JSF, and use something like Ext.Direct or DWR to expose the beans to the client. If you security model allows... and then start planning on abandoning JSF (sacrilege!) and moving away from it over time. All your server need do is provide JSON data, and process submits to the database, some server-side validation, and you are done.

Tod
30 Sep 2010, 4:40 AM
I understand your perspective. My problem is the existing application is very JSF centric and we just need a page or two that is ExtJS based. I'll look into Ext.Direct and DWR but it would be great to hear from somebody who has done this recently and can lesson my pain! Thanks.
-Tod