Skip to main content

ADF RoaR

Posted by jhook on September 8, 2005 at 2:30 PM PDT

Ruby on Rails: love it or hate it, but it does have a lot of fresh ideas.

One of the really great things that RoR has done is presented AJAX functionality in an easy to use API. John Reynolds provided a nice list of AJAX/JavaScript sites in one of his last blog entries, one of which was script.aculo.us. The site includes RoR AJAX examples with source code. While light weight, I was suprised to see that much of the grunt work in some of that functionality was delegated to another freely available JavaScript library, called Prototype. So what RoR is able to do is just generate a couple method calls to Prototype's excellent AJAX API to make requests to other pages. Hmm. Don't you think a developer could do the same with a JSP tag or a Struts action without much effort at all?

Oracle's ADF Framework

I started asking around to see if JSF had any of that functionality in relation to components and AJAX. The idea of refreshing any component on the page. By clicking a button or pressing a key, it will go out and auto complete or change/valdidate text on the fly auto-magically. It seems do-able, but how come no one's done it yet? Well, Oracle did do it and I am really impressed with what they call 'partial-page rendering' or PPR within their ADF JSF Component Framework.

  • Any ADF ActionSource (such as a button) can invoke an action method on any bean without leaving the page: <af:commandButton action="#{bean.method}" partialSubmit="true"/>
  • Any ADF EditableValueHolder (such as a checkbox or input tag) can take part in auto validation or updating a bean on the fly like so: <af:inputText valueChangeListener="#{bean.doRefresh}" autoSubmit="true"/>
  • Here's the coolest part, you can even 'listen' for other events within the page and refresh on those too:
    <af:commandButton text="Refresh Some Things" partialSubmit="true" id="refresh"/>
    <af:outputText value="#{oneValue}" partialTriggers="refresh"/>
    <af:outputText value="#{anotherValue}" partialTriggers="refresh otherRefresh"/>

There's a lot more functionality within the ADF framework and their releases have deployable wars that show off all this. They also came out of the gates with Facelets support for their EA19 release a couple weeks back, so you would be able to use ADF along side all of those templating features from Facelets.

Conclusion

While JSF doesn't have the components yet to provide the visual candy that RoR has in demonstration, from a practical application standpoint, Oracle's ADF Component framework is a already there. One thing to take note is that Oracle's ADF library didn't have to delegate rendering to separate page as in some of the RoR demos at script.aculo.us. ADF really blows away the traditional request/response constraints that web developers are so familiar with while being able to provide a richer experience for users.

What I would like to explore is enhancing the concept of PPR within Facelets' stateless architecture. I think there's a lot of opportunity there to really blur the lines between a page and a component within the JSF architecture as a whole.

Related Topics >>