best solution for partial page refresh

2006-02-09 Thread Rogers Reilly

Hi,

I've been looking into different ways to partially refresh a JSF page 
(actually a Facelets page) to get more responsive components (datagrids, 
etc.), and have come up with a few options.  Thought I'd see if anyone 
on this list had strong opinions on one versus the others.  I'm willing 
to do client-side JS if necessary, but ideally the solution would be as 
simple as adding an attribute in a JSF-ish tag.


Here's what I've found:

1) ADF Faces.  Jacob Hookom did a blog entry in September with the 
following code snippet from Oracle's ADF:


af:commandButton action=#{bean.method} partialSubmit=true/
af:commandButton text=Refresh Some Things partialSubmit=true id=refresh/
af:outputText value=#{oneValue} partialTriggers=refresh/
af:outputText value=#{anotherValue} partialTriggers=refresh otherRefresh/

This is exactly what I'm looking for (assuming there are af:datagrid, 
af:xxx components for all the regular components), but I wasn't sure 
whether or not the donated Oracle components include this partial 
refresh capability.  I've heard some components are only available in 
the commercial release ... is this one of them?


2) ajaxanywhere http://ajaxanywhere.sourceforge.net/.  A pretty clean 
way to designate parts of the page to refresh.  This project looks like 
an option, but it does seem like triggering the partial refresh requires 
you to call an ajaxanywhere-specific JS function--which is not a 
dealbreaker, but less nice than the ADF method.  My sense is I could 
definitely make this work if the other two options aren't feasible yet.


3) JSF Avatar.  Not much info out there about Avatar, but it seems to be 
a Sun-powered extension of JSF that allows you to designate a 
ProcessingContext, so that JSF can organically create just the 
components that're asked for by an AJAX request.  This one is 
conceptually appealing, but it seems very nascent and I'm not sure how 
usable it is.  (only available in a Glassfish container?  I need 
something I can drop into Tomcat or Resin)  I've read that the 
server-side piece is implemented somewhere at Sun, and I'd be willing to 
homebrew the client piece if necessary.  Has anybody here actually used 
Avatar?  Do the Blueprints examples use Avatar?  (haven't looked yet)


I know about some others (ajax tags, some jhook plan on the horizon for 
a custom partial-page rendering engine), but these seem like the most 
practical options for a project migrating to JSF today.


Only other requirement is that it works in Facelets.  I'm even willing 
to switch to RI (I know, I know- it's a MyFaces list) if that's required 
for Avatar.


Any thoughts would be much appreciated.  Thanks in advance-
Rogers


Re: best solution for partial page refresh

2006-02-09 Thread Jonas Jacobi




Hi Rogers,

The donation includes this functionality. The parts that are available
in the commercial solution (and not in the donation) are RenderKits for
Wireless and Telnet.

Partial Page Rendering should work out of the box :)

Thanks,
Jonas

Rogers Reilly wrote:
Hi,
  
  
I've been looking into different ways to partially refresh a JSF page
(actually a Facelets page) to get more responsive components
(datagrids, etc.), and have come up with a few options. Thought I'd
see if anyone on this list had strong opinions on one versus the
others. I'm willing to do client-side JS if necessary, but ideally the
solution would be as simple as adding an attribute in a JSF-ish tag.
  
  
Here's what I've found:
  
  
1) ADF Faces. Jacob Hookom did a blog entry in September with the
following code snippet from Oracle's ADF:
  
  
af:commandButton action="" partialSubmit="true"/
  
af:commandButton text="Refresh Some Things" partialSubmit="true"
id="refresh"/
  
af:outputText value="#{oneValue}" partialTriggers="refresh"/
  
