On 5/2/07, JS Portal Support <[EMAIL PROTECTED]> wrote:
Hi,

What I have is a floating dojo ContentPane (popup) that loads its content
though AJAX.

What I wish to achieve is for this ContentPane to handle multiple
requests/responses without interfering with the underlying view state of the
actual non-AJAX jsf page.

From what I understand JSF can solve this by using a phaseListner, but
shale's (sub)dialog seems to be stronger and better suited for the job. As
I'm new to this area I might be off and wrong here.

Before I start coding away and solve the problems I run into, I would love
to see some examples or documentation laying out how this can be done
elegantly. Can anyone point me in the right direction?


The dialog support will work nicely for you if you want the content of
the popup to itself be composed with JSF components.  Because the
popup is an independent window, it has its own component tree
independent of the main page, and goes through its own lifecycle
separately.  The dialog system even knows how to have separate dialogs
in progress in each window without getting confused.  There are
samples of how to start such popups in the shale-test-dialog-basic and
shale-test-dialog-scxml sample apps.

In your case, however, it sounds like you want to let Dojo deal with
the UI in the popup, and just need a way to provide the back end
services for the Ajax callbacks.  For that use case, I would also take
a look at using Shale Remoting for the callbacks.  Among other things,
this will let you map a request URL (originated by an XMLHttpRequest
from the client) directly to a public method on a particular managed
bean.  These requests do not have a component tree of their own (and
they don't affect the component tree for the main view).  The point
here is to let you leverage the non-UI server side features of JSF
(particularly managed beans and EL evaluation) for Ajax callbacks.

Besides the documentation on the Shale Remoting page itself, this
technique was used inside the Autocomplete Text Field component in the
Blueprints Catalog[1], which can serve as a pretty good coding example
for use within an application as well.

Craig

[1] https://bpcatalog.dev.java.net/


Regards,
Joost


Reply via email to