af:outputText value="#{anotherValue}" partialTriggers="refresh
otherRefresh"/
  
  
This is exactly what I'm looking for (assuming there are
af:datagrid, af:xxx components for all the regular components),
but I wasn't sure whether or not the donated Oracle components include
this partial refresh capability. I've heard some components are only
available in the commercial release ... is this one of them?
  
  
2) ajaxanywhere http://ajaxanywhere.sourceforge.net/. A pretty
clean way to designate parts of the page to refresh. This project
looks like an option, but it does seem like triggering the partial
refresh requires you to call an ajaxanywhere-specific JS
function--which is not a dealbreaker, but "less nice" than the ADF
method. My sense is I could definitely make this work if the other two
options aren't feasible yet.
  
  
3) JSF Avatar. Not much info out there about Avatar, but it seems to
be a Sun-powered extension of JSF that allows you to designate a
ProcessingContext, so that JSF can organically create just the
components that're asked for by an AJAX request. This one is
conceptually appealing, but it seems very nascent and I'm not sure how
usable it is. (only available in a Glassfish container? I need
something I can drop into Tomcat or Resin) I've read that the
server-side piece is implemented somewhere at Sun, and I'd be willing
to homebrew the client piece if necessary. Has anybody here actually
used Avatar? Do the Blueprints examples use Avatar? (haven't looked
yet)
  
  
I know about some others (ajax tags, some jhook plan on the horizon for
a custom partial-page rendering engine), but these seem like the most
practical options for a project migrating to JSF today.
  
  
Only other requirement is that it works in Facelets. I'm even willing
to switch to RI (I know, I know- it's a MyFaces list) if that's
required for Avatar.
  
  
Any thoughts would be much appreciated. Thanks in advance-
  
Rogers
  


-- 
Jonas Jacobi
Author: Pro
JSF and Ajax: Building Rich Internet Components
Blog: 
http://www.orablogs.com/jjacobi







Re: best solution for partial page refresh

2006-02-09 Thread Rogers Reilly
Thanks Jonas, that's great news.  I've got the zip here 
http://wiki.apache.org/myfaces/adfproposal and am going to give it a 
shot.  Is Facelets supported baked into that archive (the one from 
wiki.apache/myFaces) somewhere, or do I need a separate jar to get ADF 
tags working in .xhtml files?


on a side note- I just realized the book I preordered a couple days ago 
is yours.  Hope it's good!  :-)


Jonas Jacobi wrote:


Hi Rogers,

The donation includes this functionality. The parts that are available 
in the commercial solution (and not in the donation) are RenderKits 
for Wireless and Telnet.


Partial Page Rendering should work out of the box :)

Thanks,
Jonas

Rogers Reilly wrote:


Hi,

I've been looking into different ways to partially refresh a JSF page 
(actually a Facelets page) to get more responsive components 
(datagrids, etc.), and have come up with a few options.  Thought I'd 
see if anyone on this list had strong opinions on one versus the 
others.  I'm willing to do client-side JS if necessary, but ideally 
the solution would be as simple as adding an attribute in a JSF-ish tag.


Here's what I've found:

1) ADF Faces.  Jacob Hookom did a blog entry in September with the 
following code snippet from Oracle's ADF:


af:commandButton action=#{bean.method} partialSubmit=true/
af:commandButton text=Refresh Some Things partialSubmit=true 
id=refresh/

af:outputText value=#{oneValue} partialTriggers=refresh/
af:outputText value=#{anotherValue} partialTriggers=refresh 
otherRefresh/


This is exactly what I'm looking for (assuming there are 
af:datagrid, af:xxx components for all the regular components), but 
I wasn't sure whether or not the donated Oracle components include 
this partial refresh capability.  I've heard some components are only 
available in the commercial release ... is this one of them?


2) ajaxanywhere http://ajaxanywhere.sourceforge.net/.  A pretty 
clean way to designate parts of the page to refresh.  This project 
looks like an option, but it does seem like triggering the partial 
refresh requires you to call an ajaxanywhere-specific JS 
function--which is not a dealbreaker, but less nice than the ADF 
method.  My sense is I could definitely make this work if the other 
two options aren't feasible yet.


3) JSF Avatar.  Not much info out there about Avatar, but it seems to 
be a Sun-powered extension of JSF that allows you to designate a 
ProcessingContext, so that JSF can organically create just the 
components that're asked for by an AJAX request.  This one is 
conceptually appealing, but it seems very nascent and I'm not sure 
how usable it is.  (only available in a Glassfish container?  I need 
something I can drop into Tomcat or Resin)  I've read that the 
server-side piece is implemented somewhere at Sun, and I'd be willing 
to homebrew the client piece if necessary.  Has anybody here actually 
used Avatar?  Do the Blueprints examples use Avatar?  (haven't looked 
yet)


I know about some others (ajax tags, some jhook plan on the horizon 
for a custom partial-page rendering engine), but these seem like the 
most practical options for a project migrating to JSF today.


Only other requirement is that it works in Facelets.  I'm even 
willing to switch to RI (I know, I know- it's a MyFaces list) if 
that's required for Avatar.


Any thoughts would be much appreciated.  Thanks in advance-
Rogers



--
*Jonas Jacobi
Author*: Pro JSF and Ajax: Building Rich Internet Components 
http://apress.com/book/bookDisplay.html?bID=10044

*Blog*: http://www.orablogs.com/jjacobi